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 229 30 31121 122 Next To the start

old Re: Scripting Questions

Guest

Quote
Bloodshot has written
First, you have to find out the ID of the tree. This is only really possible in the editor. Then do
1
2
3
4
$TreeRaptorX=Getx("object",the ID of the tree);
$TreeRaptory=Gety("object",the ID of the tree);
$TreeRaptorZ=GetZ("object",the ID of the tree);
Create "unit",2,$$TreeRaptorX,$TreeRaptorY,$TreeRaptorZ;

The TreeRaptorX, Y, and Z variables can be any name you want, as long as you have a dollar sign before them.

its says "ext" is an unknown script command? I just copied and pasted it from your post after on:trigger and changed the inputs.

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Did you put a { after the on command and a } after the last line of your script? Opps, there are two dollar signs before $TreeRaptorX...edited

old Re: Scripting Questions

DC
Admin Off Offline

Quote
Stranded II script is case sensitive. you should write all commands in lower case!

it doesn't say "ext" but "etx" which is the end of "Getx". the G has been skipped because it is upper case and of course there is no command called "etx" which leads to this error.

old Re: Scripting Questions

Guest

Quote
DC has written
Stranded II script is case sensitive. you should write all commands in lower case!

it doesn't say "ext" but "etx" which is the end of "Getx". the G has been skipped because it is upper case and of course there is no command called "etx" which leads to this error.


yes i did use the brackets. Nice game by the way DC. I have been playing and tweaking around with it every day religiously for about a month. It has been the only thing to pry me away from playing Nintendo Wii besides the restroom. I figured out the uppercase problem as well. I was just too lazy to say that I did afterwards. My bad. It seems like the code only works if I replace
1
create "unit",2,-1350,100,-930 ;
with
1
$id=create ("unit",2,-1350,100,-930 ;
but even the raptor does not appear where specified. Even if I assign it to a object location. I really appreciate the assistance I have been getting with this regardless.

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
1, you can get rid of $id=
2, create ("unit",2,-1350,100,930);
3, It appears at -1350,100,-930,
4, that should be your final problom

My trigger dosn't work in editor, it's an arial trigger.
     on:trigger 7{
          my stuff & commands
          }
edited 1×, last 06.06.08 12:26:08 am

old Re: Scripting Questions

ESKARN
User Off Offline

Quote
ok i have a large wooden wall that i want to destroy with the

damage script

how do i do it the id for the wall is 168 and the wall number is 228

how do i do it
edited 1×, last 06.06.08 12:16:11 pm

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
step 1

learn how to type a proper sentence with capitalization and

puncuation

step 2

the code is
1
damage(228,9999999)
i think

old Re: Scripting Questions

ESKARN
User Off Offline

Quote
i have no idea how to do this

how do you keep the player inventory when you go to a different map using

1
loadmap

and is there anyway you can build something on a map and go to a different map then come back and it still be there
edited 2×, last 09.06.08 12:19:31 pm

old Re: Scripting Questions

DC
Admin Off Offline

Quote
loadmap "Map" [,Skills][,Items][,Variables][,Diary][,States][,Buildlocks]

replace everything you want to keep with a 1 and everything you don't want to keep with a 0. you can omit everything after your last 1 since its automatically 0 if you do not enter it. the "[" and "]" just show that the embraced parameter can be omitted so do not write these brackets in your code!

keeping just the items would be this code:
1
loadmap "yourmap",0,1;
or (it's the same):
1
loadmap "yourmap",0,1,0,0,0,0;

Quote
and is there anyway you can build something on a map and go to a different map then come back and it still be there

yes. thats possible but not very easy. you have to save each map somewhere with s2 cmd savemap (which has the same parameters like loadmap) before you load the next one. when going back to this map you load the map you saved. you might also use s2 cmd loadmaptakeover right after loading a map. its 1 if you got stuff from the previous map (map loaded with loadmap and at least one parameter 1) and 0 if not.
edited 3×, last 09.06.08 12:38:01 pm

old Re: Scripting Questions

ESKARN
User Off Offline

Quote
so if i did this

1
2
3
4
5
6
7
8
9
on:use {
savemap "maps\my maps\savemaps\prison2.s2",1,1,1,1,1,1;
loadmap "maps\my maps\thedocs.s2",1,1,1,1,1,1;
 loadmaptakeover

on:use {
savemap "maps\my maps\savemaps\thedocs.s2",1,1,1,1,1,1;
loadmap "maps\my maps\savemaps\prison2.s2",1,1,1,1,1,1;
 loadmaptakeover

would the first map be the same as i left it?

dosent matter i got it thanks DC for all your help
edited 2×, last 09.06.08 02:39:09 pm

old Re: Scripting Questions

Lexicon
User Off Offline

Quote
I am brand new to Stranded, and right now I'm just trying to make a custom map in the Editor. I've been trying and trying to get a Diary to pop-up on start of the game, but even though I've tried to do what it said in the scripting help, I am still doing it wrong.

Could one of you kind souls please explain it to me, step-by-step, including the complete script?

Eventually I want to create a custom map for my daughter that will send her off on a quest by solving math problems (shhh, don't tell her I'm going to make her study!) and will need triggered diary events, but right now I'd just be happy with a diary entry welcoming her to the island and giving her a little info (backstory) to pop up at the start of the game.

Thank you so much in advance! Don't worry, I won't be modding, LMAO!! I just want the diary to work on my custom maps!

*stomps foot and tries to look cute doing it*

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Go to Global map script. Write
1
2
3
on:start {
	diary "//your title" [,"//Directory of a text file"]
	}
Replace "your title" and "directory of a text file with what they say.

old Re: Scripting Questions

Gregg
User Off Offline

Quote
You could also put in a timed trigger:

1) On the map in the editor go onto the info tab.

2) Click timed trigger see here.

3) Place the icon on your map (anywhere).

3.14:P) Click on the trigger to edit it.

