ItsMods

Full Version: Random Things 7
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
New tutorial with random things, Superman

This is a command that you can use in vehicles or models, it has no use at all, is like an indicator of the damage level. You can use it like an info.

Code:
SetDamageStage(number);

Example:

Code:
if(heli.health < 60)
    heli SetDamageStage(2);

Now another command, is only used once in game, and is for ac130, does the same effect as ambientplay, but with an ac130 name, use it on level(not on a player or entity), I used as example, _ac130.gsc one:

Code:
setAC130Ambience("ambient_ac130_int1");

This is another command used in ac130 and chopper gunner, is a vision changer command, is called like that, but you can put whatever vision you want, Big Grin

Code:
self VisionSetThermalForPlayer("black_bw",0); //default game thermal visions are: thermal_mp and thermal_snowlevel_mp, or just call it: game["thermal_vision"]

This is another physics command to use in entities, it works like MoveTo function but aplying a vector force instead of a Position:

Code:
object MoveGravity((x,y,z),seconds);

Now error and checking codes: asserts, this commands are used a lot in game gsc files, they check if something is correct and if not it will make the mod crash with an error.

Example(put inside the () something you want to check:

Code:
OMA()
{
    Assert(self.isoma == 1);
    self giveWeapon("onemanarmy_mp",0,false);
}

Another kind is:

Code:
OMA()
{
    AssertEx(self.isoma == 1,"FU no OMA"); //if is not true, when crashing it will give the text: FU no OMA
    self giveWeapon("onemanarmy_mp",0,false);
}

There is another Assert: AssertMsg, but I explained it here: http://www.itsmods.com/forum/Thread-Rand...ngs-4.html

And to destroy things:

Code:
thing delete(); //for entities
thing destroy(); //for hud

Thats it, Awesome
umad,
nice
Hi,

In a little script I used "moveto" to push a player but sometimes it moves them into walls making them stuck even if I tested the position with bullettrace first. If I would use "MoveGravity" then would it work better, as it just gives velocity to the player?

Thanks,
infiniium
(04-25-2012, 08:58)infiniium Wrote: [ -> ]Hi,

In a little script I used "moveto" to push a player but sometimes it moves them into walls making them stuck even if I tested the position with bullettrace first. If I would use "MoveGravity" then would it work better, as it just gives velocity to the player?

Thanks,
infiniium

It does the same as moveto, it will make the object go through walls. The difference is that to move the object you use a vector instead a position.
And do you know a way to give velocity to the player?

Thanks,
infiniium
(04-25-2012, 13:59)infiniium Wrote: [ -> ]And do you know a way to give velocity to the player?

Thanks,
infiniium

Yes, to give velocity to the player use:

Code:
self setVelocity( vector );

Example:

Code:
self setVelocity( ( 0, 0, 1000 ) ); //this will make it go up
Does setVelocity work in MP scripts?
If not, is there some other way to do this?

Thank you!!!!!
(04-25-2012, 14:32)infiniium Wrote: [ -> ]Does setVelocity work in MP scripts?
If not, is there some other way to do this?

Thank you!!!!!

Yes, it works in MP.