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 227 28 29121 122 Next To the start

old Re: Scripting Questions

jeepohahyo
User Off Offline

Quote
The starter for the extmod for example is a simple pascal program which just executes Stranded II with the parameters needed to start the mod with the same name as the starter.

old Re: Scripting Questions

dragoana
User Off Offline

Quote
@Gregg
assign this script to a banana:
1
2
3
4
5
6
on:collect {
     add ""; 
     add "Yummy!"; 
     add "I have found a banana palm, and now I have a food source."; 
     diary "Bananas";
}
you could also trigger that diary entry when the player gets into a certain area (with the banana palm). Use an area trigger with this script:
1
2
3
4
5
6
7
on:trigger {
     add ""; 
     add "Yummy!"; 
     add "I have found a banana palm, and now I have a food source."; 
     diary "Bananas";
     free "self";
}

when you finish a building an event is triggered, like "tentbuild", "hutbuild", "bownetbuild". Look for it in the objectd_buildings.inf

old Re: Scripting Questions

sirrus
User Off Offline

Quote
Okay, I'm working on patching some problems in Massive Mod, and a problem has always been, the hammer doesn't work.

I've reworked the code a little bit, and I got it like this.

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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
################################ Stranded II building

################################ Buildings Group

### Tent
id=1
group=building
objectid=184
req=97
script=start
     unlockbuilding 4;
     unlockbuilding 5;
     unlockbuilding 6;
     unlockbuilding 7;
     unlockbuilding 23;
     unlockbuilding 24;
script=end

### building
id=2
group=building
objectid=165
req=24,20
req=15,30
script=start
     unlockbuilding 4;
     unlockbuilding 5;
     unlockbuilding 6;
     unlockbuilding 7;
     unlockbuilding 23;
     unlockbuilding 24;
script=end

### Bamboo Shelter
id=3
group=building
objectid=160
req=8,20
req=15,30

### Treehouse
id=9
group=building
objectid=190
req=7,10
req=24,25
req=26,30
buildspace=at object
atobject=13
atobject=16
atobject=17
script=start
     unlockbuilding 12;
     unlockbuilding 13;
     unlockbuilding 101;
     unlockbuilding 25;
script=end

### Hut
id=14
group=building
objectid=206
req=7,20
req=24,50
req=15,60
req=26,20
script=start
     unlockbuilding 12;
     unlockbuilding 13;
     unlockbuilding 101;
     unlockbuilding 25;
script=end

################################ Storages Group

### Crate
id=23
group=Storage
objectid=254
req=7,4
req=24,30

### Barrel
id=24
group=Storage
objectid=255
req=7,2
req=24,20
req=86,4

### Storage
id=7
group=Storage
objectid=181
req=7,10
req=24,20
req=23,40
req=26,10
script=start
     unlockbuilding 8;
     unlockbuilding 9;
     unlockbuilding 11;
     unlockbuilding 14;
     unlockbuilding 22;
     unlockbuilding 100;
script=end

################################ Production Group

### Trap
id=13
group=Production
objectid=205
req=24,20
req=49,25

### Bownet
id=10
group=Production
objectid=191
req=24,20
req=49,30
buildspace=water

### Torch
id=5
group=Production
objectid=166
req=24,5

### Fire
id=4
group=Production
objectid=172
req=24,50
req=23,10
script=start
     unlockbuilding 5;
     unlockbuilding 22;
     unlockbuilding 26;
script=end

### Well
id=8
group=Production
objectid=189
req=23,30
req=21,100
script=start
     unlockbuilding 12;
script=end

### Kiwibreeding
id=12
group=Production
objectid=201
req=24,50
req=15,80
req=26,10

### Water Trough
id=22
group=Production
objectid=187
req=7,4
req=24,8

### Herbal-garden
id=15
group=Production
objectid=207
req=7,5
req=24,5
req=21,10
req=15,30

################################ Misc. Group

### Board-Wall
id=20
group=misc
objectid=168
req=24,40
req=7,2

### Big Fence
id=21
group=misc
objectid=182
req=7,2
req=24,10
script=start
     unlockbuilding 11;
script=end

### Watchtower
id=11
group=misc
objectid=200
req=7,10
req=24,20
req=26,10
script=start
     unlockbuilding 12;
     unlockbuilding 13;
     unlockbuilding 20;
script=end

### Anvil
id=26
group=misc
objectid=5000
req=23,30
req=21,20
req=85,10
req=86,10

### Dock
id=25
group=misc
objectid=178
req=7,10
req=24,40
buildspace=water

### Fence
id=6
group=misc
objectid=163
req=24,10
script=start
     unlockbuilding 21;
script=end


################################ Vehicles Group

### Logboat
id=100
group=vehicle
unitid=31
req=7,5
buildspace=water
script=start
     unlockbuilding 101;
script=end

### Sailraft
id=101
group=vehicle
unitid=30
req=7,10
req=24,30
req=26,50
req=49,30
req=96,25
buildspace=water

Okay, after testing, what this produces is being able to build Shelter, tent, and bamboo shelter off of the bat. How do I get it back to just shelter and tent, with everything else building off of that (unlock wise) I know the unlock thing is just making sure everything locks together, but could you still check over the code?

old Re: Scripting Questions

Gregg
User Off Offline

Quote
In sys/game there is a command line:
1
2
3
4
5
6
7
8
on:start {
		//Lock all buildings besides tent and shelter
		//these will unlock new buildings (see buildings.inf)
		if (loadmaptakeover()==0){
			lockbuildings;
			unlockbuilding 1;
			unlockbuilding 2;
		}

Have a look in game, and you will be able to edit it there.

Hope this helps,
-Gregg

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Bloodshot has written
Miner has written
Sorry for double post, but i found one mistake in source code presented 2\3 posts ago.

1
icon=gfx\salt.bmo

I think there must be "bmp" or somethink, sorry if its mine mistake.


I fixed that, it's not the problom. But heres a quickie fix...

script=start
     on:attack2{
          $xx=getx"unit",1;
          $yy=gety"unit",1;
          $zz=getz"unit",1;
          }
     on:use {
          process "Casting Wand",1000;
          msg "You suddenley find yourself in another place";
          setpos"unit"1,$xx,$yy,$zz;
          }
script=end

I think you get the idea...


Hello... I still need help! I've been waiting a whole page, and I still have two unsolved probloms! (Three if you count the one from febuary)

old Re: Scripting Questions

Miner
User Off Offline

Quote
grr im so much newbie... what is this anyway? :
1
req=8,20

thx... damn it was so easy...
√√
edited 2×, last 25.05.08 06:41:31 pm

old Re: Scripting Questions

Gregg
User Off Offline

Quote
It means:

Req= Required, what you need
8= The item name, in this case bamboo (I think)
,20= You need 20 of this item.

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Bloodshot has written
          $xx=getx"unit",1;
          $yy=gety"unit",1;
          $zz=getz"unit",1;

It should me
1
2
3
$xx=getx("unit",1);
$yy=getx("unit",1);
etc

old Re: Scripting Questions

dragoana
User Off Offline

Quote
free "self" removes the trigger. if you stop it with stoptrigger you can start it again (starttrigger)

old Re: Scripting Questions

sirrus
User Off Offline

Quote
Gregg has written
In sys/game there is a command line:
1
2
3
4
5
6
7
8
on:start {
		//Lock all buildings besides tent and shelter
		//these will unlock new buildings (see buildings.inf)
		if (loadmaptakeover()==0){
			lockbuildings;
			unlockbuilding 1;
			unlockbuilding 2;
		}

Have a look in game, and you will be able to edit it there.

Hope this helps,
-Gregg

Thanks, that did the trick

Anyway, right now I'm working on a mod of massive mod, adding more buildings and a building skill. Here's the original code in game.inf for the skill of digging.

1
2
3
4
5
6
7
8
9
10
11
}
	
	on:skill_dig { msgbox "Skill Info","sys/skillinfos/dig.inf"; }
	on:iskill_dig {
		incskill "dig",1,"Digging";
		$tmp=skillvalue("dig");
		if ($tmp==25){ event "skillup","global";}
		if ($tmp==50){ event "skillup","global";}
		if ($tmp==75){ event "skillup","global";}
		if ($tmp==125){ event "skillup","global";}
		if ($tmp==200){ event "skillup","global";}

And here's how I would mod it to change the skill to build...

1
2
3
4
5
6
7
8
9
10
11
}
	
	on:skill_build { msgbox "Skill Info","sys/skillinfos/build.inf"; }
	on:iskill_build {
		incskill "build",1,"Building";
		$tmp=skillvalue("build");
		if ($tmp==2){ event "skillup","global";}
		if ($tmp==5){ event "skillup","global";}
		if ($tmp==10){ event "skillup","global";}
		if ($tmp==20){ event "skillup","global";}
		if ($tmp==30){ event "skillup","global";}

So now my question is, where do skills depend besides the skill infos and that section of game? What do I need to create to have the building skill added?

old Re: Scripting Questions

Amritsar
User Off Offline

Quote
You would have to edit the game.inf files to make it so that the skill increased every time you built something but that shouldn't be too hard.

Sorry if that's what you meant though, I wasn't sure which game you were referring to, the inf file or the actual game

old Re: Scripting Questions

Gregg
User Off Offline

Quote
You could copy the style off grain
1
event "iskill_plant","global";
Would become:
1
event "iskill_build","global";

Then you would need too somehow add levels onto buildings, and that goes past my "expertise" :p Lol


-Gregg

P.S. This is purely experimental, and I just made it up as I went along, but it is worth trying.

old Re: Scripting Questions

Raven Shadow
User Off Offline

Quote
I'm having a bit of trouble learning the correct usage
of the s2 cmd button command and would appreciate some
clarification.
The command reference shows it's format as:
1
button ID, Text [,Script] [,Icon]
and here it is in use (taken from s2ext mod):
1
button 1,"Carry the sack.",17,"sack_take";

I'm guessing the following is correct:
ID = All buttons on the msgbox have to be numbered
     sequencially, starting at zero.
Text = a text label for the button.
Script = a string reference to a script file.
Icon = a string reference to a dedicated .png file to
     be used.

But the 2nd code has a numerical value and an event
reference instead.
could someone please explain the correct usage on the command?

old Re: Scripting Questions

Gregg
User Off Offline

Quote
I agree with Mario, there should be something lke "page1b". Try looking in the Stranded Scripts for an example.

old Re: Scripting Questions

Miner
User Off Offline

Quote
Reference, ech reference... My question is:when does it will be translated? If it's being translated, write the commends which is translated to reference page... PLEAASEE!!!

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
Translate it to which, English or Translator German then English?

Seriously, it's looking like you're not an Englishman what with your grammar and spelling. What country are you from?
To the start Previous 1 227 28 29121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview