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 293 94 95121 122 Next To the start

old Re: Scripting Questions

lint35
User Off Offline

Quote
Okay I got it working but my weapon is sideways, I have been trying different pitches and rolls even changing Y

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
You can change stranded 2 title(title.bmp) to bigger one.
EDIT:
My question: How to use s2 cmd defparam ? Description is in german
EDIT2:
Another question: How to know if some type of object exists?
I don't mean about in-game ID, I mean ID that is in smth_xxx.inf files.
edited 2×, last 23.03.10 03:36:51 pm

old Re: Scripting Questions

Psytechnic
User Off Offline

Quote
Vectar666 has written
EDIT2:
Another question: How to know if some type of object exists?
I don't mean about in-game ID, I mean ID that is in smth_xxx.inf files.


Err... My mod viewer does that... Exactly that... In the buildings page, each row has the building's in inf ID and the Object/Unit ID associated with that building.

I'm Just gonna upload a small fix now. Maybe you could try this version and see if something has changed for you Vectar.

old Re: Scripting Questions

Psytechnic
User Off Offline

Quote
Vectar666 has written
But I mean do this with S2 scripts!


So you mean, read through every script and grab any external scripts that it links to and display that?

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
I mean that i want to let S2 script know all about items, objects, units, infos. And it must be with the use of S2 SCRIPTS ONLY. I need this for gmod. Its script must indicate all existing units/objects/items/infos and its icons. And make a menu.
And second script must find first non-existing item and make the new item on its id.
I know the second part of second script: s2 cmd def_override , for example. But how to indicates existing and non-existing ids BY USING SCRIPTS?

old Re: Scripting Questions

lint35
User Off Offline

Quote
How would I be able to set the player speed of the player when he has a weapon on in hand?

Edit: I have another question, how do I make a unit play a sound file when it flees?
edited 1×, last 24.03.10 03:46:08 am

old Re: Scripting Questions

Vibhor
User Off Offline

Quote
answer for the first question
use on:inhand commands
though you cannot slow the player or anything

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
Vectar666 has written
Vibhor has written
it really makes unit go back
but the projectile speed is the same

EDIT:It also increases speed of everything
it even increased my speed

I don't know about projectile.
But I really forgot that you are unit too
Try that:
1
2
3
4
5
6
7
8
on:keyhit|yourkeyID|{
     loop ("units"){
	if(loop_id()>1){
         	 addstate "unit",loop_id(),"speed";
       		 statevalue "unit",loop_id(),"speed",-1;
  		}
	}
}
If not, then this:
1
2
3
4
5
6
7
8
on:keyhit|yourkeyID|{
     loop ("units"){
	if(loop_id()>1){
         	 addstate "unit",loop_id(),7;
       		 statevalue "unit",loop_id(),7,0;
  		}
	}
}
Also try to change this 7 to 6, or speed value(-10 or -1) to 0.

EDIT: Yep, and if you want projectiles, maybe you can change it this loop "units" to "items".

I've just found solution for this thing.(however, nobody need this because this post is 1 month old).
But:
1
2
3
4
5
on:keyhit|yourkeyID|{
     loop ("units"){
         	 addstate "unit",loop_id(),60;
	}
}

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
DontKnowToScript has written
How to make something a gun,but to cancel the smoke coming out of it?

You can make arbalest with ultra-fast projectiles. It will shoot almost like a gun, but will not create a smoke

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
oh. i think i remember i tried it before and it didnt hit targets. but ill check it out.
Yes as i though. the projectile goes through the object whithut damaging it.
edited 1×, last 26.03.10 05:13:36 pm

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
Oh. I had that problem, that is because projectile is TOO fast
It goes through because for big speed and because of 50 fps, it jumps over smth

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
DontKnowToScript has written
then suggest speed?

I think 50 or 100 or 200
EDIT: How to use s2 cmd closemenu command? It doesn't close cscr! Maybe id or smth?
EDIT2: It works, but keyrelease00 isn't working. Only keyhit.
EDIT3: Yes! Of course! Keyrelease just doesn't work with cscr, because game is paused!
edited 3×, last 26.03.10 07:47:09 pm

old Re: Scripting Questions

The Second
User Off Offline

Quote
How can I create an info to there where the arrow hits?
I have tried:
1
2
3
4
5
6
7
8
9
10
on:impact {
  local $x,$z;
  $x=impact_x();
  $z=impact_z();
  $id=create("info",32,$x,$z);
  timer "info",$id,250,1,"new";
  freevar $x;
  freevar $z;
  freevar $id;
}
(This is in the arrow's definition)
But nothing happens when the arrow hits to the ground...
To the start Previous 1 293 94 95121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview