| 08-01-2004, 09:58 PM | #1 |
Here is what I have: 2 Triggers--one that switches your hero into a melee version, and one that switches you into a ranged version. It gives you all your items back, too--and it selects the hero for you. That is all fine--the problem? See below. I have a weapon system which you can use ranged weapons, and you can only have one at a time. And you need to switch to ranged mode in order to use them, or your attack will not work. Confused? Look at these triggers: Code:
Bow Lost
Events
Unit - A unit Loses an item
Unit - A unit Pawns an item (to shop)
Conditions
Or - Any (Conditions) are true
Conditions
(Item-type of (Item being manipulated)) Equal to Bow
(Item-type of (Sold Item)) Equal to Bow
Actions
Set BowEquipped[(Player number of (Owner of (Hero manipulating item)))] = False
Set BowEquipped[(Player number of (Owner of (Selling unit)))] = False
Bow Aquired
Events
Unit - A unit Acquires an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Item-type of (Item being manipulated)) Equal to Bow
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
BowEquipped[(Player number of (Owner of (Hero manipulating item)))] Equal to False
Then - Actions
Set BowEquipped[(Player number of (Owner of (Hero manipulating item)))] = True
Else - Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You already have a ...
Else - Actions
Do nothing
Bow Ranged
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Ranged Mode
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set HeroItems[((Player number of (Owner of (Casting unit))) x (10 + (Integer A)))] = (Item carried by Hero[(Player number of (Owner of (Hero manipulating item)))] in slot (Integer A))
Unit - Replace (Casting unit) with a Hero (Ranged) using The old unit's relative life and mana
Set Hero[(Player number of (Owner of (Last replaced unit)))] = (Last replaced unit)
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Hero - Give HeroItems[((Player number of (Owner of (Casting unit))) x (10 + (Integer A)))] to (Last replaced unit)
Bow Melee
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Melee Mode
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set HeroItems[((Player number of (Owner of (Casting unit))) x (10 + (Integer A)))] = (Item carried by Hero[(Player number of (Owner of (Casting unit)))] in slot 1)
Unit - Replace (Casting unit) with a Hero (Melee) using The old unit's relative life and mana
Set Hero[(Player number of (Owner of (Last replaced unit)))] = (Last replaced unit)
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Hero - Give HeroItems[((Player number of (Owner of (Casting unit))) x (10 + 6))] to (Last replaced unit)The problem? Everything works fine except for the Bow Lost trigger--it seems that every other time I try to pick up a bow with one already in my hand, it works! So like this: Pick Up 1, Success, 2, Fail, 3 Success, and so on. This happens without me dropping a bow or anything. If I leave the Bow Lost trigger out, it works fine--but I need the Bow Lost trigger! Help please! |
| 08-01-2004, 10:41 PM | #2 |
For the First trigger, the only thing that could be wrong, you should use triggering unit, maybe, this may look stupid, but you might try.Another thing: never use "begins casting an abillity", use "Starts the Effect of an abillity".You might try making two different triggers, instead of only one. |
| 08-01-2004, 11:31 PM | #3 | |
Quote:
That doesn't work... Read: "If I leave the Bow Lost trigger out, it works fine--but I need the Bow Lost trigger!" And about the "Starts the Effect of an ability" is used only for abilities with effects--E.G., Cloud, Starfall, etc. . And, I already said that those triggers are working fine, so thats not the problem. |
| 08-02-2004, 01:23 AM | #4 |
Fear the bump. Come ON already! I need help here! Yet of course, nobody reads any messages with something already posted on it... Tch. |
| 08-02-2004, 02:27 AM | #5 |
Forgive me for not reading all the triggers, but the Bow Lost trigger seems dangerous to me. Try splitting it into two; one for dropping the bow, one for selling it. |
| 08-02-2004, 02:50 AM | #6 |
Try doing this: use the trigger Game- Display Text to player to print your variables and what triggers are running, which path of an if is taken things like that. If the trigger is running correctly the first time but not the third time one of your variables may be the problem. Oh wait I figured it out. The Hero Acquires an item trigger is the problem, You make the hero drop the item if he cant carry it. This causes the drop trigger to run, which is why you can pick one up after that. |
| 08-02-2004, 05:30 AM | #7 |
I think 'Hero manipulating item' is the wrong thing to use. I'm not sure what other ones you could use, however. |
| 08-02-2004, 07:34 AM | #8 | |
Quote:
|
