[Trigger] Showing text on certain conditions

Status
Not open for further replies.
Level 15
Joined
Aug 18, 2007
Messages
1,390
Now, im making on my map, and wanted to add items that gave abillities aslong they stay in your inventory. It all works fine with the adding/removing spells, but then...

I only want players to be able to have one of theese Power Ups at once, if you buy a Power up, while allready having the other one, it should give an error message. Now, the problem is, that the text is shown when you buy anything else, or just buy the Power up, without having the other one. I can see the error is there, but i dont know how i can fix it, so the text only shows when you can't buy.
Thanks in advance.
Btw, heres my Trigger :

  • Events
    • Unit - Aquires an Item
  • Conditions
  • Actions
    • If (All conditions are true) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item type of (Item bieng manipullated)) Equal to (Power Up: Blink)
        • (Hero manipullating Item) has (Item of Item-type (Power up: Windwalk) Equal to (False)
      • Then - Actions
        • Add (Blink to (Hero manipulating item)
      • Else - Actions
        • Game - Display to (all players) the Text (Blah blah .....)
    • If (All conditions are true) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item type of (Item bieng manipullated)) Equal to (Power Up: Windwalk)
        • (Hero manipullating Item) has (Item of Item-type (Power up: Blink) Equal to (False)
      • Then - Actions
        • Add (Wind Walk to (Hero manipulating item)
      • Else - Actions
        • Game - Display to (all players) the Text (Blah blah BLAH.....)
 
It says
  • (Hero manipullating Item) has (Item of Item-type (Power up: Windwalk) Equal to (False)
So actually you get the error message when you do have the other item. Set it 'Equal to True'.

What? That's what he WANTS. As for the trigger, I don't see why it's not working, unless you're buying the wrong item.
 
Wtf.
It should be false, yeah, but items are mixed up.
They are:
Blink -> Windwalk
Windwalk -> Blink
And should be:
Blink -> Blink
Windwalk -> Windwalk
And yeah the then actions are unnecessary ;)
 
Sorry, misread that part '^^
Anyway, since there's no other problem noticeable in my opinion, I think the only thing in this trigger that could cause a problem is that same line.

Use a Item-Type Comparison instead of a Boolean Comparison. You'll get:
  • (Item-type of (Item being manipulated)) Equal to (Power up: Windwalk)
The reason this could be the solution is that the condition may be checked before the items goes into your inventory. With this Item-Type Comparison you can avoid that in case that's the problem.
 
Oh, there's your problem then. In an if-statement, the else condition is true if the "if" conditions are false.

In propositional logic:

If X, do A
Else do B

If X is true, it will do A. But if X is false, and regardless of what other conditions there are, X is still false and so it does B.

So have it show the text message if and ONLY if the item being manipulated is already owned.
 
Thanks (+rep) thought it was something like that, but im kinda tired, so i made you guys do the thinking xD

Edit, Worked, but i have 2 problems now:

1: This wont stop players from buying the same item twice!
2: This will check Blink first, meaning if i have wind walk, and buy blink, the Windwalk will be removed, instead of the Blink.
 
Status
Not open for further replies.
Back
Top