Shop System

Discussion in 'World Editor Help' started by jakarecosta, Sep 8, 2016.

  1. jakarecosta

    jakarecosta New Member

    Ratings:
    +0 / 0 / -0
    I want Help with a shop system i want to make

    i want when a unit uses a skill gives a specific iten and i tried to use speelbooks to gather all the itens "skills"
    but i had problems with the triggers and actions can anyone give me a light ?
     
  2. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,549 / 4 / -4
    I have no idea what you are trying to say. Could you try to explain your situation in more detail? And with a little bit more structure?
     
  3. jakarecosta

    jakarecosta New Member

    Ratings:
    +0 / 0 / -0
    i have a spell book full with skills when the unit uses X skill it gives Y iten and deduces the gold cost
    after this you have a iten that have spellbook skill when you use that iten you can choose the upgrade for that iten
    you use a X skill and removes the source of the skill in this case the iten and you get a upgrade for that iten


    unit skill(shop)>+iten -gold cost
    iten skill> -iten -gold +upgrade(a better iten of same sort)

    all that skills inside a spellbook so you can have multiple choices for buying/upgrading X iten

    srry i'm brasilian mi english its a shame
     
  4. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,549 / 4 / -4
    Okay, what exactly is your problem? Which part of these are you unable to do?

    I would suggest looking into the Charge Gold / Lumber ability. It is an ability which can cost you mana, gold and/or lumber. You can set the cost within the editor. Put these inside a spellbook ability and then detect a cast with the event "Unit - Unit starts the effect of an ability".
     
  5. jakarecosta

    jakarecosta New Member

    Ratings:
    +0 / 0 / -0
    but can i use multiples copyes of that skill i won't cause problems ? i was thinking in use channel skill on every iten the problem is i tryed to script that but i was unable to give the iten to the caster for some reason

    i was making like a database of skills and itens like

    set skill[1] skillX
    set iten[1] itenX
    set maxarray maxarray + 1
    set skill[2] skillY
    set iten[2] itenY
    set maxarray maxarray + 1

    and using loop A on the array to determine if the skill used is the same NÂș of the iten then giving the iten to the caster

    Event
    unit start casting skill
    Condition
    unit is a hero
    Actions
    loop A 0 to [maxarray] do actions
    if skill casted is skill[A] then
    give iten[A] to caster
     
    Last edited: Sep 12, 2016
  6. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,549 / 4 / -4
    The trigger you described should work. However, you need to make sure that each copy of the Channel ability has a different value set as its "Base Order ID". If two copies of Channel use the same Base Order ID and are given to the same unit then you wont be able to tell which abiliy was used.

    If your trigger is still not working I would recommend adding some debug outputs to your trigger to see if it is run at all or where it stops. You can also copy the entire trigger as text if you right click on top. You can then paste the text on this forum within [ code] tags.
     
  7. jakarecosta

    jakarecosta New Member

    Ratings:
    +0 / 0 / -0
    i'm having problems to put the channel skill in the spell book don't know why

    i did it once is not working now i add the skill in the spell list and add the spellbook in my unit but the channel skill its not showing in-game

    any other skill that i put in the spellbook works but the one based on the channel skill are not showing

    also i tryied to use the charge gold but i was unable to make te skill trigger the trigger what event should i use ?
     
  8. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,549 / 4 / -4
    The Channel ability has a data field which makes it visible / invisible. This field is, by default, set to invisible. You have to change that to visible in order to see the spell.

    For the "Charge Gold and Lumber" ability you NEED to use the "Unit Starts Effect of Ability" trigger as I said earlier. You should generally use that trigger for all your spells.
     
  9. jakarecosta

    jakarecosta New Member

    Ratings:
    +0 / 0 / -0
    ok now the problem is i'm giving the Charge Gold and Lumber to a iten making it a iten skill but wont work as i want

    the iten i put the Charge Gold and Lumber skill is giving the skill to the unit not being a usable iten even if i put perishable and activly used on it when the unit get the iten it appears on the actions panel

    [​IMG]

    The Itens that have the Charge Gold and Lumber and the skill showing on the action panel
     

    Attached Files:

  10. Accname

    Accname 2D-Graphics enthusiast

    Ratings:
    +1,549 / 4 / -4
    Okay, that is strange but it appears that is actually what it does. Didnt know that myself to be honest.

    Well, I guess you need to use the Channel ability then and trigger the gold cost yourself.
     
  11. jakarecosta

    jakarecosta New Member

    Ratings:
    +0 / 0 / -0
    I have been giving my mind a break for a while
    i resume the map modding today
    i changed the way i wanted to do the shop now my idea is to use kinda like this
    i have base materials that have values

    and there is the recipe itens to trigger the thing

    now the final iten has a cost
    example:
    Mana shard = 1
    Mana Crystal = 2
    Mana Relic = 5

    Magic Orb = 5 (cost)

    now you can either buy 2x Mana Crystal 1x Mana Shard And the Recipe or 1x Mana Relic and The Recipe so in both cases you get the final iten plus the bonuses from the materials too

    i just need a trigger to check all the itens from the inv to get a match x.x
     

Share This Page