4) Put in these specs: Here!

5) Click on the button that says "script".

6) Put in this diary entry, replacing the words with what you want (e.g.)

7) Test it. It should come up immediatly when you start. If it doesn't we'll all try to help :).

Ingame it should look like this.

-Gregg

old Re: Scripting Questions

Lexicon
User Off Offline

Quote
Thank you all soooo much! Bloodshot, I knew about that particular syntax, but I couldn't figure out where to put it (I still don't know what you mean by putting it in the "global map script"). But anyway, I thank you for answering!

Thank you too, MrCowThing, if I ever figure out how to put a script in the "global map script", I would have undoubtably added the brackets if not for your help, lol!

Gregg! I could just hug ya! That worked a charm, and (!) it showed me how I can do the triggered diary events later on (just using the areal trigger instead of the timed one - I'm guessing?).

For clarification....

I need to understand what I did and why I did it, so I'm going to ask just a couple questions about the script itself.

1. I take it the !1 was to make the text yellow. Are there other codes for other colors or text styles?

2. The script ends with "stoptrigger self". Does this mean the particular script ends when the player closes the diary? Or the script simply ends itself?


For instance, if I was to use Areal Info to make another triggered diary entry, I know it would be triggered when the player came within a set distance of the Info. Would the script be basically the same in an Areal Info?


Thank you again, so much!

old Re: Scripting Questions

Gregg
User Off Offline

Quote
Yes, the ariel trigger works the same except on distance.

I also believe there are codes from 1-5, but I've never tried, I'll test now and edit this post in a bit.

The stoptrigger means that the trigger has been activated, and that it needs to stop now (I think, but I just allways assumed that. Any gurus help us with this?)

_Gregg

P.S. Your welcome, we aim to please :PLOL

Edit: Here we are. The order is simple !1 to !7. It appears to stop the text effects at !6. When I tried !0 it locked up. Here ya go

IGNORE EDIT: I was trying to upload an image the internet was too slow and the MrCowThing beat me Oh well!
edited 1×, last 11.06.08 08:43:21 pm

old Re: Scripting Questions

Gregg
User Off Offline

Quote
When I used !0 it locked up.. Hmm, I'll retry it now.
Oh wait I messed up in the code. LOL
To the start Previous 1 229 30 31121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview