Scripting Questions
2,429 replies Okay I got it working but my weapon is sideways, I have been trying different pitches and rolls even changing Y
You can change stranded 2 title(title.bmp) to bigger one.
EDIT:
My question: How to use
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.
EDIT:
My question: How to use

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
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.
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.
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?
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:
def_override , for example. But how to indicates existing and non-existing ids BY USING SCRIPTS?
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:

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?
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
answer for the first question
use on:inhand commands
though you cannot slow the player or anything
use on:inhand commands
though you cannot slow the player or anything
My avatar describes my personality the best....Douchebag who have to save the princess without speaking anything
Vectar666 has written:
I don't know about projectile.
But I really forgot that you are unit too
Try that:
If not, then this:
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".
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
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:
Code:
1
2
3
4
5
6
7
8
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;
}
}
}
loop ("units"){
if(loop_id()>1){
addstate "unit",loop_id(),"speed";
statevalue "unit",loop_id(),"speed",-1;
}
}
}
If not, then this:
Code:
1
2
3
4
5
6
7
8
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;
}
}
}
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:
Code:
1
2
3
4
5
2
3
4
5
on:keyhit|yourkeyID|{
loop ("units"){
addstate "unit",loop_id(),60;
}
}
loop ("units"){
addstate "unit",loop_id(),60;
}
}
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
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.
Yes as i though. the projectile goes through the object whithut damaging it.
edited 1×, last 26.03.10 05:13:36 pm




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
It goes through because for big speed and because of 50 fps, it jumps over smth
DontKnowToScript has written:
then suggest speed?
I think 50 or 100 or 200
EDIT: How to use

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
How can I create an info to there where the arrow hits?
I have tried:
(This is in the arrow's definition)
But nothing happens when the arrow hits to the ground...
I have tried:
Code:
1
2
3
4
5
6
7
8
9
10
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;
}
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...