Dispersion... Is possible!

Topics regarding Scripting with Reality Factory
Post Reply
Lynkyn
Posts: 48
Joined: Sat Jun 21, 2008 2:17 pm

Dispersion... Is possible!

Post by Lynkyn » Fri Sep 12, 2008 11:53 am

Well, everybody said me that, to do dispersion, I would need a scripted weapon. But, in another post, Juutis, gave me this script to do that the camera shakes when I shoot a kind o proyectile:

Code: Select all

{

tilttimer [0]
tiltamount [0]
rotateamount [0]
lastbullets [0]

Spawn[ ()
{
LowLevel("run");
} ]

run[ ()
{
self.ThinkTime = 0.04;

if(GetAttribute("uzib","Player") < lastbullets)
{
tilttimer = self.time + 0.1;

tiltamount = (random(-3,3) + 0.0)/100;
rotateamount = random(-2,2);

lastbullets = GetAttribute("uzib","Player");
}

if(tilttimer > self.time)
{
RotateEntity("Player",0,rotateamount,0);
TiltCamera(tiltamount);
}

if(GetAttribute("uzib","Player") > lastbullets)
{
lastbullets = GetAttribute("uzib","Player");
}
} ]

}

(uzib=uzi bullets)

So, if it can activate a different Tiltcamera when you shoot a uzi, or a gun, etc...

Would it can activate some Fireproyectiles in dispersion? (fireproyectiles with random angles)
So, I will need an invisible pawn that goes just in front of the player, and, when it detects that you are shooting a shotgun, it fires a lot of proyectiles

BUT I have no idea to do scripts. I know some commands and the basic sintaxis, and a little of the logic you must use in them ( :oops: ) but, I can't write scripts...

Some, help please?
A lot of thanks :D

User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA
Contact:

Re: Dispersion... Is possible!

Post by darksmaster923 » Sat Sep 13, 2008 5:39 am

Lol, I did that to simulate inaccuracy in the first RF game I made.

You can do it by simply checking if you have a shotgun in hand, then check if the left mousebutton is pressed, then create more projectiles. I can't give any example code as I do not have the manual with me right now.
Herp derp.

Lynkyn
Posts: 48
Joined: Sat Jun 21, 2008 2:17 pm

Re: Dispersion... Is possible!

Post by Lynkyn » Sat Sep 13, 2008 12:49 pm

Really thanks!!!

So, it is possible without scripting all the weapon system! :mrgreen: I am happy

PD: so, do you use this kind of dispersion in your game?

User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA
Contact:

Re: Dispersion... Is possible!

Post by darksmaster923 » Sat Sep 13, 2008 5:48 pm

Well, its a discontinued game, it really wasn't great. More like a learning experience. Anyway, just to say, scripted weapons are 10 times more flexible, and are pretty handy
Herp derp.

Lynkyn
Posts: 48
Joined: Sat Jun 21, 2008 2:17 pm

Re: Dispersion... Is possible!

Post by Lynkyn » Sat Sep 13, 2008 6:49 pm

Yeah, I know, but I am just learning scripting... (I am very intelligent, I already know that they starts with a "{" xD)

Post Reply