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 2121 122 Next To the start

important closed moved Scripting Questions

DC
Admin Off Offline

Quote
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

old Re: Scripting Questions

E_net4
User Off Offline

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

old Re: Scripting Questions

E_net4
User Off Offline

Quote
Umm.. more questions, then...

- Is the played ID 0?
- What does the "Arcade Mode" info do?

old Re: Scripting Questions

DC
Admin Off Offline

Quote
the player id is 1 (npc ids are starting at 100)

the arcade mode disables hunger, thirst and exhaustion.

old Re: Scripting Questions

EwokChieftain
User Off Offline

Quote
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

old Re: Scripting Questions

E_net4
User Off Offline

Quote
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:
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

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
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

old Re: Scripting Questions

Guest

Quote
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.

old Re: Scripting Questions

ragnaro2
User Off Offline

Quote
I found how to make a path for my unit, although i need to know how the unit will repeat the path.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
Gast has written
How do I loop a set amount of times, with a number?


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):
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;
}

old Re: Scripting Questions

ragnaro2
User Off Offline

Quote
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.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
make an info with the script and add following under the s2 cmd msgbox-command:
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.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
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.

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
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 2121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview