Forum

> > Stranded II > Scripts > tutorial for scripting
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch tutorial for scripting

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: tutorial for scripting

Stranded_Guy2910
User Off Offline

Zitieren
It's what TimeQuesT said the best way to learn script is analyzing scripts from mods and trying make your own scripts, you can also ask people in the site about specific scripts, and reading other questions from users. This is the best way in my oppinion.

alt Re: tutorial for scripting

Stranded_Guy2910
User Off Offline

Zitieren
You can try a script to make the gate open by using a position script (this one is harder), or just use a script to load a new model, just like:

on:use {
      model "model folder";
}

to use a specifc key you must edit the file "game.ini" and add a new key to the game:

scriptkey=xx,"name of the function"

on:keyhitxx {
           "script";
}

Instead of "keyhitxx" you can use "keydownxx" (if you want to keep the key pressed to use your function) and "keyreleasexx" (to stop the "keydownxx" script, it also need a script too).

Obs.:In the "xx" you must specify a number just like:
scriptkey=01
on:keyhit05

Remembering that the number must be the same for the same function.

alt Re: tutorial for scripting

Stranded_Guy2910
User Off Offline

Zitieren
Oh, sorry.
Try this:

To put on the gate:
on:start {
      if ($gate_open==1) {
                     model "gate open texture folder";
}
}

To put on the item:
on:use {
      $gate_open=1;
}

If not work contact me.
And for have answers for your questions, remember to mark the thread as new/unread.
1× editiert, zuletzt 19.10.11 20:12:32

alt Re: tutorial for scripting

JustARandomPlayer
User Off Offline

Zitieren
on:use {
if(playergotitem(#1)<1) {
                          $state=0;
                          }else{
      if(playergotitem(#1)>0) {
                          if($state==0){
                                    model "sfx/gate.b3d";
}
                                    }else{
                          if($state==1){
                                        model "sfx/gate_close.b3d";
}
}
}


"#1" is the id from the key
for example:if you have a key with the id 4,you put #4

alt Re: tutorial for scripting

Stranded_Guy2910
User Off Offline

Zitieren
Man, you was talking about use a item on the gate to open it?

I thought you was talking about use the key separetely and make the gate open.
I use this script in my mod, but it's very more complex.

Sorry for my stupidy.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht