• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Breath system v1.00a

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Rmx
Arnadath proudly presents
His first magnificent and leakless (hope so) system.

-What is this thing?

-This is a system in which every unit that enters water, gets breath. By depleting it's breath, it will start to lose life, while if it goes outside water, its breath will start increasing again


Requirements: Just a perfectly normal World editor



[+] Multiinstancable (mui)
[+] Not lagging (depends on pc...)
[+] Can get variations between monsters (naga e.g. lose less breat than humans)
[+] GUI (so anyone can understand it)
[-] The breath bar, might blink (depends on your pc)

So far as i can see, no one thought of that.
For troubleshooting, please read the Q&A


Q&A

Q:Is it M...
A:Yes it is MUI i told you already

Q:Were can it..
A:It can be usefull on RPG maps mostly. Think were it could suit best for you

Q:How to imp...
A:Just copy the whole folder into your map

Q:Shall i...
A:Of course! Every feedback is welcome

Q:No i mean...
A:Give me credit if you use it? Well of course

Q:If i find...
A:Contact me at my email or pm me

Q:How can you...
A:I know what im about to ask myself, thats why i answer mine question faster that i can write them.
I wrote Q&A in this manner so you bother to read them.



V1.0a:First and maybe last release

V1.0b:Fixed leaks pointed out

V1.1a:Modified so flying units dont use the system

V1.2a:Fixed the *blinking bar*, and update it so that when you are outside water, it turns white and shows your breath increasing. Also elevated it so that it is above your head.


