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 General Discussion »More help needed with scripts

Author Topic: More help needed with scripts (6 messages, Page 1 of 1)
Moderators: Dennis

Dumb AI
Joined: Sep 18, 2011

Dead.


Posted: Aug 29, 2012 01:33 PM    Msg. 1 of 6       
Well,I want to make a death-zone where player(s) would die when they get within a trigger volume.

(script continuous death-zone)
(sleep_until (or 1)
(if
(=
(volume_test_objects death-zone (players) true)
(damage_object weapons\rocket launcher\nuke player0)

v2:

(global short plyrnum 0)

(script continuous death-zone)
(sleep_until (or 1)
(if
(or
(volume_test_object death-zone
(unit
(list_get
(players) plyrnum)))
(unit_kill
(unit
(list_get
(players) plyrnum)))




Does that work?
Edited by Dumb AI on Aug 29, 2012 at 01:38 PM


Lone Warrior
Joined: Dec 14, 2008

-Himalayan Wizard and Mystical Guru of the Mts.-


Posted: Aug 29, 2012 03:25 PM    Msg. 2 of 6       
( script continuous kill_box_1
( sleep_until ( volume_test_objects killb1 ( players )) 15)
( damage_object "effects\damage effects\guaranteed plummet to untimely death" ( unit ( list_get ( players ) 0 )))
)


If this is for SP then it should work.
Edited by Lone Warrior on Aug 29, 2012 at 03:26 PM


jawa
Joined: Jun 26, 2011

Utinni!


Posted: Aug 29, 2012 06:34 PM    Msg. 3 of 6       
I would use this script:

(script continuous deathzone
(begin
(if (= (volume_test_object trigvol (list_get (players) 0)) true)
(begin
(damage_object "damage_effect_here" (list_get (players) 0))
(sleep 50)
)
)
)
)

You have to do it for each player though 0-15.
You could even put warnings in before it kills you with:

(script continuous deathzone
(begin
(if (= (volume_test_object trigvol (list_get (players) 0)) true)
(begin
(sv_say "warning you are leaving the battlefield!"
(sleep 500)
(damage_object "damage_effect_here" (list_get (players) 0))
(sleep 50)
)
)
)
)

Although that will say it to everyone I dont know if there is a way to say it to just the one player.


Dumb AI
Joined: Sep 18, 2011

Dead.


Posted: Aug 29, 2012 07:05 PM    Msg. 4 of 6       
Is there a way to display the name of the player?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Aug 29, 2012 07:55 PM    Msg. 5 of 6       
Quote: --- Original message by: jawa
Although that will say it to everyone I dont know if there is a way to say it to just the one player.

You can't really find out the local player on stock HCE. You'd basically want to have everyone as deathless if you wanted to correctly track it. With OS, you can get the current player number. Anyways, even if you knew the correct player number, at that point you'd want a cutscene title since sv_say can only be preformed on the host and would display to everyone.

Quote: --- Original message by: Dumb AI
Is there a way to display the name of the player?

No, sv_players is the closest you can get, but it doesn't return anything, nor allow you to put in an index.



Anyways, the script jawa posted, it warns them, but then it damages them regardless of whether they heed the warning or not. You should check if they are still out there.. but then there comes the problem, if the player numbers shifted. Someone could stay out there for ever if the numbers keep shifting. Anyways, I would recommend a constant and slow damage. it should be enough for them to realize they don't want to stay in wherever very long.

(global short number 0)
(script static unit player (unit (list_get (players) number)))
(script continuous kill_volumes
(if (volume_test_object <trigger_volume> (player)) (damage_object <damage> (player)))
;;Repeat above if statement for however many volumes you need, right here.
(if (< number 15) (set number (+ number 1)) (set number 0))
)

the 'damage' is the tag location of a damage effect, so a pistol bullet would be "weapons\pistol\bullet" since bullet.damage_effect resides there. Just make it a low amount of damage if you want them to have a chance to turn back alive. If its a death pit, then just make it instant kill by replacing the damage_object with (unit_kill (player))


Dumb AI
Joined: Sep 18, 2011

Dead.


Posted: Aug 30, 2012 12:30 PM    Msg. 6 of 6       
^Scripter Chief

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 5:38 PM 157 ms.
A Halo Maps Website