A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »lava script help

Author Topic: lava script help (10 messages, Page 1 of 1)
Moderators: Dennis

Nebulon
Joined: Jan 6, 2008

I am a noble warrior!


Posted: May 22, 2009 06:03 AM    Msg. 1 of 10       
i wrote a script for a burn effect for lava, but it isnt working. Here is my script»

(script continuous lava_a_burn
(sleep_until (volume_test_objects lava_a (players)) 0)
(damage_object "weapons\flamethrower\burning" (players) 0)
)
(sleep_until (volume_test_objects lava_a (players)) 1)
(damage_object "weapons\flamethrower\burning" (players) 1)
)
(sleep_until (volume_test_objects lava_a (players)) 2)
(damage_object "weapons\flamethrower\burning" (players) 2)
)
(sleep_until (volume_test_objects lava_a (players)) 3)
(damage_object "weapons\flamethrower\burning" (players) 3)
)
(sleep_until (volume_test_objects lava_a (players)) 4)
(damage_object "weapons\flamethrower\burning" (players) 4)
)
(sleep_until (volume_test_objects lava_a (players)) 5)
(damage_object "weapons\flamethrower\burning" (players) 5)
)
(sleep_until (volume_test_objects lava_a (players)) 6)
(damage_object "weapons\flamethrower\burning" (players) 6)
)
(sleep_until (volume_test_objects lava_a (players)) 7)
(damage_object "weapons\flamethrower\burning" (players) 7)
)
(sleep_until (volume_test_objects lava_a (players)) 8)
(damage_object "weapons\flamethrower\burning" (players) 8)
)
(sleep_until (volume_test_objects lava_a (players)) 9)
(damage_object "weapons\flamethrower\burning" (players) 9)
)
(sleep_until (volume_test_objects lava_a (players)) 10)
(damage_object "weapons\flamethrower\burning" (players) 10)
)
(sleep_until (volume_test_objects lava_a (players)) 11)
(damage_object "weapons\flamethrower\burning" (players) 11)
)
(sleep_until (volume_test_objects lava_a (players)) 12)
(damage_object "weapons\flamethrower\burning" (players) 12)
)
(sleep_until (volume_test_objects lava_a (players)) 13)
(damage_object "weapons\flamethrower\burning" (players) 13)
)
(sleep_until (volume_test_objects lava_a (players)) 14)
(damage_object "weapons\flamethrower\burning" (players) 14)
)
(sleep_until (volume_test_objects lava_a (players)) 15)
(damage_object "weapons\flamethrower\burning" (players) 15)
)
)

and the debug.txt message»

05.22.09 10:58:14 [lava_burn line 3] i expected a object, but this function returns a object_list.: (players) 0)

05.22.09 10:58:14 recompiling scripts after scenarios were merged.
05.22.09 10:58:14 [lava_burn line 1] this left parenthesis is unmatched.: (script continuous lava_a_burn


Polamee
Joined: Feb 25, 2008

MP2SPMT's founder


Posted: May 22, 2009 11:09 AM    Msg. 2 of 10       
No, no! You've got it all wrong!

First off, I'll analyse your command for triggers:

(sleep_until (volume_test_objects lava_a (players)) 14)


The value of '14' at the end is not the player in the list, but rather the amount of script ticks (the units script measure time in). So by '14' your telling the script to wait for about half a second (1 sec=30 ticks) and not the 14th player on the list. It should read:


(sleep_until (volume_test_objects lava_a (list_get (players) 14))

Next, you can't use a single continuous script. You have to create a new continuous script for each player. Otherwise, the second player can't burn in the lava until the first player has burned, the third can't go until the first and second have gone, etc.

In case you didn't understand any of the above, I mader this new revised version for you. Copy and paste into your scripts. It should compile:

(script continuous lava_a_burn0
(sleep_until (volume_test_objects lava_a (list_get (players) 0)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 0))
)

(script continuous lava_a_burn1
(sleep_until (volume_test_objects lava_a (list_get (players) 1)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 1))
)

(script continuous lava_a_burn2
(sleep_until (volume_test_objects lava_a (list_get (players) 2)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 2))
)

(script continuous lava_a_burn3
(sleep_until (volume_test_objects lava_a (list_get (players) 3)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 3))
)

(script continuous lava_a_burn4
(sleep_until (volume_test_objects lava_a (list_get (players) 4)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 4))
)

(script continuous lava_a_burn5
(sleep_until (volume_test_objects lava_a (list_get (players) 5)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 5))
)

(script continuous lava_a_burn6
(sleep_until (volume_test_objects lava_a (list_get (players) 6)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 6))
)

(script continuous lava_a_burn7
(sleep_until (volume_test_objects lava_a (list_get (players) 7)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 7))
)

(script continuous lava_a_burn8
(sleep_until (volume_test_objects lava_a (list_get (players) 8)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 8))
)

(script continuous lava_a_burn9
(sleep_until (volume_test_objects lava_a (list_get (players) 9)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 9))
)

(script continuous lava_a_burn10
(sleep_until (volume_test_objects lava_a (list_get (players) 10)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 10))
)

(script continuous lava_a_burn11
(sleep_until (volume_test_objects lava_a (list_get (players) 11)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 11))
)

(script continuous lava_a_burn12
(sleep_until (volume_test_objects lava_a (list_get (players) 12)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 12))
)

(script continuous lava_a_burn13
(sleep_until (volume_test_objects lava_a (list_get (players) 13)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 13))
)

(script continuous lava_a_burn14
(sleep_until (volume_test_objects lava_a (list_get (players) 14)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 14))
)

(script continuous lava_a_burn15
(sleep_until (volume_test_objects lava_a (list_get (players) 15)) 30)
(damage_object "weapons\flamethrower\burning" (list_get (players) 15))
)

Edited by Polamee on May 22, 2009 at 11:10 AM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: May 22, 2009 06:31 PM    Msg. 3 of 10       
Quote: --- Original message by: Polamee

No, no! You've got it all wrong!

Actually, you have it wrong.

First off, I'll analyse your command for triggers:

(sleep_until (volume_test_objects lava_a (players)) 14)


The value of '14' at the end is not the player in the list, but rather the amount of script ticks (the units script measure time in). So by '14' your telling the script to wait for about half a second (1 sec=30 ticks) and not the 14th player on the list. It should read:

This is only for SP maps. For MP, it's the player.

(sleep_until (volume_test_objects lava_a (list_get (players) 14))

This is wrong, because volume_test_objects requires an object list. You're getting an object. This won't work. If you wanted to do it that way, use volume_test_object.

Next, you can't use a single continuous script. You have to create a new continuous script for each player. Otherwise, the second player can't burn in the lava until the first player has burned, the third can't go until the first and second have gone, etc.

In case you didn't understand any of the above, I mader this new revised version for you. Copy and paste into your scripts. It should compile:


[some scripts]




The only problem with your script, is that you're missing a parentheses. Polamee was correct about the multiple continuous scripts though. Here's a script that you might use:

(global short x 0)

(script continuous increase
(set x (+ x 1))
)

(script continuous reset
(if
(= x 15)
(begin
(set x 0)
)
)
)

(script continuous BURN_TEH_GUIZ
(if
(volume_test_object lava_a (list_get (players) x))
(begin
(damage_object "weapons\flamethrower\burning" (list_get (players) x))
)
)
)


Haven't tested it, but I'm confident that it works.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: May 22, 2009 11:22 PM    Msg. 4 of 10       
That script is fine, but there's a few details that can be fixed.

Player "0" is skipped on startup since the variable gets added by 1 before checking whether he's in the lava or not. It practically doesn't matter at all, since the player definitely won't spawn in the lava, but it should be fixed anyways.

Also, since the script checks for the variable being set to 15 and sets it to 0, player 15 will never be checked and will be immune to the lava. That's a noticeable problem.

Anyways, here's the fixed script. I just took the variable check and put it after everything, and then changed the (= x 15) check to (> x 15) to make sure player 15 gets checked.


(global short x 0)

(script continuous BURN_TEH_GUIZ
(if
(volume_test_object lava_a (list_get (players) x))
(damage_object "weapons\flamethrower\burning" (list_get (players) x))
)
)

(script continuous increase_reset
(set x (+ x 1))
(if
(> x 15)
(set x 0)
)
)


Quote: --- Original message by: Gamma927
Quote: --- Original message by: Polamee
The value of '14' at the end is not the player in the list, but rather the amount of script ticks (the units script measure time in). So by '14' your telling the script to wait for about half a second (1 sec=30 ticks) and not the 14th player on the list. It should read:

This is only for SP maps. For MP, it's the player.


From HS_Doc:

(sleep_until [boolean] {[short]})
pauses execution of this script until the specified condition is true, checking once per second unless a different number of ticks is specified.

(The "short" being the number of ticks.)

Polamee's right on that one.


Nebulon
Joined: Jan 6, 2008

I am a noble warrior!


Posted: May 23, 2009 03:38 AM    Msg. 5 of 10       
Quote: --- Original message by: Me KS
That script is fine, but there's a few details that can be fixed.

Player "0" is skipped on startup since the variable gets added by 1 before checking whether he's in the lava or not. It practically doesn't matter at all, since the player definitely won't spawn in the lava, but it should be fixed anyways.

Also, since the script checks for the variable being set to 15 and sets it to 0, player 15 will never be checked and will be immune to the lava. That's a noticeable problem.

Anyways, here's the fixed script. I just took the variable check and put it after everything, and then changed the (= x 15) check to (> x 15) to make sure player 15 gets checked.


(global short x 0)

(script continuous BURN_TEH_GUIZ
(if
(volume_test_object lava_a (list_get (players) x))
(damage_object "weapons\flamethrower\burning" (list_get (players) x))
)
)

(script continuous increase_reset
(set x (+ x 1))
(if
(> x 15)
(set x 0)
)
)


Quote: --- Original message by: Gamma927
Quote: --- Original message by: Polamee
The value of '14' at the end is not the player in the list, but rather the amount of script ticks (the units script measure time in). So by '14' your telling the script to wait for about half a second (1 sec=30 ticks) and not the 14th player on the list. It should read:

This is only for SP maps. For MP, it's the player.


From HS_Doc:

(sleep_until [boolean] {[short]})
pauses execution of this script until the specified condition is true, checking once per second unless a different number of ticks is specified.

(The "short" being the number of ticks.)

Polamee's right on that one.


so i just use this one then and duplicate it, replacing all x with a number starting from 0 all the way to 15 correct?


Polamee
Joined: Feb 25, 2008

MP2SPMT's founder


Posted: May 23, 2009 05:27 AM    Msg. 6 of 10       
Quote: --- Original message by: Nebulon
Quote: --- Original message by: Me KS
That script is fine, but there's a few details that can be fixed.

Player "0" is skipped on startup since the variable gets added by 1 before checking whether he's in the lava or not. It practically doesn't matter at all, since the player definitely won't spawn in the lava, but it should be fixed anyways.

Also, since the script checks for the variable being set to 15 and sets it to 0, player 15 will never be checked and will be immune to the lava. That's a noticeable problem.

Anyways, here's the fixed script. I just took the variable check and put it after everything, and then changed the (= x 15) check to (> x 15) to make sure player 15 gets checked.


(global short x 0)

(script continuous BURN_TEH_GUIZ
(if
(volume_test_object lava_a (list_get (players) x))
(damage_object "weapons\flamethrower\burning" (list_get (players) x))
)
)

(script continuous increase_reset
(set x (+ x 1))
(if
(> x 15)
(set x 0)
)
)


Quote: --- Original message by: Gamma927
Quote: --- Original message by: Polamee
The value of '14' at the end is not the player in the list, but rather the amount of script ticks (the units script measure time in). So by '14' your telling the script to wait for about half a second (1 sec=30 ticks) and not the 14th player on the list. It should read:

This is only for SP maps. For MP, it's the player.


From HS_Doc:

(sleep_until [boolean] {[short]})
pauses execution of this script until the specified condition is true, checking once per second unless a different number of ticks is specified.

(The "short" being the number of ticks.)

Polamee's right on that one.


so i just use this one then and duplicate it, replacing all x with a number starting from 0 all the way to 15 correct?


No. Use it exactly. Don't make any changes. What this does is set a variabe, "x" to 0. It adds '1' to the variable every continuous script cycle, until it reaches 15, which it will be reset the variable to 0 once its 15, effectively looping through all 16 players. So 'x' represents players 0-16.


Nebulon
Joined: Jan 6, 2008

I am a noble warrior!


Posted: May 23, 2009 06:13 AM    Msg. 7 of 10       
k ty, but one more thing. i have 3 different lava pools (lava_a, lava_b, lava_c) so i have 3 trigger volumes. what part do i duplicate? this part?

(script continuous BURN_TEH_GUIZ
(if
(volume_test_object lava_a (list_get (players) x))
(damage_object "weapons\flamethrower\burning" (list_get (players) x))
)
)

ok i got that figured out, and it works good, but i need it to do damage more constantly while in the trigger volume
Edited by Nebulon on May 23, 2009 at 07:07 AM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: May 23, 2009 09:59 AM    Msg. 8 of 10       
Modify the damage effect then.


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: May 23, 2009 10:26 AM    Msg. 9 of 10       
isn't there a way just to have a surface hurt you?


Nebulon
Joined: Jan 6, 2008

I am a noble warrior!


Posted: May 23, 2009 11:20 AM    Msg. 10 of 10       
only way i know for that to work is markers, and that would be too many... hundreds even...

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 9:04 PM 250 ms.
A Halo Maps Website