Hunger System NEW

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
OK, so I'm creating a new hunger system that doesn't use the "Food" as anything, so the "Food used" can be used for units.

But the problem is when I try getting it to work for 1 player nothing happens. (One of them actually + 2 to the hunger)
OK, heres the triggers:

Trigger:
  • MBP1
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
      • (Player 1 (Red) controller) Equal to User
    • Actions
      • Custom script: if ( GetLocalPlayer() == Player(0) ) then
      • Multiboard - Create a multiboard with 1 columns and 2 rows, titled Your Hunger Level
      • Set Multiboard[1] = (Last created multiboard)
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Your Hunger Level i...
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to 0
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 2 to 10.00% of the total screen width
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 2 to Show text and Hide icons
      • Custom script: endif

Useless, but needed!
Trigger:
  • Player Eats
    • Events
      • Unit - A unit Uses 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 Cooked fish (Small)
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 2)))
        • Else - 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 Meat
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 6)))
        • Else - 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 cooked fish (Large)
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 8)))
        • Else - 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 cooked fish (Medium)
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 7)))
        • Else - Actions

Trigger that doesn't work
Trigger:
  • Deal Player Hitpoints 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Food[1] Equal to 100
        • Then - Actions
          • Trigger - Run Deal Player HitPoints 3 <gen> (ignoring conditions)
        • Else - Actions

This triggers the next trigger if Food[1] gets to 100
Trigger:
  • Deal Player HitPoints 3
    • Events
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • Hero - Modify unspent skill points of (Triggering unit): Add 1 points
      • Hero - Learn skill for (Triggering unit): Your Hungry!

What this trigger does is if your food[1] gets to 100 then you get an ability.
Trigger:
  • Deal Player Histpoints REMOVE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Food[1] Less than or equal to 99
        • Then - Actions
          • Unit - Remove Your Hungry! from (Triggering unit)
        • Else - Actions

Can someone tell me why these don't work so I can fix them.

I have a feeling its cause I haven't
Trigger:
  • set Food[1] = Food[1] - #

in
Trigger:
  • Player Eats
    • Events
      • Unit - A unit Uses 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 Cooked fish (Small)
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 2)))
        • Else - 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 Meat
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 6)))
        • Else - 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 cooked fish (Large)
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 8)))
        • Else - 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 cooked fish (Medium)
        • Then - Actions
          • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String((Food[1] - 7)))
        • Else - Actions

but if its not, tell me why, I'll fix it in the morning, just wanna know what it is. (if any other triggers from that trigger doesn't work then tell me.) thanks in advance. EDIT:Yes it was cause I didn't "Set" the food variable. But I may have another problem.

Ok, I edited most the trigger to:
Trigger:
  • Change nmbr every game time hour
    • Events
      • Time - Every 40.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Food[1] Equal to 100
        • Then - Actions
          • Set Food[1] = (Food[1] + 0)
          • Trigger - Run Deal Player Hitpoints 2 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 2 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 3 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 4 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 5 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 6 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 7 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 8 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 9 <gen> (ignoring conditions)
          • Trigger - Run Deal Player Hitpoints 2 Copy 10 <gen> (ignoring conditions)
        • Else - Action
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Food[1] Less than or equal to 99
            • Then - Actions
              • Set Food[1] = (Food[1] + 10)
              • Multiboard - Set the text for Multiboard[1] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[2] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[3] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[4] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[5] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[6] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[7] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[8] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[9] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[10] item in column 1, row 2 to (String(Food[1]))
              • Multiboard - Set the text for Multiboard[11] item in column 1, row 2 to (String(Food[1]))
            • Else - Actions

Trigger:
  • Deal Player Hitpoints 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Food[1] Equal to 100
        • Then - Actions
          • Trigger - Run Deal Player HitPoints 3 <gen> (ignoring conditions)
        • Else - Actions

Trigger:
  • Deal Player HitPoints 3
    • Events
    • Conditions
    • Actions
      • Wait 15.00 seconds
      • Unit - Add Your Hungry! to RedHero

Trigger:
  • Deal Player Histpoints REMOVE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Food[1] Less than or equal to 99
        • Then - Actions
          • Unit - Remove Your Hungry! from RedHero
        • Else - Actions


RedHero is a unit variable set like this:
Trigger:
  • Deal Player Histpoints REMOVE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Food[1] Less than or equal to 99
        • Then - Actions
          • Unit - Remove Your Hungry! from RedHero
        • Else - Actions

Trigger:
  • Male Str Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[5] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Male for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

Trigger:
  • Male Str Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[5] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Male for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

Trigger:
  • Male Agi Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[6] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Male for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

Trigger:
  • Female Str Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[2] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Female for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

Trigger:
  • Female Agi Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[3] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Female for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

Trigger:
  • Female Agi Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[3] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Female for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

Trigger:
  • Female Agi Copy
    • Events
      • Dialog - A dialog button is clicked for _HeroSelect
    • Conditions
      • _HeroBttns[3] Equal to (Clicked dialog button)
      • (Triggering player) Equal to Player 1 (Red)
    • Actions
      • Unit - Create 1 Female for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Set RedHero = (Last created unit)

(I did this for all players!) when food reaches 100, nothing happens. I am going to test where it all goes wrong by adding in
Trigger:
  • Game - Display to all players the text TEST!


It doesn't show the first test
The second test it does
the third test doesn't
the fouth test doesn't
the fifth test doesn't
the sixth test doesn't

I'm going through all of these triggers, double checking that they are A-OK

Any tips?

EDIT: YES, the "FOOD" Variable DOES go up 10 each time the "0 (AKA #/##)" in the multiboard does.

If you tell me how to fix the thing so it runs, I have a pretty good feeling that I should've used Turn on - Trigger instead of Run - Trigger

EDIT 2: I just fixed it, it works fine now.

Thanks TheHelper.net for nothing :) (Couldn't even post a reply suggesting what it may be) you guys can work it out for your selfs whats wrong if you want it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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