Forum

> > Stranded II > Scripts > how to make this script work
Forums overviewStranded II overview Scripts overviewLog in to reply

English how to make this script work

6 replies
To the start Previous 1 Next To the start

old how to make this script work

benjani
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
on:use {
     if ($staying=0) {
          $staying=1;
          ai_stay "self";
     }
     elseif ($staying=1) {
          $staying=0
          ai_mode "self","goto","unit" "1";
          ai_center;
     }
}

whats wrong here??

old Re: how to make this script work

Assassin moder
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
on:use {
	if ($staying=0){
		$staying=1;
		ai_stay "self";
	}
	elseif ($staying=1){
		$staying=0
		ai_mode "self","goto","unit",1;
		ai_center;
	}
}

Try this

old Re: how to make this script work

benjani
User Off Offline

Quote
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
28
29
30
31
32
33
34
35
### Hound
id=73
name=Hound
group=animal
model=gfx\bb\hound.b3d
icon=gfx\bb\hound.bmp
colxr=10
colyr=10
behaviour=normal
speed=2.2
eyes=10
health=100
damage=9
range=200
attackrange=20
maxweight=25000
loot=21,5
ani_move=2,4,0.09
ani_attack=14,19,0.1
ani_die=20,29,0.1
ani_idle1=5,14,0.09
sfx=hound
script=start
on:use {
	if ($staying=0){
		$staying=1;
	ai_stay "self";
	}
	elseif ($staying=1){
		$staying=0
		ai_mode "self","goto","unit",1;
		ai_center;
	}
}
script=end

This is the whole unit script but it still doesn't work...

I also tried $stay... there's no reaction

old Re: how to make this script work

Mc Leaf
Super User Off Offline

Quote
use "==" in the if- and elseif-statements...

also there's missing a ";"...

You asked me that question per PN, talked about the "native with bow" and commended S2Titanium... So I guess, you want to use that script with S2Titanium...

In that case there are some new commands...

I'll take a closer look later, and give a more precicely answer.

old Re: how to make this script work

Assassin moder
User Off Offline

Quote
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
28
29
30
31
32
33
### Hound
id=73
name=Hound
group=animal
model=gfx\bb\hound.b3d
icon=gfx\bb\hound.bmp
colxr=10
colyr=10
behaviour=normal
speed=2.2
eyes=10
health=100
damage=9
range=200
attackrange=20
maxweight=25000
loot=21,5
ani_move=2,4,0.09
ani_attack=14,19,0.1
ani_die=20,29,0.1
ani_idle1=5,14,0.09
sfx=hound
script=start
	on:use {
		$staying=1-$staying;
		if($staying==0){
			ai_stay "self";
		}else{
			ai_mode "self","goto","unit" "1";
			ai_center;
		}
	}
script=end

Now should work
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview