Thursday, April 19, 2012

My shop triggers wont work. :(

I want the option for my player to buy abilities from a shop, now, the system i made is that they buy items (which actually do nothing) from the shop, then when they use the items, a trigger kicks in that actually teaches the ability based on which item is used and which unit is using it. My triggers are not working however, i don't know why for the life of me. Here is one;


Code:
Sweeping Strikes
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Manual of Sweeping Strikes
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SweepingStrikes Equal to 0
(Unit-type of (Triggering unit)) Equal to (rogue)
Then - Actions
Unit - Add Sweeping Strikes (ROGUE) to (Triggering unit)
Set SweepingStrikes = 1
Else - Actions
Do nothing

Can anyone point out why they aren't working? Or, if possible, a more simple ability purchasing system?

|||uhm. some triggers does not work with "Triggering unit" pointer. An alternate way maybe is using "owner of item being manipulated"|||I feel like an idiot now.

Thanks for the tip!|||Hmm, i spent a couple days working on other things in my map, but when i finally came around to adding a fix to this problem i discovered it still wouldn't work!

This is my trigger now;


Code:
Sweeping Strikes
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Manual of Sweeping Strikes
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SweepingStrikes Equal to 0
(Unit-type of (Hero manipulating item)) Equal to (rogue)
Then - Actions
Unit - Add Sweeping Strikes (ROGUE) to (Hero manipulating item)
Set SweepingStrikes = 1
Else - Actions
Do nothing

Any ideas as to why it isn't working?|||Sometimes these trigger problems can be bypassed by changing things around. Like from:


Code:
...(Item-type of (Item being manipulated)) Equal to ...

into

Code:
Sweeping Strikes
Events
Unit - A unit Sells an item (from shop)
Conditions
(Sold Item) Equal to Manual of Sweeping Strikes
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SweepingStrikes Equal to 0
(Unit-type of (Hero manipulating item)) Equal to (rogue)
Then - Actions
Unit - Add Sweeping Strikes (ROGUE) to (Hero manipulating item)
Set SweepingStrikes = 1
Else - Actions
Do nothing

Maybe that will work. I havent tested it but it may provide a solution (or some insight) to your problem. Hope this helps and good luck!|||Thanks for the input, i tried it but unfortunatley it still didn't work. I got annoyed with it so i just completely redesigned the way my heroes purchase new abilities. My new system is fully functional and works like a charm. |||This is what I am after. I made a map and everything was fine but then i decided to change the need for buying each lvl of abilty to lvling up like normal... Now I have a lvlup system that doesn't work

This is a hero def map and you start off buying a hero and then the abilities you want. First off I made it so instead of lvl points you got lumber and used the lumber to buy more skills or lvlup your existing skills. This worked well but meant after each lvlup you had to run back to the shop to gain a new ability lvl. What i want to do is teach the ability to the hero (ability lvl 0) so they cant use it until the lvl up and then spend the points as if the hero had started with that ability as normal without editing.

After rewriting these triggers almost a dozen times I have simplified them a lot and learnt a lot too but just cannot get them to work how i want. Here is a briefly cut piece of my "Aura shop":


Code:
Aura Shop
Events
Unit - A unit Acquires an item
Conditions
(Item-class of (Item being manipulated)) Equal to Powerup
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Brilliance Aura
Then - Actions
Hero - Learn skill for (Triggering unit): Brilliance Aura
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Devotion Aura
Then - Actions
Hero - Learn skill for (Triggering unit): Devotion Aura
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Endurance Aura
Then - Actions
Hero - Learn skill for (Triggering unit): Endurance Aura
Else - Actions

... and so on for each ability (i'm sure i do not need to list an entire page of repeating triggers).

The abilities have been edited and the items have been made as powerup items (based on the xp powerup but now gives 0xp but still has animation).

No comments:

Post a Comment