edited 5×, last 10.05.19 07:28:29 pm
Forum
Stranded II Scripts Stranded II Enhanced + (read last posts)Stranded II Enhanced + (read last posts)
28 replies1
2
3
2
3
on:attack1 { 	skipevent; }
edited 1×, last 10.05.19 07:28:48 pm
1
2
3
4
5
6
2
3
4
5
6
on:attack1 { if(lives("unit",1)==1){ play "sound.wav"; flash 255,255,255,0.8,1.3; } }
Attach this script to player ID=1.
If the player is dead nothing will happen.
In play, the name of the file to play in the sounds folder.
In flash, the first 3 numbers are the color, then the other 2 numbers can be manipulated for length of time the flash exists and speed at which it fades out/in.
edited 1×, last 10.05.19 07:29:05 pm
Same for where ever you put skipevent...if, for example,
you script on:changeday{ skipevent;} the day will
not change. That's all it does...it skips the original
intended event.
Just for the record: you can also add script before or after the skipevent; command and those scripts will still run...only the original event will be skipped.
so example time:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
This script you will notice when hitting attack button the player does not attack or hit anything, or shoot or swing a weapon...but you still get the sound and flash on:attack1 { skipevent; if(lives("unit",1)==1){ play "sound.wav"; flash 255,255,255,0.8,1.3; } } in scripting though i found sometimes i had to move the skipevent; below the script to make it do this. Like it depends on where you use it. on:attack1 { if(lives("unit",1)==1){ play "sound.wav"; flash 255,255,255,0.8,1.3; } skipevent; } one of these two will result in not attacking anything, but still have sound n flash.
edited 2×, last 10.05.19 07:29:22 pm
1
2
3
4
5
6
7
2
3
4
5
6
7
on:keyhit03 { 	primary_attack; } on:keyhit04 { 	secondary_attack; }
i didn't actually test so idk why it wouldn't work for ya...and idk if anyone edited the source code in the .exe your using.
edited 1×, last 10.05.19 07:29:39 pm
but you have a mistake in the first line use { not ; and use keyhit03 as that is the key you hit (mouse button) per options, setting, controls.
1
on:keyhit03 {
p.s. scripting is very strict. you need " around the sound file name like this:
play "sound.wav";
1
2
3
4
2
3
4
on:keyhit03 { flash 255,255,255; play "sound.wav"; }
edited 8×, last 17.04.19 08:58:03 pm
edited 1×, last 10.05.19 07:30:02 pm
edited 2×, last 10.05.19 07:30:21 pm
Just saying" it doesn't work" or "might be doing it wrong" is irrelevant if we can't see what your writing.
It won't work if you are missing a "."comma , or a ( or a { or " or something else.
p.s. I see no reason this would not work. copy n paste it to the player scripts ID=1. Make sure it is the ONLY on:attack1 command. If you have 2 of them post the other one so we can see it.
1
2
3
4
5
6
2
3
4
5
6
on:attack1 { if(lives("unit",1)==1){ play "sound.wav"; flash 255,255,255,0.8,1.3; } }
If the player is dead nothing will happen.
In play, the name of the file to play in the sounds folder.
In flash, the first 3 numbers are the color, then the other 2 numbers can be manipulated for length of time the flash exists and speed at which it fades out/in.
edited 2×, last 20.04.19 03:29:42 pm
edited 1×, last 10.05.19 07:30:40 pm
be sure to attach it to the player ID=1 right under the SCRIPT=START section...and make sure you only have the one on:attack1 command. If you already see a on:attack1 command copy-n-paste it here so we can make ONE script together out of the two.
p.s.
that other GLOBAL script above on:keyhit03 didn't work because i didn't notice it is the ALTERNATE PRIMARY ATTACK assigned in OPTIONS when you hit key "O". Would only work if you hit that assigned "O" key. (assuming it was setup that way in your .exe, or you can also set the key to what ever you wanted to in options)
edited 2×, last 10.05.19 07:30:58 pm
Quote
be sure to attach it to the player ID=1 right under the SCRIPT=START section
no i didn't test them...it's a simply script I just believe works. But you have to follow my instructions.
did you change the color like i said?
did you attach it to player 1 scripts?
is there only 1 attack1 command in the player 1 scripts?
if it does work after you put it in the right place, then the shame of it all is...this was solved 15 posts ago with my first answer.
P.S. (5 minutes later) ok i tested it...this one works ONLY WHEN YOU HIT SOMETHING not every click but only when clicking and hitting something.
1
2
3
4
5
6
2
3
4
5
6
on:attack1 { if(lives("unit",1)==1){ play "dog_bark1.wav"; flash 0,255,0,0.8,1.3; } }
This one below works every click no matter what. I hear the dog bark and get a green flash every click.
1
2
3
4
5
6
7
2
3
4
5
6
7
on:attack1 { skipevent; if(lives("unit",1)==1){ play "dog_bark1.wav"; flash 0,255,0,0.8,1.3; } }
would have been solved days ago if you listen to my instructions and post your script so we can see where you made a mistake.
edited 4×, last 25.04.19 04:03:17 am
edited 1×, last 10.05.19 07:31:15 pm