Known bugs
The only one i can imagine, are several problems with the blinking breath bar. But it depends mostly on your computer
Also the full GUI script:

  • Drowninit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Display to (All players) for 900.00 seconds the text: |CFFFF9835For anyth...
      • Hashtable - Create a hashtable
      • Set HASH_Drowning = (Last created hashtable)
      • Trigger - Run DrownputinhashInit <gen> (ignoring conditions)
  • Drownputinhash
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Unit-type of (Entering unit)) is A flying unit) Equal to (==) False
    • Actions
      • Hashtable - Save Handle Of(Entering unit) as Drown_int of 1 in HASH_Drowning
      • Hashtable - Save 100.00 as Drown_int of 2 in HASH_Drowning
      • Set Drown_int = (Drown_int + 1)
  • Drownputinhash
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Unit-type of (Entering unit)) is A flying unit) Equal to (==) False
    • Actions
      • Hashtable - Save Handle Of(Entering unit) as Drown_int of 1 in HASH_Drowning
      • Hashtable - Save 100.00 as Drown_int of 2 in HASH_Drowning
      • Set Drown_int = (Drown_int + 1)
  • Drowndecvalue
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer Drown_temp) from 1 to Drown_int, do (Actions)
        • Loop - Actions
          • Set Drown_temp_point_A = (Position of (Load Drown_temp of 1 in HASH_Drowning))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Load Drown_temp of 1 in HASH_Drowning) is alive) Equal to (==) True
                • (Terrain pathing at Drown_temp_point_A of type Peon Harvest Pathing is off) Equal to (==) True
              • Then - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Load Drown_temp of 2 from HASH_Drowning) Greater than or equal to (>=) 1.00
                  • Then - Actions
                    • -------- Change the conditions above in which the unit will lose its custom value. The best, would be to add a special terrain in the sea and set the conditions so that it will lose breath in the selected tile --------
                    • Set Drown_leak_dest_bool = True
                    • -------- Add in the if/then/else statement bellow some exceptions if you wan't using if/then/else so that the breathe is longer shorter for every unit. E.g. if the unit is naga, breathe might decrease in a smaller rate than a human, or night elf etc. --------
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Load Drown_int of 1 in HASH_Drowning)) Equal to (==) Naga Myrmidon
                        • Then - Actions
                          • Set Drown_rate = 0.20
                        • Else - Actions
                          • Set Drown_rate = 0.50
                    • Hashtable - Save ((Load Drown_temp of 2 from HASH_Drowning) - Drown_rate) as Drown_temp of 2 in HASH_Drowning
                    • Set Drown_tempstring = |C004444AA
                    • -------- Feel free to change the color that indicates the how much breath the unit has (also can change size etc. By default i set it to light blue for remaining breath and white for the used breath --------
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load Drown_temp of 2 from HASH_Drowning) Greater than (>) 1.00
                        • Then - Actions
                          • Do Multiple ActionsFor each (Integer Not_integer_A) from 1 to (Integer((Load Drown_temp of 2 from HASH_Drowning))), do (Actions)
                            • Loop - Actions
                              • Set Drown_tempstring = (Drown_tempstring + l)
                          • Set Drown_tempstring = (Drown_tempstring + |C00888888)
                            • Do Multiple ActionsFor each (Integer Not_integer_A) from (Integer((Load Drown_temp of 2 from HASH_Drowning))) to 100, do (Actions)
                              • Loop - Actions
                                • Set Drown_tempstring = (Drown_tempstring + l)
                          • Floating Text - Create floating text that reads Drown_tempstring at Drown_temp_point_A with Z offset 200.00, using font size 3.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                          • Floating Text - Change (Last created floating text): Disable permanence
                          • Floating Text - Change the lifespan of (Last created floating text) to 0.12 seconds
                          • Set Drown_tempstring = <Empty String>
                        • Else - Actions
                  • Else - Actions
                    • -------- You might wanna change this cause they die too damn fast (in 2.5 seconds actually) --------
                    • Unit - Cause (Load Drown_temp of 1 in HASH_Drowning) to damage (Load Drown_temp of 1 in HASH_Drowning), dealing ((Max life of (Load Drown_temp of 1 in HASH_Drowning)) / 25.00) damage of attack type Chaos and damage type Slow Poison
                • Custom script: call RemoveLocation(udg_Drown_temp_point_A)
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Load Drown_temp of 2 from HASH_Drowning) Less than (<) 100.00
                  • Then - Actions
                    • Set Drown_leak_dest_bool = True
                    • -------- This will increase the units breath in time --------
                    • Hashtable - Save ((Load Drown_temp of 2 from HASH_Drowning) + 2.00) as Drown_temp of 2 in HASH_Drowning
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Load Drown_temp of 1 in HASH_Drowning) is alive) Equal to (==) True
                        • Then - Actions
                          • Do Multiple ActionsFor each (Integer Not_integer_A) from 1 to (Integer((Load Drown_temp of 2 from HASH_Drowning))), do (Actions)
                            • Loop - Actions
                              • Set Drown_tempstring = (Drown_tempstring + l)
                          • Set Drown_tempstring = (Drown_tempstring + |C00888888)
                            • Do Multiple ActionsFor each (Integer Not_integer_A) from (Integer((Load Drown_temp of 2 from HASH_Drowning))) to 100, do (Actions)
                              • Loop - Actions
                                • Set Drown_tempstring = (Drown_tempstring + l)
                          • Floating Text - Create floating text that reads Drown_tempstring at Drown_temp_point_A with Z offset 200.00, using font size 3.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                          • Floating Text - Change (Last created floating text): Disable permanence
                          • Floating Text - Change the lifespan of (Last created floating text) to 0.12 seconds
                          • Set Drown_tempstring = <Empty String>
                        • Else - Actions
                  • Else - Actions
                • Custom script: call RemoveLocation(udg_Drown_temp_point_A)
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Drown_leak_dest_bool Equal to (==) False
        • Then - Actions
          • -------- This is the leak destroyer. Basically, once there are no more units that lose breath, it recreates the hashtable --------
          • Set Drown_int = (Drown_int + 1)
          • Trigger - Run DrownputinhashInit <gen> (ignoring conditions)
        • Else - Actions
      • Set Drown_leak_dest_bool = False




Hope you enjoy :thumbs_up:

Keywords:
Breath,drown,system,Arnadath,warcraft,wc3,
Contents

Drown system (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 14:06, 28th Sep 2009 PurplePoot:

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

14:06, 28th Sep 2009
PurplePoot:
 
Level 9
Joined
Aug 27, 2009
Messages
473
  • DrownputinhashInit
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Hashtable - Save Handle Of(Picked unit) as Drown_int of 1 in HASH_Drowning
          • Hashtable - Save 100.00 as Drown_int of 2 in HASH_Drowning
          • Set Drown_int = (Drown_int + 1)
Leaks unit group.

  • For each (Integer A) from (Integer((Load Drown_temp of 2 from HASH_Drowning))) to 100, do (Actions)
    • Loop - Actions
      • Set Drown_tempstring = (Drown_tempstring + l)
Leaks Integer A.

Else, im to lasy to Enable the spells / Abilities.. Fix that please.

  • Time - Every 0.10 seconds of game time
could be changed to:
  • Time - Every 0.05 seconds of game time
or less, but not under 0.03
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
Lol i just loved how you wrote Q & A, you made me read them all you Bastard :p lol.

Anyway nice to see a creative idea from time to time, +rep keep up the good work.

About the flashing bar, well fix it :D

That's all i can say for now, Salam Rmx :D
 
Level 11
Joined
Jul 2, 2008
Messages
601
Integers don't leak, but Integers A and B could bug, so they shouldn't be used, but the random global variable should be declared and used.

And as I understood you didn't create any "special swiming system" to let every unit swim. Then answer one question please... Why should the units with gills lost air over time under water? The units with it CAN breath under it. :)

System is useless since that. And non-realistic. And even if it would be so - noone will use it, cause... where?! Just Naga RPG? ;D Makes no sense...

And also there is a strange thing with "other" units entering water, instead of entering low water, they sometimes are stunned just near it and need another one command to continue their path, but sometimes they just run in strange direction trying to find the way to get here not buy direct entering the water, but moving somwhere else...
 
Not a bad idea for a system but I have some issues.

  • For me none of the floating text's showed.
  • You leak six times every second which will add up to be alot over the course of a game. (Terrain pathing at (Position of (Load Drown_temp of 1 in HASH_Drowning)) of type Peon Harvest Pathing is off) Equal to True is what leaks.
 
Last edited:
Level 6
Joined
Oct 31, 2008
Messages
229
Ok guys new plot (Damn you Aspard)

Let's say the water is hydrabarium, and only naga can swim on it but still the misterious molecules, don't let anything else swim on it (or just vanish the air that is above)

Also with the new edition i fixed the leaks you pointed out

EDIT:Also added some ither stuff (read changelog im too lame to write it here)
 
Level 6
Joined
Oct 31, 2008
Messages
229
Here you have some screenie.

Also mine computer is a 2005 In..l core2duo @ 1.6 GHz with 1GB ram and no graphic card etc. It can barely run wc3 (wc3 version 1.24a)

Post yours and your wc3 version
 

Attachments

  • New Windows BMP Image.JPG
    New Windows BMP Image.JPG
    203 KB · Views: 106
Also mine computer is a 2005 In..l core2duo @ 1.6 GHz with 1GB ram and no graphic card etc.

Can computers even run games without a graphics card..?

Anyways...

In your init trigger, remove the 900 second message display and place it in a demo trigger. I don't think people want that message being displayed once they copy your triggers over.

Also I'm still not seeing the floating text (check the attachment). It may be fixed by re-using a floating text instead of dynamically creating them and destroying them. Just use the Floating Text - Change text feature and store the floating text inside the hashtable or something.
 

Attachments

  • error.png
    error.png
    222.9 KB · Views: 134
Level 6
Joined
Oct 31, 2008
Messages
229
Well the only i can say is this:
Try to open it with map editor (i created it with JNGP UMSWE enabled) and save it and run it. Not by testing the map, but in Single player.(dnt press test map, instead save and open wc3 adn run it)
 
Well the only i can say is this:
Try to open it with map editor (i created it with JNGP UMSWE enabled) and save it and run it. Not by testing the map, but in Single player.(dnt press test map, instead save and open wc3 adn run it)

I'm using JNGP with USMWE enabled as well. If you would try my suggestion it would not only be more efficient but it could fix this issue.
 
Level 6
Joined
Oct 31, 2008
Messages
229
Well i can't try ur suggestion right now (various reasons) but the problem is the floating bars. When we fix that, then we can talk about less lag-more efficiency. I wanted it to be created so anyway so when you exit water, you breath increases
 
Well i can't try ur suggestion right now (various reasons) but the problem is the floating bars. When we fix that, then we can talk about less lag-more efficiency. I wanted it to be created so anyway so when you exit water, you breath increases

Read my post again o_O

If you would try my suggestion it would not only be more efficient but it could fix this issue.
 
Level 6
Joined
Oct 31, 2008
Messages
229
Man i may sound nazistis or sthing, but i wanted the system to be this way.
Now i can think of a reason
See this Set Drown_tempstring = (Drown_tempstring + |C00888888)
the collor code especially the first part (00), might cause invisible script (i wont say where i found it)
try make it ff and tell me if helped... else you can add some breakpoint to see if this part is running anyway like Display all players a text inside it.
Anyway im fully convinced that the GUI hasnt any error, cause it works for me and for Aspard thus something else is the problem.

If it helped you, plz let me know
 
Top