Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
Reply

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

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

#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.
Reply

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

Thanks,
infiniium
Reply

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

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

Thank you!!!!!
Reply

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

#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.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  GTA V fun things RaZ 4 4,245 05-06-2015, 18:55
Last Post: RaZ
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 3,893 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,348 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help choose 2 random players?(1 each team) 26hz 6 4,336 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,709 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,427 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 4,097 07-22-2013, 09:47
Last Post: Yamato
  What script controls the "random" aspect to care packages? akillj 2 3,044 06-05-2013, 11:24
Last Post: akillj
  Random anims master131 14 10,036 05-24-2013, 09:45
Last Post: [HARD] Tony.
  [Request] Random player model hillbilly 1 2,555 05-12-2013, 08:30
Last Post: archit

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.