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

old Re: Scripting Questions

Flying Lizard
User Off Offline

Quote
1. failure: you forogt to preload the animation s2 cmd loadani

2. failure: currentid() only gives the editor id, not the definition id wich is required for animate

3. failure: animate only works with units.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
Flying Lizard has written
2. failure: currentid() only gives the editor id, not the definition id wich is required for animate

wtf? s2 cmd currentid gives you the map id, and that's exactly what s2 cmd animate wants as first parameter.
To get the Editor ID you use s2 cmd type!

old Re: Scripting Questions

Satis
User Off Offline

Quote
okay thanks

EDIT

Emm I would realy like to have en example on how this works :S

can't figure out how to implement the loadani function and get it to work proberly :S
allways giving me an error :S

Where in the Unit do I need to put loadani function in??
in the script part or outside the script par or a total diferent place ?!?

//Satis
edited 3×, last 06.10.07 01:59:10 am

old Re: Scripting Questions

Satis
User Off Offline

Quote
so would it be like this ??
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### Satis Developing
id=500
name=Satis Developing
group=sign
icon=gfx\desk.bmp
model=gfx\gfx_anw\Satis_dev.b3d
health=100
mat=wood
script=start
  on:preload {
     loadani "500",2,6;
  }

  on:start {
     animate currentid(),2,6,6,1;
  }
script=end

I'm still not sure what the Unit-Type in the loadani is, and how it should be scriptet, like:
loadani "Unit-Type",Frame start, frame end;
or
loadani(Unit-Type,feame start,Frame end);

oh BTW: I have been serching if this function have been used in the original game and the Massive Mod, but cant find any where it have been used :S

Maby it's me who is stubid or maby some one need to explain them self a littel better :S

Kind regards
Satis

old Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Quote
Satis has written
I'm still not sure what the Unit-Type in the loadani is, and how it should be scriptet, like:
loadani "Unit-Type",Frame start, frame end;
or
loadani(Unit-Type,feame start,Frame end);

none of that.
Unit-Type is just the ID in the editor. You have to write
loadani 500,2,6;

Also, you have to write that in the game.inf, not in the units inf.

old Re: Scripting Questions

Satis
User Off Offline

Quote
Okay thanks just the info I needed

hmmm one thing that acure is that the spinning is going totaly wild :S

what is the speed in milliseconds or frams pr second,
for one animation until it starts over again ?

And one other thing.
The animation I have set it from frame 2-6 but is that only the points where 2,3,4,5,6 is at or will it take the small animation betwean those frame numbersa as well ??

EDIT

Allso a new question.
Is there a way to check if an combi is locked or unlocket ??

Kind regards
Satis
edited 1×, last 06.10.07 04:58:10 pm

old Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Quote
it plays the whole animations (with the parts between the frames), and the speed is the thing you write after the last frame (animate currentid(),2,6,0.1,1;)


to your edit:
i don't know, but you could set global variables in the unlocking script (game.inf)

old Re: Scripting Questions

Satis
User Off Offline

Quote
Thanks

And a new one
Yes I'm realy in the scripting corner today
I have an combi script that I'm using a timer in.

Some how the timer wont trigger.

here is the script:
1
2
3
4
5
6
7
8
9
10
11
script=start
	process "Crafting Iron Hammer",10000;
	timer "self",9000,1;
        
        on:timer {
               speech "positive";
	       event "hammercombi",0,0;
	       msg "I successfully made a better hammer",3;
	       msg "Stone Hammer is broken",4;
	}
script=end

what am I missing ??
I tryed to debug it in the editor, but it don't give any errors ?!?

Kind regards Satis

old Re: Scripting Questions

Flying Lizard
User Off Offline

Quote
event's don't work in combination definitions.

You've got to change the line with the timer like this:
timer "self",9000,1,"combinationhammer";
And write the other things in teh game.inf like this:

1
2
3
4
5
6
on:combinationhammer {
speech "positive";
event "hammercombi",0,0;
msg "I successfully made a better hammer",3;
msg "Stone Hammer is broken",4;
}

old Re: Scripting Questions

Satis
User Off Offline

Quote
banane has written
to your edit:
i don't know, but you could set global variables in the unlocking script (game.inf)


if I make all those variables in the game.inf just set them from 0-1 depending on they are unlocked or not, will all those variables be saved if in a adventur if I'm going from one map to another ??

and where in the game.inf should they be ??
in the script part and if so, in what on cammand then ?

//Satis

EDIT

Wops sorry for not editing my last post :S

old Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Quote
just add the variables where the buildings are unlocked (within the events "load" and "incskill", and "build_finish" in the buildings.inf)
They will be saved

old Re: Scripting Questions

Satis
User Off Offline

Quote
okay thanks.

so to set the variables in the start of a new game, I set them in the on:start and then make a on:load where it will check if they are true or falsh if it was a loaded map??

//satis

old Re: Scripting Questions

Satis
User Off Offline

Quote
hu?!?
no edit

some one answered after that post, so I had to folow up on that post

//Satis

EDIT

Ha now I'm going to edit it

how do you extend a text in a s2 cmd msgbox ??
like this one:
msgbox "Skill Info","sys/skillinfos/cooking.inf";

I know that I can setup the cooking.inf file so I can set up the msgbox like this:
msgbox "Skill Info","sys/skillinfos/cooking.inf","cooking1";
if I have a cooking2 how do I extend it to the curently messagebox ??

//Satis
edited 1×, last 07.10.07 12:34:22 am

old Re: Scripting Questions

Satis
User Off Offline

Quote
Flying Lizard has written
with this s2 cmd msg_extend and good too this s2 cmd msg_replace


Awsome

Thanks Flying Lizard that helped

kind regards
Satis

EDIT

Question
Can I use buttons in s2 cmd msgbox ?
if so, how?

I have tryed to make the buttons in the "mymessagefile.inf" file, that I have linket to by the s2 cmd msgbox command, but it wont do :S

//Satis
edited 1×, last 08.10.07 09:38:22 pm
To the start Previous 1 26 7 8121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview