
MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Oct 27, 2010 02:15 PM
Msg. 1 of 8
OK, so, I have a script that I modified (I think the original belongs to Gamma), that checks for when the player enters a specified volume, and starts counting down to his doom. This script works in-game, however, the scripts takes up a massive amount of space for my 10 trigger volumes. Here is that script, at its current state: http://pastebin.ca/1974904Sorry, posting the script on this site would be a major scroll-through. It's readable straight from that link. So, yeah, does anyone know how I can compress all of this into one part instead of 10? Thanks, MoooseGuy  Edited by MoooseGuy on Oct 27, 2010 at 02:15 PM
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Oct 27, 2010 05:14 PM
Msg. 2 of 8
Do what GRUNTS said; factor out all redundancies, and merge all the trigger volume tests together using one giant or statement.
|
|
|

DA_Ender
Joined: Oct 22, 2010
(ÐÄ)€ÑÐËR †h€ GËÑØÇÏÐDÊ
|
Posted: Oct 27, 2010 07:03 PM
Msg. 3 of 8
Why are you trying to compress this? It's really not that long :O Granted with advanced scripts sometimes you can experience lag but the one you showed shouldn't give you any issues? I've never run into problems with a script being too long
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Oct 27, 2010 08:06 PM
Msg. 4 of 8
Quote: --- Original message by: ASP_GRUNTS That won't make the script any shorter though D= Yes it would. He does the same thing for each trigger volume, so if you just pull out all the trigger volume test scripts, and put all the conditions into one condition, you don't need to repeat all the action scripts.
|
|
|

MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Oct 27, 2010 09:16 PM
Msg. 5 of 8
Grunts, the apparent script god, helped me solve this problem with a trigger volume global that changes constantly, and had my script reference the global. It's ingenious, really. Thanks everyone!  Edited by MoooseGuy on Oct 27, 2010 at 09:16 PM
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Oct 27, 2010 10:51 PM
Msg. 6 of 8
You misunderstood what I meant. He had:
trigger volume 1 script trigger volume 2 script trigger volume 3 script
...etc
I meant to do this:
if in trig vol 1 or trig vol 2 or trig vol 3
dostuff.
|
|
|

Gamma927
Joined: Jun 12, 2008
Steam: gamma927
|
Posted: Oct 28, 2010 04:50 PM
Msg. 7 of 8
Just took a good look at the script, and yes, you are right.
However, by the second good look at the script, it turns out that he messed up the AWOL script that I originally wrote. What he has right now is:
(hud_set_help_text awolp1) (enable_hud_help_flash true) (sleep 30) (hud_set_help_text awolp2) (sleep 30) (show_hud_help_text false)
Which completely butchers my original script, as if the player were to leave the trigger volume, the countdown would still countdown (hehe), and then check at the very END whether the player's in the trigger volume or not. From this, I can see where his multiple trigger volumes come from, a misinterpretation of the original script.
I'm assuming you fixed this for him. If not, have at it.
|
|
|

MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Oct 28, 2010 06:28 PM
Msg. 8 of 8
Well guys, this is what I got now: (global trigger_volume battlefield_volume deathbystupidness_1)
(global short restart_battlefield 0)
(script static void BattlefieldScript (if (volume_test_objects battlefield_volume (players)) (begin (show_hud_help_text true) (hud_set_help_text awolp1) (enable_hud_help_flash true) (sleep 30) (hud_set_help_text awolp2) (sleep 30) (show_hud_help_text false) (if (volume_test_objects battlefield_volume (players)) (begin (show_hud_help_text true) (hud_set_help_text awolp3) (sleep 30) (show_hud_help_text false) (if (volume_test_objects battlefield_volume (players)) (begin (show_hud_help_text true) (hud_set_help_text awolp4) (sleep 30) (show_hud_help_text false) (if (volume_test_objects battlefield_volume (players)) (begin (damage_object moooseguy\characters\spiblack\killme (player)) (sleep 60))))))) (show_hud_help_text false))) (if (= battlefield_volume deathbystupidness_10) (set restart_battlefield 1)) (if (= battlefield_volume deathbystupidness_9) (set battlefield_volume deathbystupidness_10)) (if (= battlefield_volume deathbystupidness_8) (set battlefield_volume deathbystupidness_9)) (if (= battlefield_volume deathbystupidness_7) (set battlefield_volume deathbystupidness_8)) (if (= battlefield_volume deathbystupidness_6) (set battlefield_volume deathbystupidness_7)) (if (= battlefield_volume deathbystupidness_5) (set battlefield_volume deathbystupidness_6)) (if (= battlefield_volume deathbystupidness_4) (set battlefield_volume deathbystupidness_5)) (if (= battlefield_volume deathbystupidness_3) (set battlefield_volume deathbystupidness_4)) (if (= battlefield_volume deathbystupidness_2) (set battlefield_volume deathbystupidness_3)) (if (= battlefield_volume deathbystupidness_1) (set battlefield_volume deathbystupidness_2)) (if (= restart_battlefield 1) (begin (set battlefield_volume deathbystupidness_1) (set restart_battlefield 0))) )
(script continuous battlefield_call_script (BattlefieldScript) (sleep 4) )
It actually works in-game like a dream, I think this will do just fine.  (Creds to Grunts for the format)
|
|
|