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 2100 101 102121 122 Next To the start

old Re: Scripting Questions

Hecky3
User Off Offline

Quote
hmm...
okay i try to write the script...
But my enlish isnt so good...
ok you put this into a textcontainer:
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
page=start
title=Chieftain
text=start
Hello stranger!
Me is chieftain of tribe huge. I can brew potion magic for you!
text=end
button=trade,Yeah! Potions!
button=action:close,Thanks but I don't need potions

page=trade
title=Trade with chieftain
# Meat -> Juice
trade=start
sell=10,3
buy=47,1
trade=end
# Meat -> Healthpotion
trade=start
sell=10,5
buy=36,1
trade=end
# Meat -> Airpotion
trade=start
sell=10,1
sell=109,10
buy=114,1
trade=end
# Meat + Bread -> Speedpotion
trade=start
sell=10,1
sell=44,1
buy=112,1
trade=end
# Meat + Bread -> Immortalpotion
trade=start
sell=10,6
sell=44,2
buy=113,1
trade=end

button=action:close,Goodbye, great chieftain!

and this you write in (or at?) a native or pirate or something:
1
2
3
on:use {
     dialogue "start","ID"; //ID=ID from the textcontainer
}

then you test the map and talk with the native...
then the trademenu will probably work....

old Re: Scripting Questions

AngeltheFallen
User Off Offline

Quote
Ok I think my main problem here is I am not putting in the Textcontainer's ID?

1
2
3
on:use {
dialogue "start","ID"; //ID=ID from the textcontainer
}

The Chieftian's ID is 100. So do I put it in like this?

1
2
3
on:use {
dialogue "start","100"; //ID=ID from the textcontainer
}

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
no, you dont have to put quotation marks aound the ID and you can leave the stuff after the double slash (//) out (and either the double slash itself) because thats just a comment and doesnt do anything at all.
1
2
3
on:use {
dialogue "start",100;
}
that is what you write into the unit.

old Re: Scripting Questions

AngeltheFallen
User Off Offline

Quote
Zaikantos has written
No, ID needs to be the ID of the textcontainer not the unit.


Ok so how do I figure out the textcontainer ID?

old Re: Scripting Questions

Zaikantos
User Off Offline

Quote
Have the textcontainer menu open and at top it will have a number (ID)

Same way as you find out a chieftain id actually...

old Re: Scripting Questions

AngeltheFallen
User Off Offline

Quote
Zaikantos has written
Have the textcontainer menu open and at top it will have a number (ID)

Same way as you find out a chieftain id actually...


ok found it.....text container ID says its 1. still doesn't work...
Is there something I am failing to do here?

I put the unit down and start entering script....anything else i have to do here? i will post the full script ot:

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
on:use {
dialogue "start",1;
}
page=start
title=Chieftain
text=start
Hello stranger!
Me is chieftain of tribe huge. I can brew potion magic for you!
text=end
button=trade,Yeah! Potions!
button=action:close,Thanks but I don't need potions

page=trade
title=Trade with chieftain
# Meat -> Juice
trade=start
sell=10,3
buy=47,1
trade=end
# Meat -> Healthpotion
trade=start
sell=10,5
buy=36,1
trade=end
# Meat -> Airpotion
trade=start
sell=10,1
sell=109,10
buy=114,1
trade=end
# Meat + Bread -> Speedpotion
trade=start
sell=10,1
sell=44,1
buy=112,1
trade=end
# Meat + Bread -> Immortalpotion
trade=start
sell=10,6
sell=44,2
buy=113,1
trade=end

button=action:close,Goodbye, great chieftain!

this is exactly what the unit's script is...right now.

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
arghs... he wrote it the correct way just a few posts before...

1. place a text-container
2. look up its ID
3. write the following script into the script-box of the text-container:
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
page=start
title=Chieftain
text=start
Hello stranger!
Me is chieftain of tribe huge. I can brew potion magic for you!
text=end
button=trade,Yeah! Potions!
button=action:close,Thanks but I don't need potions

page=trade
title=Trade with chieftain
# Meat -> Juice
trade=start
sell=10,3
buy=47,1
trade=end
# Meat -> Healthpotion
trade=start
sell=10,5
buy=36,1
trade=end
# Meat -> Airpotion
trade=start
sell=10,1
sell=109,10
buy=114,1
trade=end
# Meat + Bread -> Speedpotion
trade=start
sell=10,1
sell=44,1
buy=112,1
trade=end
# Meat + Bread -> Immortalpotion
trade=start
sell=10,6
sell=44,2
buy=113,1
trade=end

button=action:close,Goodbye, great chieftain!
4. place a unit (pirate, prof etc.)
5. click onto the unit to open its menu and write the following script into the script-box of the unit:
1
2
3
on:use {
dialogue "start",[write the ID you looked up in step 2 in here, dont write the brackets!];
}
6. test the map (start it)
7. go to the unit and use it (standard 'E')

old Re: Scripting Questions

AngeltheFallen
User Off Offline

Quote
Hurri04 has written
write this into the script-box of the unit:
1
2
3
on:start {
	ai_stay "self";
}


ok tyvm

I will have other questions.....but i have enough to do what i wanted now, so i will bother everyone no more.....until then. heh

old Re: Scripting Questions

Solve
User Off Offline

Quote
i am making a arrow and all that stuff storage, but its not working, i can take stuff from it but not put in to the storage... i am so pissed ! plz help me!!

this is the script:

### Fletchstorage
id=236
group=building
name=Fletchstorage
icon=gfx\storage.bmp
model=gfx\storage.b3d
health=100
fx=16
mat=wood
scale=3
script=start
on:build_finish {
event "iskill_construct","global";
event "fletchstoragebuild",0,0;
}
on:use {
exchange "self",1,21,23;
exchange "self",51,53,54,55,56,59,60,61,62,63,64,124,123;
}
on:hit {
event "iskill_strenght","global";
}
script=end

and i have taken away the first exchange "self",....

my question is totaly forgotten, why can i only take out stuff from this storage and not put in?

and also i want that if i making for example a bolt in a house the time for making the bolt disapears. (the process of making the bolt)

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
try to change that part:
1
2
3
4
on:use {
	exchange "self",1,21,23;
	exchange "self",51,53,54,55,56,59,60,61,62,63,64,124,123;
}
to this:
1
2
3
4
5
on:use {
	local "$id";
	$id=currentid();
	exchange "object", $id, 1, 21, 23, 51, 53, 54, 55, 56, 59, 60, 61, 62, 63, 64, 124, 123;
}
I dont think that you are allowed to use two s2 cmd exchange commands at the same time.
the '1' after '$id' indicates that the player is allowed to take stuff from the storage and put stuff back into it, if it was an '0' this would indicate that the player can just take stuff from the storege.
so if you want that the items with ID 1 also can be exchanged you have to write another 1 into the code, right after the other 1.



I dont know what you need that for that you dont see the progress-bar when combining something in a house but you could try to combine s2 cmd ai_stay with s2 cmd timer.
but I dont think that this will block other actions like throwing spears, fishing and other stuff you normally cant do until the progress-bar is full...

old Re: Scripting Questions

Solve
User Off Offline

Quote
thx i will try that, but the second 1, the thing i mean is that the progres will be 0, so its instant done, no waiting time.

old Re: Scripting Questions

Solve
User Off Offline

Quote
uhmm... i know how to change the process time but not how to change it when im standing in a house.. plzz, i really need this for my level

old Re: Scripting Questions

Solve
User Off Offline

Quote
i have another question aswell, when you enter a cave, i want it to be darker, as if it where night.. how can i do this?
To the start Previous 1 2100 101 102121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview