Dual Weapons

Topics regarding Scripting with Reality Factory
Post Reply
dylanwinn
Posts: 84
Joined: Wed Mar 05, 2008 6:15 am

Dual Weapons

Post by dylanwinn » Sun Aug 24, 2008 6:13 am

First, is it possible to have the player hold 2 weapons (controlling one with left-click and the other with right)?

Second, how do you implement alt-fire? (like throwing a grenade or using your machine gun's fancy flamethrower attachment)

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

Re: Dual Weapons

Post by Lynkyn » Sun Aug 24, 2008 12:54 pm

Scripted weapons

Juutis knows a lot of that XD

dylanwinn
Posts: 84
Joined: Wed Mar 05, 2008 6:15 am

Re: Dual Weapons

Post by dylanwinn » Sun Aug 24, 2008 8:21 pm

Lol
I know that I need to use scripted weapons, I wanted to know how to use them!
Also, anyone know how to make a scripted player fly when you hold down the spacebar, like a jetpack?

Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Dual Weapons

Post by Jay » Sun Aug 24, 2008 8:52 pm

Make a scripted player fly:

Use the ForceUp(...) command when the player presses the Spacebar.
Everyone can see the difficult, but only the wise can see the simple.
-----

dylanwinn
Posts: 84
Joined: Wed Mar 05, 2008 6:15 am

Re: Dual Weapons

Post by dylanwinn » Mon Aug 25, 2008 5:55 am

Thanks Jay, I couldnt seem to find it in the manual. Would the syntax for that be "forceup(10)" with 10 being the ammount to raise the player, or is it more complicated than that?

EDIT: Never mind, I figured it out!

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Dual Weapons

Post by Juutis » Mon Aug 25, 2008 10:44 am

First, is it possible to have the player hold 2 weapons (controlling one with left-click and the other with right)?

Second, how do you implement alt-fire? (like throwing a grenade or using your machine gun's fancy flamethrower attachment)
I'm afraid I can't explain it in depth as I'm really busy with my life right now. But basically: Two pawns, each working independently, moving with the player and rotating with the camera. They check if the mouse keys are pressed and fire a projectile. Or check if the alt-fire button is pressed and shoot a different projectile. My demo game has dual weapons. You may download it from my signature.
Pain is only psychological.

Post Reply