1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  5. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  8. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Hunger System 1.1 GUI bar version

Submitted by NFWar
This bundle is marked as approved. It works and satisfies the submission rules.
__________HUNGER SYSTEM__________

This is a system for survival maps or maps like LOAP. System is MUI, so multiple units can
use it. System is VERY lagless. It count down hunger value; zero = death; it show hunger
of unit in floating text. Unit can descrease hunger by using items that logicaly you may
count as food.

Updated:
-Better customization

Hope this is usefull. Dont be lazy and give credits.

Triggers
Create Heroes
  • Create Heros
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set MAP_Point[0] = (Center of Region 000 <gen>)
          • Unit - Create 1 Survivor for Player 1 (Red) at MAP_Point[0] facing (Random angle) degrees
          • Unit Group - Add (Last created unit) to HU_Group
          • Custom script: call RemoveLocation(udg_MAP_Point[0])

Preloading
  • Hunger Item data Preloading
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ----------Chicken Meat---------- --------
      • Set HU_ItemType[0] = Chiken Meat
      • Set HU_DescreaseFrom[0] = 10.00
      • Set HU_DescreaseTo[0] = 15.00
      • Set HU_HealFrom[0] = 50.00
      • Set HU_HealTo[0] = 70.00
      • -------- ----------Rabbit Meat---------- --------
      • Set HU_ItemType[1] = Rabbit Meat
      • Set HU_DescreaseFrom[1] = 5.00
      • Set HU_DescreaseTo[1] = 10.00
      • Set HU_HealFrom[1] = 35.00
      • Set HU_HealTo[1] = 60.00
      • -------- ----------Rat Meat---------- --------
      • Set HU_ItemType[2] = Rat Meat
      • Set HU_DescreaseFrom[2] = 3.00
      • Set HU_DescreaseTo[2] = 5.00
      • Set HU_HealFrom[2] = 20.00
      • Set HU_HealTo[2] = 40.00
      • -------- ----------Set variable to last item index---------- --------
      • Set HU_LastItemIndex = 2

Setings
  • Hunger Setings
    • Events
      • Unit - A unit enters (Playable map area)
      • Unit - A unit Finishes reviving
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HU_Skip Equal to 0
        • Then - Actions
          • Trigger - Turn on Hunger Loop <gen>
        • Else - Actions
      • Set HU_Skip = (HU_Skip + 1)
      • Set HU_Times = (HU_Times + 1)
      • Set HU_Off[HU_Times] = True
      • Set HU_Unit[HU_Times] = (Triggering unit)
      • -------- This is max hunger value. It show hou mach long ur unit can be without food. Make passive spell that will increase this value and make ur survivor to resist hunger more. --------
      • Set HU_MaxValue[HU_Times] = 75.00
      • -------- This is starting hunger value of ur hero. it is equal to Max value because at start your hero may be not hungry. --------
      • Set HU_Value[HU_Times] = 75.00
      • -------- This is Bar that will show hunger level. Changing of characters mean changing type of bar. Here I used "I" (ai) that is fat character and bar in game looks almost without spaces. --------
      • -------- You may use "|" (vertical line) that will cause troubles with showing bar, because it is part of |cff###|r color. Also bar will need about 100-200 or this characters to be long enagth. --------
      • -------- "|" is most thin character and it hide all spaces if it is small enagth. To kill problem with |cff###|r color, you may need to set 2 strings (left and right values) and combine them. --------
      • -------- I used "I" (ai) because meter dont need to be 100-200 characters that is big variable. Better set HU_Meter as Global variable. It will mean what it is one style and size of hunger bar for all units. --------
      • Set HU_Meter[HU_Times] = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
      • -------- "|" is most thin character and it hide all spaces if it is small enagth. To kill problem with |cff###|r color, you may need to set 2 strings (left and right values) and combine them. --------
      • Set HU_BarSize[HU_Times] = (Length of HU_Meter[HU_Times])
      • Set HU_Point[0] = (Position of (Triggering unit))
      • -------- So I gave you version with bar near unit. In multiboard you will not need HU_Text variable. --------
      • Floating Text - Create floating text that reads HU_Meter[HU_Times] at HU_Point[0] with Z offset 0.00, using font size 4.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set HU_Text[HU_Times] = (Last created floating text)
      • -------- If you want to use it near unit, so hide text for all players and show to owner of hungry hero. Else other players will see all units bars and it will be crapy. --------
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Show (Last created floating text) for (Player group((Owner of (Triggering unit))))
      • Custom script: call RemoveLocation(udg_HU_Point[0])

Loop
  • Hunger Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HU) from 1 to HU_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HU_Off[HU] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • HU_Value[HU] Less than or equal to 0.00
                      • (HU_Unit[HU] is dead) Equal to True
                      • HU_Unit[HU] Equal to No unit
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HU_Value[HU] Less than or equal to 0.00
                    • Then - Actions
                      • Unit - Kill HU_Unit[HU]
                    • Else - Actions
                  • Floating Text - Destroy HU_Text[HU]
                  • Set HU_Off[HU] = False
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HU Less than HU_Times
                    • Then - Actions
                      • Set HU_Off[HU] = HU_Off[HU_Times]
                      • Set HU_Unit[HU] = HU_Unit[HU_Times]
                      • Set HU_BarSize[HU] = HU_BarSize[HU_Times]
                      • Set HU_MaxValue[HU] = HU_MaxValue[HU_Times]
                      • Set HU_Color[HU] = HU_Color[HU_Times]
                      • Set HU_Meter[HU] = HU_Meter[HU_Times]
                      • Set HU_Value[HU] = HU_Value[HU_Times]
                      • Set HU_Text[HU] = HU_Text[HU_Times]
                    • Else - Actions
                  • Set HU = (HU - 1)
                  • Set HU_Times = (HU_Times - 1)
                  • Set HU_Skip = (HU_Skip - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HU_Skip Equal to 0
                    • Then - Actions
                      • Set HU_Times = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HU_Value[HU] Greater than HU_MaxValue[HU]
                    • Then - Actions
                      • Set HU_Value[HU] = HU_MaxValue[HU]
                    • Else - Actions
                  • -------- Hunger increase interval is 0.01 so ~ hunger increse per second is 0.11. So 75.00/0.11=681.(81) seconds without food or 11 min and 20 sec without food. Calculate and Balance it as you wish. --------
                  • Set HU_Value[HU] = (HU_Value[HU] - 0.01)
                  • Set HU_Color[HU] = (Integer(((HU_Value[HU] / HU_MaxValue[HU]) x (Real(HU_BarSize[HU])))))
                  • Floating Text - Change text of HU_Text[HU] to ((|cffffff00 + ((Substring(HU_Meter[HU], 1, HU_Color[HU])) + |r)) + (|cffff0000 + ((Substring(HU_Meter[HU], (HU_Color[HU] + 1), HU_BarSize[HU])) + |r))) using font size 4.00
                  • -------- Applying text to unit position. --------
                  • Set HU_Point[1] = (Position of HU_Unit[HU])
                  • Floating Text - Change the position of HU_Text[HU] to HU_Point[1] with Z offset 100.00
                  • Custom script: call RemoveLocation(udg_HU_Point[1])
            • Else - Actions

DescreaseHunger
  • Descreace Hunger
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • ((Triggering unit) is in HU_Group) Equal to True
    • Actions
      • For each (Integer HU2) from 1 to HU_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to HU_Unit[HU2]
            • Then - Actions
              • For each (Integer HU3) from 0 to HU_LastItemIndex, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item being manipulated)) Equal to HU_ItemType[HU3]
                    • Then - Actions
                      • Set HU_Value[HU2] = (HU_Value[HU2] + (Random real number between HU_DescreaseFrom[HU3] and HU_DescreaseTo[HU3]))
                      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Random real number between HU_HealFrom[HU3] and HU_HealTo[HU3]))
                      • Set HU3 = HU_LastItemIndex
                    • Else - Actions
              • Set HU2 = HU_Times
            • Else - Actions



Keywords:
Hunger, Hungry, Loap, Survival, Food, Need, Simple, NFWar, Bar, Visual
Contents

Hunger System 1.0 GUI bar version (Map)

Reviews
Moderator
19:26, 17th Jun 2010 Hanky: There are just two things that could be improved: - increase the periodic interval to 0.05 or something, that will be still smooth enough - you could improve the indexing of your system Apart from that stuff the...
  1. 19:26, 17th Jun 2010
    Hanky:
    There are just two things that could be improved:
    - increase the periodic interval to 0.05 or something, that will be still smooth enough
    - you could improve the indexing of your system

    Apart from that stuff the system looks fine enough for an approval.
     
  2. Skycex

    Skycex

    Joined:
    Sep 12, 2009
    Messages:
    32
    Resources:
    0
    Resources:
    0
    Wow... Very userfull! I will give ya credits if u use it! Cool :D +rep
     
  3. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    I love the Idea of it:D It might be usefull to some.... but It might need something more.... like you need to cook the food or the food might be rotten or something so you get a disea
     
  4. NFWar

    NFWar

    Joined:
    Jul 27, 2008
    Messages:
    1,314
    Resources:
    227
    Models:
    1
    Icons:
    215
    Packs:
    1
    Skins:
    2
    Spells:
    6
    Tutorials:
    2
    Resources:
    227
    Cooking is recipe system. About roten food. Make this food unit and when you kill is (unroot) it drop item that u can eat or cook.
     
  5. karland90

    karland90

    Joined:
    Mar 30, 2009
    Messages:
    959
    Resources:
    3
    Models:
    3
    Resources:
    3
    i have a food system in my map and implemented vomiting too. when a player eats too much (or raw fish for example) then he can vomit. vomiting creates sfx, sound, animation and decreases food eaten. btw mine is only MPI

    EDIT: btw your testmap could use some more food. they die really fast xD
     
  6. naitsirk

    naitsirk

    Joined:
    Jan 24, 2009
    Messages:
    570
    Resources:
    0
    Resources:
    0
    Well, what I mean is... since its a hunger bar it should also be that like 20-40% chance for the meat that drops to be bad. It makes logic sense and meat can also become rotten. I am just saying that Rotten food should decrease the Hunger Bar or Give deseases
     
  7. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,127
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    Useful for survival maps and RPG's. :thumbsup:
     
  8. 88WaRCraFT3

    88WaRCraFT3

    Joined:
    Jun 9, 2009
    Messages:
    1,139
    Resources:
    1
    Spells:
    1
    Resources:
    1
    +rep man. I will use that. Is there anyway to set this visible only when i press ALT?
     
  9. NFWar

    NFWar

    Joined:
    Jul 27, 2008
    Messages:
    1,314
    Resources:
    227
    Models:
    1
    Icons:
    215
    Packs:
    1
    Skins:
    2
    Spells:
    6
    Tutorials:
    2
    Resources:
    227
    Huh? it is visible only for owner of hungry unit and always. Alt is health bar that is visible when you press ALT of you can set in Warcraft options to Always Show Unit helth bar.
     
  10. metal_13

    metal_13

    Joined:
    Jul 18, 2008
    Messages:
    154
    Resources:
    2
    Maps:
    2
    Resources:
    2
    y do they die like "instant?" how about, when hunger is = to 0...
    loop2: damage x unit every 1 sec... til they die...
     
  11. NFWar

    NFWar

    Joined:
    Jul 27, 2008
    Messages:
    1,314
    Resources:
    227
    Models:
    1
    Icons:
    215
    Packs:
    1
    Skins:
    2
    Spells:
    6
    Tutorials:
    2
    Resources:
    227
    You dont got it do you? Unit dont die instant. It dies with time... bar show it.
    This system make gameplay harder because you need to care not about helth of unit, but about his desire of food also. Unit can die now not just from damage, but by not using some items (food items that you locicaly call food). Do you take damage if you hungry? If I will fall from bike and will be half dead, I will be half hungry? This you want me to do: make unit to take damage and call it hunger. This is totaly wrong. I created desire of unit that is not only Health, if he take a llot of damage to die, but desire to "eat". Desire dont have connections with life. You must to keep both in balance to kep unit alive.
     
    Last edited: Mar 11, 2010
  12. karland90

    karland90

    Joined:
    Mar 30, 2009
    Messages:
    959
    Resources:
    3
    Models:
    3
    Resources:
    3
    imo what metal_13 tred to say is:
    that when a unit's hunger-bar reaches 0, the unit would instead START to lose hp, not die instantly.

    i hope i made this more clear. ^^
     
  13. 88WaRCraFT3

    88WaRCraFT3

    Joined:
    Jun 9, 2009
    Messages:
    1,139
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thats true when i don't eat 3-4 days i will die, i will not take any damage or feel anything other.
     
  14. karland90

    karland90

    Joined:
    Mar 30, 2009
    Messages:
    959
    Resources:
    3
    Models:
    3
    Resources:
    3
    i agree. but it takes waaaaaay longer than one week to die of hunger. i couldnt find the exact data, but it is about one week for death of dehydration and about one month for death of starvation.
     
  15. 88WaRCraFT3

    88WaRCraFT3

    Joined:
    Jun 9, 2009
    Messages:
    1,139
    Resources:
    1
    Spells:
    1
    Resources:
    1
    i know, but it is example.
     
  16. RaidonGod

    RaidonGod

    Joined:
    Oct 7, 2008
    Messages:
    285
    Resources:
    5
    Models:
    3
    Icons:
    2
    Resources:
    5
    Well, well. This System gives very much objectives how to use it in other cases.
    I have much ideas how to use it. I can say; very nice coded spell. I dunno that there was a possibility to make it look like this (the bars). I thought I have to use jass for such bars. Never thought about a floating text. I like this very nice and original coded system.
    I would rate it 5/5 'cause I could not find anything wrong with it.
    Keep it up, dude. :D +rep deserved, if I can give you some. ;D
     
  17. NFWar

    NFWar

    Joined:
    Jul 27, 2008
    Messages:
    1,314
    Resources:
    227
    Models:
    1
    Icons:
    215
    Packs:
    1
    Skins:
    2
    Spells:
    6
    Tutorials:
    2
    Resources:
    227
    Jass use character "|" and it have 2 string variables (or meaby 3). Because "|" is VERY thin character, you need 100-200 characters to make it like fine sized bar. I use "I" because it is not so thin and need only 10-20 to make fine sized bar. Why people use "|" also? Because it fill spaces and looks like one whole bar (like in Skibi Castle blue bars over towers). Character "I" is just fine.
     
  18. karland90

    karland90

    Joined:
    Mar 30, 2009
    Messages:
    959
    Resources:
    3
    Models:
    3
    Resources:
    3
    wait you use floating text?

    but you can only have 100 of them in a map at once :eek:
     
  19. NFWar

    NFWar

    Joined:
    Jul 27, 2008
    Messages:
    1,314
    Resources:
    227
    Models:
    1
    Icons:
    215
    Packs:
    1
    Skins:
    2
    Spells:
    6
    Tutorials:
    2
    Resources:
    227
    Rly? I tryed map with 100 heroes and it was ok... but i dont tryed with 101 LOL