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 224 25 26121 122 Next To the start

old Re: Scripting Questions

Guest

Quote
How do I use inarea_fish? I want my fishing areas to get back 10-15 fish every week.

old Re: Scripting Questions

Guest

Quote
Also, if someone could tell me how to make a teleporter that transports you to somewhere else on the island that'd be AWESOME.

old Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Quote
you just have to add a script with s2 cmd setat or s2 cmd setpos (and maybe a s2 cmd flash effect)... hint:the player is unit 1

post before: use a spawn control

mrcowthing: try this:

script=start
on:inhand {
     $me=currentid();
     timer "item",$me,1000,1;
}
on:timer {
     $me=currentid();
     if (getplayerweapon()!=$me) {skip;}
     msg "tick";
     timer,"item",$me,1000,1;
}
script=end

old Re: Scripting Questions

Guest

Quote
Sweet that worked, now could you give me a example script of inarea_fish?

old Re: Scripting Questions

Guest

Quote
Sorry I couldn't find it, but how do I include additional buildings in the buildmenu?
It looks like the game ignores them, I.E. I've added a building but I don't see it in buildings meny (it's unlocked) but when I replace the vanilla building (just IDs) it's avaliable for building...

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
Gregg: Yeah, that should work. I think > consume energy, hunger, thirst, fatigue will give a different sound or perhaps none at all. Then again, there IS the issue of an extra "Found Pebble (1x)". You can likely circumvent that by spamming > msg "(null)".


EDIT: While I'm here with the last post in the thread, how do I go about an if-then that checks to see if the player is alive and if so, damage player by 50 and give the player a message? I've got the damage player and message part done, I just need to know exactly how to do the if-then.

EDIT TWO: Okay, found that in the reference. The check is s2 cmd lives "class", ID (Returns whether an object of class class and ID ID is alive. Since only units can exist dead, it is largely identical to the command > exists) for those who are interested.
edited 2×, last 18.05.08 08:49:33 am

old Re: Scripting Questions

ohaz
User Off Offline

Quote
you could have also done it with a "if" test, wether his lifepoints are above zero or not

old Re: Scripting Questions

MrCowThing
User Off Offline

Quote
Is there a command that will return any of these, the current weight your holding, the max weight you can hold, or how much weight is left?

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
Okay, got one I can't figure out.

I'd like to know how to trigger some script on dig.

EDIT: dur, there I go again. I post before looking at the list. > on:dig
edited 1×, last 18.05.08 09:30:09 pm

old S.O.S!

lint35
User Off Offline

Quote
I would like some help please, I am trying to make a weapon that you can hit it against something once then it will break (it will be like a wooden sword) and the bomb thing with the getx"item",123 thing dosn't work, it says that the item with the Id of 123 dosn't exist (which it does of course!!)

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
You need to do the explosion at getx("unit",1), gety("unit",1). getz("unit",1) because you are holding the item.

Also, the item with the ID of 123 does not exist because the 123rd non-cumulative item has not come into existence yet.

old Re: Scripting Questions

Guest

Quote
I have a question - on my custom island I have problem with lights. It looks like they burn but do not light area around (and any object with light).
I can make a new map and there I have a nice light effects, but not on my map (which has just 1 dialogue starting script and nothing more pre-defined). The objects have behaviour "torch" but do not light anything.

2nd question - where to define what o behaviours do? (like "torch", "blade" etc.).

old Re: Scripting Questions

DC
Admin Off Offline

Quote
behaviours are pre-defined. you can't change them or create your own ones. you have to use scripts in the definition of objects to modify them.

the torch problem can have several reasons:

- the radius of the fire light is too small to light the environment. maybe you have to add an additional light state with a larger radius

- the maximum of visible lights at the same time is limited to 8 or something like that. if you have too many lights some will not be visible.

- the light is inside oder under the model and can't illuminate the environment. use state=X,Y,Z in the definition of the object to define where the light should appear in relation to the position of the model. the normal torch for example has state=0,39,0 to make the effects appear at its top.

- the whole light stuff is not very precise because its based on vertices not on textures. so if there are not enough vertices in the environment around the light it might lead to the problem that the light is barely visible.

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
You're sure it's not a batch file? Try dragging it into Notepad, you'll see the inner workings of it if it's a batch file.
To the start Previous 1 224 25 26121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview