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 265 66 67121 122 Next To the start

old Re: Scripting Questions

Someone Evil
User Off Offline

Quote
Well first thing variables must be written like this:
1
2
$this=
$id=
else if you meen like you got eternal fire on a fireplase wen you build it you could only take:
1
2
$id=buildat $this
addstate "object", $id,"eternal fire";
and last take the variabels on top or they wont work for the upper script command.

Hey do anybody know how to rotate the the unit for riding?
edited 1×, last 26.05.09 07:59:23 pm

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
Create a file or an info (text container or smth) with:
1
2
3
4
5
6
7
page=name
title=text
trade=start
sell=id of item,menge
buy=id of item,menge
trade=end
button=name,text
for example: pirate of s2 random map:
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
page=sell
title=Trade with pirate
# Wine -> Gold
trade=start
sell=39,1
buy=5,1
trade=end
# Pearl -> Gold
trade=start
sell=108,1
buy=5,1
trade=end
# Goldnugget -> Gold
trade=start
sell=4,1
buy=5,5
trade=end
# small Crystal -> Gold
trade=start
sell=2,1
buy=5,5
trade=end
# Crystal -> Gold
trade=start
sell=3,1
buy=5,8
trade=end
button=buy,I want to buy something.
button=action:close,Bye.
and in script use command s2 cmd dialogue

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
Put infos and write in script:
1
unitpath UnitId,infoId,infoId,...; (255 infos max)
edited 1×, last 07.06.09 04:25:18 pm

old Re: Scripting Questions

Tau
User Off Offline

Quote
Use the event "on:nodeXXXX" in the unit's script, where XXXX is the id of the last info, and then use unitpath again.

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
Um, what's the script for eternal fire, where do you add it, and how do you add it?

Thanks

Edit: I found this in items_tools:
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
### Firestone
id=22
name=Flint
group=tool
icon=gfx\firestone.bmp
model=gfx\firestone.b3d
scale=0.5
behaviour=blade
mat=stone
weight=500
info=striking two flint stones together provides the sparks needed to start a fire
damage=5
healthchange=0
script=start
	//Set on Fire
	on:impact {
		$tmp=impact_class();
		$tmp2=impact_id();
		//Only "torch" and "fireplace"
		if (compare_behaviour($tmp,$tmp2,"torch")+compare_behaviour($tmp,$tmp2,"fireplace")>0){
			//Works only with at least 2 firestones!
			if (playergotitem(22)>1){
				if (gotstate($tmp,$tmp2,"fire")+gotstate($tmp,$tmp2,"eternalfire")>0){
					msg "Already burning";
				}else{
					if (addstate($tmp,$tmp2,"fire")==1){
						statevalue $tmp,$tmp2,"fire",0;
						msg "Fire started",4;
					}else{
						msg "It's too wet!",3;
					}
				}
			}else{
				msg "I need at least 2",3;
				msg "flints to start a fire!",3;
				speech "negative";
			}
		}
		freevar $tmp;
		freevar $tmp2;
	}
script=end


What do I change?
edited 1×, last 10.06.09 11:46:07 pm

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
This: change "fire" to "eternalfire"
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
### Firestone
id=22
name=Flint
group=tool
icon=gfx\firestone.bmp
model=gfx\firestone.b3d
scale=0.5
behaviour=blade
mat=stone
weight=500
info=striking two flint stones together provides the sparks needed to start a fire
damage=5
healthchange=0
script=start
     //Set on Fire
     on:impact {
          $tmp=impact_class();
          $tmp2=impact_id();
          //Only "torch" and "fireplace"
          if (compare_behaviour($tmp,$tmp2,"torch")+compare_behaviour($tmp,$tmp2,"fireplace")>0){
               //Works only with at least 2 firestones!
               if (playergotitem(22)>1){
                    if (gotstate($tmp,$tmp2,"fire")+gotstate($tmp,$tmp2,"eternalfire")>0){
                         msg "Already burning";
                    }else{
                         if(addstate($tmp,$tmp2,"[b]eternalfire[/b]")==1){
                              statevalue $tmp,$tmp2,"[b]eternalfire[/b]",0;
                              msg "Fire started",4;
                         }else{
                              msg "It's too wet!",3;
                         }
                    }
               }else{
                    msg "I need at least 2",3;
                    msg "flints to start a fire!",3;
                    speech "negative";
               }
          }
          freevar $tmp;
          freevar $tmp2;
     }
script=end

old Re: Scripting Questions

E_net4
User Off Offline

Quote
infernus has written
how to make to player have broken leg?
Just add the fracture state to the player.

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Probably not, but if you can edit the scale to be smaller in the script under units.inf and the eyelevel to be lower, etc. it might be possible
To the start Previous 1 265 66 67121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview