Tutorial Random Things 7
#1
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

#2
umad,
nice
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click

#3
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

#4
(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.

#5
And do you know a way to give velocity to the player?

Thanks,
infiniium

#6
(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

#7
Does setVelocity work in MP scripts?
If not, is there some other way to do this?

Thank you!!!!!

#8
http://zeroy.com/script/
[Image: lQDUjba.jpg]

#9
(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.



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 6,195 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 6,640 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help choose 2 random players?(1 each team) 26hz 6 6,359 09-12-2013, 17:32
Last Post: Yamato
Exclamation [Request] Random Weapon At Spawn Scripts18 3 6,854 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 6,119 07-22-2013, 09:47
Last Post: Yamato
  What script controls the "random" aspect to care packages? akillj 2 4,593 06-05-2013, 11:24
Last Post: akillj
  Random anims master131 14 14,469 05-24-2013, 09:45
Last Post: [HARD] Tony.
  [Request] Random player model hillbilly 1 3,885 05-12-2013, 08:30
Last Post: archit
  [Release] Random Functions 1.1 Yamato 22 18,433 04-20-2013, 10:13
Last Post: Dominator56
  Random interesting facts AZUMIKKEL 40 23,364 11-13-2012, 16:47
Last Post: JariZ

Forum Jump:


Users browsing this thread:
2 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.