Forum

> > Stranded II > Scripts > Stranded II Enhanced + (read last posts)
Forums overviewStranded II overview Scripts overviewLog in to reply

English Stranded II Enhanced + (read last posts)

28 replies
Page
To the start Previous 1 2 Next To the start

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
1
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.

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
skipevent; simply nullifies the intended event...so basically when you click attack1 mouse button NOTHING happens because it skips the event to attack.

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
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.

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
well, you can try editing the global script in the game.inf file maybe that will make it work.

1
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.

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
now your gettin it yes.

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
on:keyhit03 {
     flash 255,255,255;
     play "sound.wav";
}
edited 8×, last 17.04.19 08:58:03 pm

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
you have been asked before to post your script so we can see what your doing, and if your doing something wrong. It is more productive this way...we can tell you what to correct. It also shows use your not just bullshitting us and wasting our time and we see your at least trying.

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
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 2×, last 20.04.19 03:29:42 pm

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
yes...you may want to go ahead and change the 3 color numbers from 255 to the color you want for testing, as 255,255,255 might not show a color or would be white or clear im not sure...like 0,255,0 would be green color for sure.

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)

old Re: Stranded II Enhanced + (read last posts)

JasJack67
Super User Off Offline

Quote
right...i said attach it to the player ID=1 (units.inf) not the global (game.inf)
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
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
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
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview