Forum

> > Stranded II > Scripts > Scripting Questions
Forums overviewStranded II overview Scripts overviewLog in to reply

English Scripting Questions

2,429 replies
Page
To the start Previous 1 266 67 68121 122 Next To the start

old Re: Scripting Questions

Lolems
User Off Offline

Quote
on:start {
unitpath 485,112,113,114,115,117,118,119;
}

on:node 0119 {
unitpath 485,112,113,114,115,117,118,119;
}
The second part of this script doesnt work, any ideas on how to fix it, the cheiftan just gets to flag 119 and then stays there, in editor test mode it just says idle

also, i havnt been on the editor in a while and i was wondering if there was a way to raise and lower the terrain with the mouse or is it just with the heightmap that you can do this.

on previous posts what do these mean
local
currentid
free var
$i;

lastly on the kidnap mod how do u get the archers to stand still and attack, the spearmen attack fine but the archers never attck.

i hope this many questions don't piss people off
any help is apreciated, examples would be preferable
edited 4×, last 14.06.09 09:14:09 pm

old Re: Scripting Questions

infernus
User Off Offline

Quote
on:start {
unitpath 485,119;
}

on:node 0119 {
unitpath 112,113,114,115,117,118,119;
}

if id of unit is correct (485)

and for standing is

on:start {
ai_stay "self",1;
}

this is question you ask the second

make an bird then press space (on bird) then raise it up (the green circle in the middle)

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
infernus has written
on:node 0119 {
unitpath 485,112,113,114,115,117,118,119;
}

This will work if you will write this in unit485's script

old Re: Scripting Questions

The Second
User Off Offline

Quote
I didn't meaned it in editor, I mean in game. Should it be a script, or should I edit that units.inf file?

And what script or edit I do?

old Re: Scripting Questions

Lolems
User Off Offline

Quote
how can i get a unit to move on a loop but also attack the player if it is in range, i know now the loop part is
on:start {
unitpath unitid,id,id...
}
but i don't know how to get the unit to hunt the player if you are in e.g. a radius of 100.
any help apreciated
Lolems

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
I'm trying to create Coconut Milk, which will use the same graphics/model as the water. How do these both work?
I tried to edit the scripts a bit, does it look right?

For the items_edible file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### Coconut Milk
id=125 
name=Coconut Milk
group=potion
icon=gfx\water.bmp
model=gfx\water.b3d
scale=0.28
mat=glass
weight=450
info=milk squeezed out of coconuts
script=start
	on:eat {
		process "drinking",1000;
		drink 5,10,30,0;
	}
script=end

And for combinations_potions:
1
2
3
4
5
6
7
8
9
10
11
### Coconut Milk (1xCoconut + Stone)
combi=start
id=125
req=27,1
req=23,1,stay
gen=125
script=start
	play "bubbles.wav";
	process "squeezing coconut",2270;
script=end
combi=end

EDIT: Tested it AND IT WORKED!!! YAY!
edited 3×, last 17.06.09 10:28:58 pm

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
The Second has written
How to set how high the bird will fly?

change behaviour: bird, lowbird, or highbird.

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
Silly one: I created a raptor you could build. He stay perfectly still until you ride him. But every time he goes in the water he disappears. How can you make him "swim", or float on the water like a boat?

Edit: Tried changing to watercraft, he disappeared when on land. lol.

Another edit: Also would like to know how to make him follow you around like the carrier monkey, just not in circles. lol
edited 3×, last 28.06.09 04:45:22 am

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
thank you

Edit: Doesn't seem to work, he stands still. Here's the entire unit, in units.inf:

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
### Buildable Raptor
id=80
name=Buildable Raptor
group=vehicle
model=gfx\raptor.b3d
icon=gfx\raptor.bmp
scale=0.5
colxr=15
colyr=30
health=110
eyes=10
turnspeed=3.0
ani_move=2,3,0.06
ani_die=8,11,0.05
fx=24
speed=20
sfx=raptor
rideoffset=5
col=1
steering=0
behaviour=vehicle
script=start
	on:use { ride; }
	on:kill { free "self"; }
	on:build_finish {
		event "raptorbuild",0,0;
	}
if (lives "self"==1){
     timer "self",1000;
}on:timer{
goto "unit",1;
}
			
script=end
edited 1×, last 29.06.09 12:44:50 am

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
Oh thank you.

Will do so as soon as I get all my games set up. (Just reinstalled Vista. I backed up my "Mods" folder, as that's the one with all the little changes that make gameplay more interesting/experimental.)

Edit: It didn't work either. Hmmmm...
edited 2×, last 01.07.09 05:07:41 am

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
That's what DC used for carrier monkey and I used for Baby raptor and even Huda Jan Used for tamed squirrel (I belive). It should work. Here is the carrier monkey script If you think I might of missed something.
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
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 {
		if (health("self")>0){
			exchange "self";
		}
	}
	on:kill {
		freetimers "self";
		event "iskill_hunt","global";
	}
and heres the baby raptor script
1
2
3
4
5
6
7
8
on:timer {
		if (health("self")>0){
			if ($lifespan<20) {
				ai_mode "self","goto","unit","1";
				ai_center;
		}

	}

old Re: Scripting Questions

The Second
User Off Offline

Quote
I have some scripting guestions again:

1.> How to get an object to move like unit with unitpath? What script will do the same with object? (from info to other, but not with s2 cmd setat script.)

2.> How to use the s2 cmd cscr script?

3.> What I should write after s2 cmd text3d script?
1
2
3
on:load {
   text3d "class", id, "text", ?, ?;
}
4.∗ And what script will do this: when the clock (game time) is e.g 23.00, gate closes, but when it's 7.00, gate opens?

(p.s. them what I marked with ∗ I know.)
edited 3×, last 04.07.09 10:01:20 pm

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
#4
1
2
3
4
5
if (hour()==7){
model "gfx\gate_closed.b3d";
}elseif (hour()==23){
model "gfx\gate.b3d";
}
This should work, although every time I give a script without testing it never works. Try it though.

old Re: Scripting Questions

The Second
User Off Offline

Quote
Thanks. Now I just need answers to my other guestions...
But what should be the event before your script? on:load or maybe a timer?

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
I don't think there needs to be an event, but you could possibly use a timer every 60000 seconds is one hour in s2, so you could make that increase a variable which then triggers an event at the specified number...
To the start Previous 1 266 67 68121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview