Page 1 of 1

Dispersion... Is possible!

Posted: Fri Sep 12, 2008 11:53 am
by Lynkyn
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

Re: Dispersion... Is possible!

Posted: Sat Sep 13, 2008 5:39 am
by darksmaster923
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.

Re: Dispersion... Is possible!

Posted: Sat Sep 13, 2008 12:49 pm
by Lynkyn
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?

Re: Dispersion... Is possible!

Posted: Sat Sep 13, 2008 5:48 pm
by darksmaster923
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

Re: Dispersion... Is possible!

Posted: Sat Sep 13, 2008 6:49 pm
by Lynkyn
Yeah, I know, but I am just learning scripting... (I am very intelligent, I already know that they starts with a "{" xD)