Conditions not working right (May be kind of long)

Mic9

New Member
Reaction score
6
Ok, this trigger was suppose to be simple but is turning out really long. The trigger is to make it so when a hero uses an item with the right conditions then the owner of that unit will receive a new hero. NOTE: I am using ROC editor so the If/Then/Else action will be long.

The conditions is that the hero must be at least level 5, and the owner must have at least 30 gold.

I broke this down into two triggers and this is what I have so far. The first trigger listed is working fine so far and is just for reference

-A unit owned by player 1 (red) uses an item
-Owner of (triggering unit) current gold is greater/equal to 30
Hero level of (triggering unit) is greater/equal to 5
Unit type of (triggering unit) is equal to MY HERO
Item type of (item manipulated) is equal to (CUSTOM Item hero uses)
-Unit - Remove (triggering unit) from game
Unit - Create 1 NEW HERO at position of (triggering unit)
Player - Set Owner of (triggering unit) - 30 gold

The trigger below is where problems keep showing up. It seems that all other conditions are being met except the one where when a player has the hero at level 5 but not enough gold to meet the second condition.

-A unit owned by player 1 (red) loses an item

-Unit type of (triggering unit) is equal to MY HERO
Item type of (item manipulated) is equal to (CUSTOM Item hero uses)

-If (owner of triggering unit) current gold is greater/equal to 30 then do If Hero level of (triggering unit) is greater/equal to 5 then do skip remaining actions

-If (owner of triggering unit) current gold is less then 30 then do If Hero level of (triggering unit) is less than/equal to 5 then do Create 1 (CUSTOM ITEM) and give it to (triggering unit) else do nothing else do if Hero level of (triggering unit) is less than/equal to 5 then do Create 1 (CUSTOM ITEM) and give it to (triggering unit) else do If (owner of triggering unit) current gold is less then 30 then do Create 1 (CUSTOM ITem and give it to (triggering unit) else do nothing
[/B]
 

Tyrulan

Ultra Cool Member
Reaction score
37
Rather you posted the trigger, I can then tell you where you've gone wrong. :)
 

Mic9

New Member
Reaction score
6
Ok, I made another copy
Trigger:
  • Events
    • Unit - A unit owned by Player 1 (Red) Loses an item
    • Unit - A unit owned by Player 2 (Blue) Loses an item
    • Unit - A unit owned by Player 3 (Teal) Loses an item
    • Unit - A unit owned by Player 4 (Purple) Loses an item
    • Unit - A unit owned by Player 5 (Yellow) Loses an item
    • Unit - A unit owned by Player 6 (Orange) Loses an item
    • Unit - A unit owned by Player 7 (Green) Loses an item
    • Unit - A unit owned by Player 8 (Pink) Loses an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Marine
      • (Item-type of (Item being manipulated)) Equal to Super Marine
    • Actions
      • If (((Owner of (Triggering unit)) Current gold) Greater than or equal to 30) then do (If ((Hero level of (Triggering unit)) Greater than or equal to 5) then do (Skip remaining actions) else do (Do nothing)) else do (Do nothing)
      • If (((Owner of (Triggering unit)) Current gold) Less than 30) then do (If ((Hero level of (Triggering unit)) Less than 5) then do (Hero - Create Super Marine and give it to (Triggering unit)) else do (Do nothing)) else do (If ((Hero level of (Triggering unit)) Less than or equal to 5) then do (Hero - Create Super Marine and give it to (Triggering unit)) else do (If (((Owner of (Triggering unit)) Current gold) Less than 30) then do (Hero - Create Super Marine and give
 

2evil

New Member
Reaction score
16
The second if loop cuts out, the code hit the letter limit
--EDIT-- didnt see that you have ROC

can you copy the rest of the second if in anyhow
--EDIT-- to help
Trigger:
  • If Owner of (Triggering unit) Current gold Greater than or equal to 30
    • then do
      • If Hero level of Triggering unit Greater than or equal to 5
      • then do (Skip remaining actions)
      • else do (Do nothing))
    • else do (Do nothing)

Trigger:
  • If (owner of triggering unit) current gold is less then 30
    • then
      • If Hero level of (triggering unit) is less than/equal to 5
      • then do Create 1 (CUSTOM ITEM) and give it to (triggering unit)
      • else do nothing
    • else do
      • if Hero level of (triggering unit) is less than/equal to 5
      • then do Create 1 (CUSTOM ITEM) and give it to (triggering unit)
      • else do
        • If (owner of triggering unit) current gold is less then 30
        • then do Create 1 (CUSTOM ITem and give it to (triggering unit)
        • else do nothing


This last trigger repeats itself 3 times, as long as their gold is under 30 and the hero is level 5 or less, it will always go to the first then. It will never get to the last else.
I will work on some fixed code give me a second

BTW, is it even executing? If an unit uses an item, I dont think WC3 sees it as 'loosing an item'
 

Mic9

New Member
Reaction score
6
Yes the trigger is executing when a unit loses an item. The only else option that isn't working is when a hero is level 5 and under but doesn't have 30 gold.
 

2evil

New Member
Reaction score
16
I just want to double-check:
this item they have is triggered to be undroppable and then when used makes them into a new hero? Why not just make the item undroppable, you can remove the full second trigger and in the first one, add giving the item back to them [if they do not meet the conditions] under the else
 

Mic9

New Member
Reaction score
6
The item is already set to undroppable. When the hero uses the one CUSTOM item he is suppose to get a new hero if all conditions are met. If they do not meet the conditions the item is suppose to be used anyway but the hero will be given a new item in their inventory.

The problem is trying to come up with a trigger that will give the hero another item if the conditions are not met.
Again the conditions for a new item to be given again are:
-If a hero is level 5 or under but does not have 30 gold or more
-If the owner does not have 30 gold but is level 5 or over
-If the hero is under level 5 and does not have 30 gold
 

2evil

New Member
Reaction score
16
Trigger:
  • If player has >30 gold
    • then
      • if hero is > level 5
      • then do nothing
      • else give hero item
    • else
      • Give hero item


OR if ROC can do it:

Trigger:
  • If (multiple)
    • player has >30 gold
    • hero is > level 5
    • then
      • then do nothing
    • else
      • Give hero item
 

Mic9

New Member
Reaction score
6
Lol this made everything a lot easier:
Trigger:
  • If (((Owner of (Triggering unit)) Current gold) Greater than or equal to 30) then do (If ((Hero level of (Triggering unit)) Greater than or equal to 5) then do (Do nothing) else do (Hero - Create CUSTOM ITEM and give it to (Triggering unit))) else do (Hero - Create CUSTOM ITEM and give it to (Triggering unit))


Small problem that keeps happening though. If the owner meets the condition to get a new unit he will still receive the old CUSTOM item and it will be dropped on the floor.
 

2evil

New Member
Reaction score
16
sorry, i got busy and forgot about your thread :S
Trigger:
  • If
    • (((Owner of (Triggering unit)) Current gold) Greater than or equal to 30)
    • then do
      • If
        • ((Hero level of (Triggering unit)) Greater than or equal to 5)
      • then do
        • (Do nothing)
      • else do
        • (Hero - Create CUSTOM ITEM and give it to (Triggering unit)))
    • else do
      • (Hero - Create CUSTOM ITEM and give it to (Triggering unit))



hrrrmm that seems mighty strange, you have a duplicate or another trigger that may be doing that?
 

Mic9

New Member
Reaction score
6
I's ok I solved the problem by making a simple trigger that removes the item from the game if it is given to the new hero. Everything is working fine now THANKS +rep
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top