Forum

> > Stranded II > Scripts > Scripting Questions
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Scripting Questions

2.429 Antworten
Seite
Zum Anfang Vorherige 1 266 67 68121 122 Nächste Zum Anfang

alt Re: Scripting Questions

Lolems
User Off Offline

Zitieren
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
4× editiert, zuletzt 14.06.09 21:14:09

alt Re: Scripting Questions

infernus
User Off Offline

Zitieren
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)

alt Re: Scripting Questions

Vectarrio
User Off Offline

Zitieren
infernus hat geschrieben
on:node 0119 {
unitpath 485,112,113,114,115,117,118,119;
}

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

alt Re: Scripting Questions

The Second
User Off Offline

Zitieren
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?

alt Re: Scripting Questions

Lolems
User Off Offline

Zitieren
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

alt Re: Scripting Questions

aimeewilbury
User Off Offline

Zitieren
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!
3× editiert, zuletzt 17.06.09 22:28:58

alt Re: Scripting Questions

Vectarrio
User Off Offline

Zitieren
The Second hat geschrieben
How to set how high the bird will fly?

change behaviour: bird, lowbird, or highbird.

alt Re: Scripting Questions

aimeewilbury
User Off Offline

Zitieren
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
3× editiert, zuletzt 28.06.09 04:45:22

alt Re: Scripting Questions

aimeewilbury
User Off Offline

Zitieren
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
1× editiert, zuletzt 29.06.09 00:44:50

alt Re: Scripting Questions

aimeewilbury
User Off Offline

Zitieren
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...
2× editiert, zuletzt 01.07.09 05:07:41

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
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;
		}

	}

alt Re: Scripting Questions

The Second
User Off Offline

Zitieren
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.)
3× editiert, zuletzt 04.07.09 22:01:20

alt Re: Scripting Questions

bezmolvie
User Off Offline

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

alt Re: Scripting Questions

The Second
User Off Offline

Zitieren
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?

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
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...
Zum Anfang Vorherige 1 266 67 68121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht