English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 121 122 Next To the start
19.06.07 01:32:31 pm
Up
DC
Admin
Offline Off
This thread can be used for questions concerning scripting in Stranded II.

You can get a (german) commandlist here:
http://www.stranded.unrealsoftware.de/s2_commands.php
(this is going to be translated)

And please read the scripting tutorial (thanks for the translation by ewok!):
http://www.unrealsoftware.de/forum_posts.php?post=51341#lastpost

Edit:
There is now a forum for scripting questions.

√ please create a new thread for your question

√ don't forget to use the search function to find comparable threads first

√ this thread will stay here so you can use it to find existing problems/solutions
edited 2×, last 04.04.11 03:20:16 pm
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
19.06.07 06:03:05 pm
Up
E_net4
User
Offline Off
Here I go with the first questions:

- What's the command to assign a state to our player (how to make him bleed, etc)
- How do you add a diary entry?
- I want the player to not use his hands to hit, like in the map "Tower Defense". How do I do this?
IMG:http://img529.imageshack.us/img529/410/enet4signdn5.jpg
19.06.07 07:20:42 pm
Up
EwokChieftain
User
Offline Off
1. s2 cmd addstate
2. s2 cmd diary (the 2nd parameter is the ID of a text container or the path of an external file to load the text from)
3. By looking up how it's done in "Tower Defense"
IMG:http://home.arcor.de/ewokchieftain/Bilder/KSI.jpg
19.06.07 09:47:19 pm
Up
E_net4
User
Offline Off
Umm.. more questions, then...

- Is the played ID 0?
- What does the "Arcade Mode" info do?
IMG:http://img529.imageshack.us/img529/410/enet4signdn5.jpg
19.06.07 09:59:44 pm
Up
DC
Admin
Offline Off
the player id is 1 (npc ids are starting at 100)

the arcade mode disables hunger, thirst and exhaustion.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
19.06.07 10:01:25 pm
Up
EwokChieftain
User
Offline Off
1. No, according to "units.inf" it is 1.
2. No thirst, no hunger, no tiredness, nothing that would annoy you in an arcade game.

Before you ask the whole command reference, just have a little more patience - DC has just announced he will release Gold really, really soon.
Tomorrow, probably.
And I guess this means that soon after that there will soon be an official English version and an official English website.

Edit: too late
IMG:http://home.arcor.de/ewokchieftain/Bilder/KSI.jpg
19.06.07 10:33:53 pm
Up
E_net4
User
Offline Off
I can't wait for it!
I'll be playing StrandedII on my Summer Holidays! (It's next week)

My script isn't working. It claims to have an error in the following line:
Code:
1
if ($color1==$clr1)&&($color2==$clr2){

Edit: I found the Problem. Forgot Extra "()"

By the way, how do I remove a state?
edited 1×, last 19.06.07 11:03:29 pm
IMG:http://img529.imageshack.us/img529/410/enet4signdn5.jpg
19.06.07 11:20:22 pm
Up
DC
Admin
Offline Off
s2 cmd freestate "class",id,"state";
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
07.07.07 11:49:44 pm
Up
Guest
How do I loop a set amount of times, with a number?
08.07.07 01:40:58 am
Up
Nick99
Is there a page somewhere with all the events from teh game?
08.07.07 08:52:51 am
Up
Builder2-0
User
Offline Off
How can I see is being attacked? Or rather, how can I attatch a script to an item to see if I'm hitting it?

I want to raise a skill every time I hit a stone. Is that possible?

-Builder
08.07.07 11:57:30 am
Up
desu~
Yes, it is possible. Add the skill, and define an event "iskill_mine". Check in (I think) game.inf for the other iskill events.

Although I hate you for your mod because the ideas are leeched off others posted before yours - not saying deliberately. Just saying, other people posted them before you.
08.07.07 05:39:59 pm
Up
ragnaro2
User
Offline Off
I found how to make a path for my unit, although i need to know how the unit will repeat the path.
08.07.07 05:57:17 pm
Up
bizzl
User
Offline Off
Gast has written:
How do I loop a set amount of times, with a number?


Code:
1
2
3
4
5
s2:local $i;
s2:loop("count",[i]Number[/i]) {
$i=s2:loop_id(); [i]//current iteration[/i]
}
s2:freevar $i;


Nick99 has written:
Is there a page somewhere with all the events from teh game?

see s2 cmd on

ragnaro2 has written:
I found how to make a path for my unit, although i need to know how the unit will repeat the path.


Code for the unit (example):
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
s2:on:start {
s2:local $i;
$i=s2:currentid();
s2:unitpath $i,1,2,3,4,5; [i]//Or any other[/i]
s2:freevar $i;
}

[i]//fired when last node in path reached.
//in this case, 5.[/i]
s2:on:node0005 {
s2:local $i;
$i=s2:currentid();
s2:unitpath $i,5,1,2,3,4,5; [i]//Or any other, restart with last point![/i]
s2:freevar $i;
}
ACCOUNT IS DEAD, DO NOT CONTACT ME VIA PM, PLZ!
08.07.07 07:03:44 pm
Up
Guest
That's the most useful post I've ever seen, thanks a lot
08.07.07 07:13:12 pm
Up
ragnaro2
User
Offline Off
Thanks, finnaly i can make my stuff loop I have my last and final question. on the msgbox I have my stuff written in and I need help how to make an option to buy stuff out of it. So like I will trade in my bark for a shotgun or etc. Like a trade system.
08.07.07 07:32:14 pm
Up
bizzl
User
Offline Off
make an info with the script and add following under the s2 cmd msgbox-command:
Code:
1
s2:button 0,"Trade...",0,[i]ID of the Info[/i];

There can be max 10 buttons (first number, 0-9).
The second number (after "Trade...") can be either a number (to choose an icon from the internal icons) or a filename to a bitmap.
ACCOUNT IS DEAD, DO NOT CONTACT ME VIA PM, PLZ!
08.07.07 09:19:12 pm
Up
ragnaro2
User
Offline Off
What do you mean by "ID of the Info?
08.07.07 10:01:38 pm
Up
bizzl
User
Offline Off
the info-object on the map which contains the trading script has an ID.
Use it there.

You also can load the script from a file to the buffer, in this case you can skip the last parameter.
ACCOUNT IS DEAD, DO NOT CONTACT ME VIA PM, PLZ!
08.07.07 10:08:52 pm
Up
Builder2-0
User
Offline Off
desu~ has written:
Yes, it is possible. Add the skill, and define an event "iskill_mine". Check in (I think) game.inf for the other iskill events.

Although I hate you for your mod because the ideas are leeched off others posted before yours - not saying deliberately. Just saying, other people posted them before you.

That's not really what I meant. I've got the skill made. However, I'm not sure if there is any way to detect the player *hitting* a stone. Specifically hitting a stone.

PS: 1. I never intented to make a large release of my mod. I was told to.

2. It was a personal mod.

3. I strived for quality & quantity. I wanted to add lots of new features & items, but do it with quality.

4. Point me to a mod that adds forging, or allows you to refill water bottles, or is working on coal mining and steel forging.

5. I did not look at the work of any other modder before starting my mod. I have not stolen any scripts, any textures, anything. All of this work is my own.

6. I did not intend to make enemies when I released this. I had no ideas you guys would be so volatile to a new mod, I thought you might actually like having more to choose from.

Good day.

-Builder
To the start Previous 1 2 ... 121 122 Next To the start