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 damage?

Author Topic: Lava damage? (7 messages, Page 1 of 1)
Moderators: Dennis

Greenfuzz
Joined: Nov 18, 2008

PM me if you have CoD MW for Wii


Posted: Aug 14, 2009 05:47 PM    Msg. 1 of 7       
Me and Stennett are trying to make lava shaders.

How do you make it where you touch the lava (or lava shader, w/e) the player gets automatically killed?


Greenfuzz
Joined: Nov 18, 2008

PM me if you have CoD MW for Wii


Posted: Aug 14, 2009 05:58 PM    Msg. 2 of 7       
Well thats what I meant

Should of reworded that. My bad


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Aug 14, 2009 06:03 PM    Msg. 3 of 7       

(global boolean plyrnum 0)

(script continuous loop
(if
(= plyrnum 15)
(begin
(set plyrnum 0)
)
(begin
(set plyrnum (+ plyrnum 1))
)
)
)

(script continuous copy_n_paste_1
(if
(volume_test_object [TRIGGER VOLUME] (unit (list_Get (players) plyrnum)))
(begin
(damage_object [DAMAGE EFFECT] (unit (list_Get (players) Plyrnum)))
)
)
)


I may have mixed up the order on the damage_object line. Anyway, if you need more than one trigger volume, copy the (script continuous copy_n_paste_1, and paste it for however many trigger volumes there are. Remember to change the script names for the ones that you paste down.


Greenfuzz
Joined: Nov 18, 2008

PM me if you have CoD MW for Wii


Posted: Aug 14, 2009 06:07 PM    Msg. 4 of 7       
Thanks gamma. That helped me alot


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Aug 14, 2009 08:41 PM    Msg. 5 of 7       
I hate to nitpick on details, but you're a good scripter, and you deserve to get better.

And this applies to every scripter, not just you. I'm just using your script as an example.

I'm just going to give cleanup tips for future reference.

- Every 'begin' command in that script is unnecessary. (begin) is only needed if you need more than one command to execute within one argument of an (if) check. In the script, there's only one command under each 'begin' call. They can safely be removed.

If you ever find yourself placing 'begin' and then sticking only one command under it, then you'll know you can get rid of the 'begin'.

And for other scripters, if your 'begin' is anywhere outside a command, it is most likely completely unnecessary, i.e.:

(script continuous example
(begin
(set useless_begins 1)
)
)


- This is something that even some of the best scripters do. Every time they refer to the player, they always put (unit (list_get (players) #)).

The 'unit' around the 'list_get' command is only needed if the argument for that command is 'unit'. If the argument is 'object', then you can refer to the player just with (list_get (players) #), because list_get returns an object. 'unit' just converts an object to a unit.

The same goes for any reference using (ai_actors). Only wrap it with (unit) if the argument there is 'unit'.

I put in bold everything that can be removed.

(global boolean plyrnum 0)

(script continuous loop
(if
(= plyrnum 15)
(begin
(set plyrnum 0)
)
(begin
(set plyrnum (+ plyrnum 1))
)
)
)

(script continuous copy_n_paste_1
(if
(volume_test_object [TRIGGER VOLUME] (unit (list_Get (players) plyrnum)))
(begin
(damage_object [DAMAGE EFFECT] (unit (list_Get (players) Plyrnum)))
)
)
)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Aug 14, 2009 09:19 PM    Msg. 6 of 7       
I like to use the begins, because It helps distinguish what part is separate from what. I know it's useless, but for example. if I did:



(script continuous loop
(if
(= plyrnum 15)
(set plyrnum 0)
(set plyrnum (+ plyrnum 1))
)
)


That would confuse me if I were to revise the script.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Aug 14, 2009 09:55 PM    Msg. 7 of 7       
Quote: --- Original message by: Gamma927
I like to use the begins, because It helps distinguish what part is separate from what. I know it's useless, but for example. if I did:

That would confuse me if I were to revise the script.


Ah, Okay. I see what you mean. For the record, I'm not criticizing you or scripters who do those things. It's not like those begins are examples of heresy or something. I'm just mentioning that for the sake of those who do those things out of habit.

Like, for me, those begins just get in the way, and I know that they're not needed. So I don't use them.

For you, they help you visually even though you know they're not needed. So you do use them.

But, for others, the begins get in the way, yet they think they're needed. So they use them anyways.

Those are the ones I'm targeting.

Anyways, I'll stop my rambling now :). I'm just OCD with script organization.
Edited by Me KS on Aug 14, 2009 at 09:56 PM

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 2:35 PM 156 ms.
A Halo Maps Website