![]() |
|
[Tutorial] Random Things 7 - Printable Version +- ItsMods (https://www.itsmods.com) +-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html) +--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html) +--- Thread: [Tutorial] Random Things 7 (/Thread-Tutorial-Random-Things-7.html) |
Random Things 7 - Yamato - 10-12-2011 New tutorial with random things, ![]() 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, ![]() 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-Random-Things-4.html And to destroy things: Code: thing delete(); //for entities
thing destroy(); //for hudThats it,
RE: Random Things 7 - Nekochan - 10-12-2011 umad, nice RE: Random Things 7 - infiniium - 04-25-2012 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 RE: Random Things 7 - Yamato - 04-25-2012 (04-25-2012, 08:58)infiniium Wrote: Hi, 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. RE: Random Things 7 - infiniium - 04-25-2012 And do you know a way to give velocity to the player? Thanks, infiniium RE: Random Things 7 - Yamato - 04-25-2012 (04-25-2012, 13:59)infiniium Wrote: And do you know a way to give velocity to the player? Yes, to give velocity to the player use: Code: self setVelocity( vector );Example: Code: self setVelocity( ( 0, 0, 1000 ) ); //this will make it go upRE: Random Things 7 - infiniium - 04-25-2012 Does setVelocity work in MP scripts? If not, is there some other way to do this? Thank you!!!!! RE: Random Things 7 - OrangePL - 04-25-2012 http://zeroy.com/script/ RE: Random Things 7 - Yamato - 04-25-2012 (04-25-2012, 14:32)infiniium Wrote: Does setVelocity work in MP scripts? Yes, it works in MP. |