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
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top