Forum

> > Stranded II > Scripts > "goto unit" keep still
Forums overviewStranded II overview Scripts overviewLog in to reply

English "goto unit" keep still

2 replies
To the start Previous 1 Next To the start

old "goto unit" keep still

aimeewilbury
User Off Offline

Quote
OK, so I'm just messing around with the scripts and stuff for my own personal mod (also swiping models from other mods, but its for personal use so I don't see a problem with it).

So I managed to create a wild horse you can tame and then you can create "tame horses" which work like monkey carriers (they chase you around) but you can ride them.

And I also created a "horse stall" (basically a giant scorpion trap). However the issue I'm having is that when I take a horse into one of them they run off before I can close it. So my idea is to somehow have it so when they're in the zone of a "horse stall" they stay still. Any suggestions?

Heres the horse:
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
### Tame Horse
id=92
name=Tame Horse
group=animal
model=gfx\horse.b3d
icon=gfx\horse.bmp
scale=0.5
colxr=20
colyr=20
health=110
eyes=10
turnspeed=3.0
acceleration=20
ani_idle1=1,1,1
ani_idle2=5,9,0.05
ani_idle3=13,18,0.05
ani_move=2,4,0.06
ani_die=10,12,0.09
fx=24
speed=5.0
col=1
steering=2
maxdepth=35
loot=9,4
loot=96,1
behaviour=animal
script=start
on:create {
		timer "self",3000,0;
	}
	on:start {
		timer "self",3000,0;
	}
	on:timer {
		if (health("self")>0){
			ai_mode "self","goto","unit","1";
			ai_center;
		}
		if (count_stored("self")>0){
			addstate "self","particles";
		}else{
			freestate "self","particles";
		}
	}
	on:use { ride; } 
	on:kill {
		freetimers "self";
		event "iskill_hunt","global";
	}
	//Whipping
	on:hit {
		ai_center;	}		
script=end

And the "horse stall":
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
36
37
38
### Horse Stall
id=235
name=Horse Stall
group=building
icon=gfx\trap.bmp
model=gfx\trap.b3d
scale=4
health=300
mat=wood
fx=16
script=start
	on:build_finish {
		event "trapbuild",0,0;
	}
	on:load {
		local $state;
		if ($state==1){
			model "gfxw/trap_closed.b3d";
			scale 1,1,1;
		}
	}
	on:use {
		local $state;
		if ($state==0){
			process "closing stall",500;
			$state=1;
			play "vehicle_move.wav";
			model "gfx/trap_closed.b3d";
			scale 1,1,1;
		}else{
			process "opening stall",500;
			$state=0;
			play "vehicle_move.wav";
			model "gfx/trap.b3d";
			scale 1,1,1;
		}
	}
script=end

old Re: "goto unit" keep still

Hurri04
Super User Off Offline

Quote
make an event at the horse which starts a s2 cmd timer on:getoff.
also use the command s2 cmd freeze on:getoff to make the horse stand still.
the timer has to be run at the horse itself.
also make an event which is started when the timer is triggered.
this event also has to run at the horse.
then use the freeze command again to enable the horse to move again when the event is triggered.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview