10-12-2011, 13:18
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.
Example:
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:
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,
This is another physics command to use in entities, it works like MoveTo function but aplying a vector force instead of a Position:
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:
Another kind is:
There is another Assert: AssertMsg, but I explained it here: http://www.itsmods.com/forum/Thread-Rand...ngs-4.html
And to destroy things:
Thats it,
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-Rand...ngs-4.html
And to destroy things:
Code:
thing delete(); //for entities
thing destroy(); //for hud
Thats it,