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 2102 103 104121 122 Next To the start

old Re: Scripting Questions

CPG
User Off Offline

Quote
@Hurri04
Thanks for the great code trick. I never would have considered using using global variables to transfer local variables. I still have some work to do on this script (mainly accounting for spawntimers negative values into natural number only variables) but at least now with your workaround the check occurs (since the check causes the crash of the game since my variables are not greater than zero). Thanks for all the great coding help.

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
DontKnowToScript has written
Guys-
Is there a way to make player defined times to do actions instead of fixed processes? that he chooses inside the game? E.g. player wants to study a research. he doesnt have much time though he needs to complete a part of it. how do i make something that when he starts to research,it doesnt write the time but when he wants to stop he does something and it stops instantly. how i do that?


I am sorry i have the hardest questions,but that means i want to make a good mod for everybody,so can you do your best trying to answer them? No push,im just curious how to do it.

old Re: Scripting Questions

ab6100
User Off Offline

Quote
two questions

1 is there a "ai_gotstate" script thingy?

2 what is the script line for player movement?

please help

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
for your first question is :
just use command if (getstatevalue("unit",ID,STATE ID)==1){
blablabla
}
i hope it helps. in id put id of unit and in state id the id of the state. im 99% sure the command is right,though i didnt experiment it much so try it.

old Re: Scripting Questions

ab6100
User Off Offline

Quote
Thank you!

off topic- just found out my mods game.inf file was broken and I had to restart from the orignal. There goes 3 weeks of my life lol.

ps. Could someone please wright me a sample timer script, and how would I set a dialog box to close on trade
(for a gift from the gods) and set scripts to trigger on a buton.
edited 1×, last 27.06.10 11:34:14 pm

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
sample timer:
timer "class",id,time,multiplier (how much times the timer repeats. if its 0,then its infinite.5=5 times.that means time X multiplier=total time),"source"(script to execute at end of timer,can be a text container or a script file in mods/scripts.)

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
Double No problem ;p

Another question: is it possible to make pictures pop up on screen as messages or something?
edited 1×, last 29.06.10 06:30:40 pm

old Re: Scripting Questions

ab6100
User Off Offline

Quote
how would i set an idem to not be able to be droped

edit*
got it
on:drop
     skip event;


lol fail

any whay...
how would i get an idem to switch when theres zero of it? like throwing spears switch to stabing spears when youve ran out?

ive tryed ...
1
2
3
4
5
on:attack1 {
		if (playergotitem(52)==0) {
			equip 1152;
		}
	}
edited 2×, last 04.07.10 05:17:09 am

old Re: Scripting Questions

ab6100
User Off Offline

Quote
still dosent work : (
im gonna use throwing spears as ammo for hand

Edit* the on:drop
          skip event

thing dosent work.... please help

ps. can i have a sample "if" line useing if $fwater is not equal to 1

ive tryed if ($fwater!=1)
edited 2×, last 04.07.10 07:42:03 pm

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Well, then, if all those don't work, you're doing something wrong in the first place. Are you putting the scripts in the right file, under the right item, in the right mod? Are you launching Stranded2 with that mod? Are you checking with the correct item ingame?

old Re: Scripting Questions

ab6100
User Off Offline

Quote
yes yes yes yes. it is a wepon script in the idems_wepons.inf file for my mod The Games. witch is in a stand alone folder

old Re: Scripting Questions

ttei
User Off Offline

Quote
projectileisc?Item-Typ,X,Y,Z,Modus, ... ,[,Offset][,Waffe][,Geschw.][,Schaden][,Drag]

The choice of the target, there are five modes with different parameters:

1 - Class, ID - The projectile flies to a particular object
2 - X, Y, Z - The projectile flies at a certain coordinate
3 - Pitch, Yaw - The projectile flies in a certain direction
4 - The projectile flies on the player
5 - range - except projectile flies to the next unit in range (players!)
6 - Range - The projectile flies to the next aggressive unit in range

Model how to write a script format
could someone please explain the parameters it takes?

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
s2 cmd projectile

projectile (1,50,50,50,4,10);

This would create a projectile of item 1, a bag, at the XYZ coordinates of (50,50,50), and of mode 4, flies at the player, with a 10 offset so it starts off 10 more towards the player. Other modes need certain parameters, which the ,..., is replaced with. the [Offset], [WeaponType], [Speed], [Damage], and [Drag] are optional, But WeaponType, Speed, Damage, and Drag can only be used if the first parameter is 0.

old Re: Scripting Questions

ab6100
User Off Offline

Quote
ok gave up...er postponed that script...

umm anywhay im haveing troble makeing skills for my mod could someone please help ?

ps. should this work

More >
edited 2×, last 09.07.10 12:42:22 am

old Re: Scripting Questions

ab6100
User Off Offline

Quote
yep games.inf

im using it to make other states

so like if the last thing you drank was salt water you lose 15 water a second or if your bleading every 5 seconds it heals some
To the start Previous 1 2102 103 104121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview