PDA

View Full Version : I need help with a kill script.



tylerp14
February 11th, 2011, 02:02 AM
I would like to know how to use this script correctly, it says in sapien:

the value of this expression (in a <void> slot) can never be used.: kill0
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script dormant void kill0

Here's the script code:


(script dormant void kill0
(begin
(if
(=
(unit_get_health
(unit
(list_get
(players) 0))) 1.00)
(unit_kill
(unit
(list_get
(players) 0))))))

(script dormant void kill1
(begin
(if
(=
(unit_get_health
(unit
(list_get
(players) 1))) 1.00)
(unit_kill
(unit
(list_get
(players) 1))))))

(script dormant void kill2
(begin
(if
(=
(unit_get_health
(unit
(list_get
(players) 2))) 1.00)
(unit_kill
(unit
(list_get
(players) 2))))))

Etc etc...Thanks if you can help.

EagerYoungSpaceCadet
February 11th, 2011, 07:06 AM
1. Delete all begins in the script before Kornman comes

2. Try this
(script dormant void kill0
(if
(= (unit_get_health (unit (list_get (players) 0))) 1.00)
(unit_kill (unit (list_get (players) 0)))))

tylerp14
February 11th, 2011, 01:33 PM
the value of this expression (in a <void> slot) can never be used.: kill0
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script dormant void kill0

I dont think it worked...

EagerYoungSpaceCadet
February 11th, 2011, 01:48 PM
I'd say that you have to remove the void... and add another parenthesis in the end of the script.

Just suggesting, not quite sure though.

leorimolo
February 11th, 2011, 01:53 PM
the value of this expression (in a <void> slot) can never be used.: kill0
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script dormant void kill0

I dont think it worked...




(script dormant kill0
(begin
(if
(=(unit_get_health (unit (list_get (players) 0))) 1.00)
True)

(unit_kill (unit (list_get (players) 1)))

)

I edited this post twice already lol... that should work...

tylerp14
February 11th, 2011, 01:59 PM
this is not a valid function or script name.: =(unit_get_health (unit (list_get (players) 0))) 1.00)
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (begin

... By the way, can you do that for all 16 players leorimolo (http://www.modacity.net/forums/member.php?902-leorimolo)?

tylerp14
February 11th, 2011, 02:08 PM
WHOA!!!!!!!!!! I did this:
(script dormant kill0
(if
(= (unit_get_health (unit (list_get (players) 0))) 1.00)
(unit_kill (unit (list_get (players) 0)))))

And it successfully compiled! Can you do this for all 16 players please?

tylerp14
February 11th, 2011, 02:11 PM
Wtf.... I can only do it once in-game... Do i type "continuous" instead of dormant?

tylerp14
February 11th, 2011, 02:16 PM
Um never mind about "continuous"... You die over and over... 1, Can I get the code for this for all 16 players? 2, How do I do it more than once in-game?

EagerYoungSpaceCadet
February 11th, 2011, 03:42 PM
For all 16 players, you would do the same as before, but you would name each script differently, for each player, and at every script, you would set unit (get_list (players) [here goes the player index, from 0 to 15]). For example (changes are in red):
(script dormant kill0
(if
(= (unit_get_health (unit (list_get (players) 0))) 1.00)
(unit_kill (unit (list_get (players) 0)))))

(script dormant kill1
(if
(= (unit_get_health (unit (list_get (players) 1))) 1.00)
(unit_kill (unit (list_get (players) 1)))))

(script dormant kill2
(if
(= (unit_get_health (unit (list_get (players) 2))) 1.00)
(unit_kill (unit (list_get (players) 2)))))Etc...

tylerp14
February 11th, 2011, 04:52 PM
Ok, now um... How do I make it do it repeatedly by typing it repeatedly?

tylerp14
February 11th, 2011, 04:58 PM
Like, I type in "wake kill0" and it does it, then i do it again and it doesnt do anything. <-- I want to fix this to make it where you type it in again and it works.

Dwood
February 12th, 2011, 07:07 PM
change the dormant to a static and then remove the wake.