Forum

> > Stranded II > Scripts > Scripting Questions
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Scripting Questions

2.429 Antworten
Seite
Zum Anfang Vorherige 1 26 7 8121 122 Nächste Zum Anfang

alt Re: Scripting Questions

Flying Lizard
User Off Offline

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

alt Re: Scripting Questions

bizzl
User Off Offline

Zitieren
Flying Lizard hat geschrieben
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!

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
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
3× editiert, zuletzt 06.10.07 01:59:10

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
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

alt Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Zitieren
Satis hat geschrieben
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.

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
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
1× editiert, zuletzt 06.10.07 16:58:10

alt Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Zitieren
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)

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
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

alt Re: Scripting Questions

Flying Lizard
User Off Offline

Zitieren
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;
}

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
banane hat geschrieben
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

alt Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Zitieren
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

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
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

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
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
1× editiert, zuletzt 07.10.07 00:34:22

alt Re: Scripting Questions

Satis
User Off Offline

Zitieren
Flying Lizard hat geschrieben
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
1× editiert, zuletzt 08.10.07 21:38:22
Zum Anfang Vorherige 1 26 7 8121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht