Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Weapon Slot Issue

Author
Message
ApertureGFX
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location: United Kingdom
Posted: 5th Mar 2014 23:45
Greetings,

I am currently working on a points-based system for purchasing weapons and what-not. The intention is that a player could purchase a weapon, and it would swap with the weapon the player is holding at the time (the player can only hold one weapon).

The script works fine for the most part, but the newly purchased weapon doesn't appear on-screen until the '1' key is pressed (Which tells me the weapon is definitely there). Is there any way to cause an 'automatic' appearance of the weapon?

Here's the script I'm working with:


ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 8th Mar 2014 01:34
Hi ApertureGFX and welcome
Looking at the script "scancodekeypressed=21" is the "Y" key, it
un-shows the hud G36. Is this the weapon just bought or the old
weapon. As for removing the old weapon, try a different approach.
Try "playerdrop & removeplrweapon=1 (removes weapon from slot 1)
in the script before the new weapon is "bought"?
I do recall "removecurrentweapon" is a bit buggy in some scripts
best

You know you're a bad gamer when you're able to run out of infinite lives.
ApertureGFX
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location: United Kingdom
Posted: 8th Mar 2014 10:37
Hello ncmako, and thank you.

The 'HUDG36' is a HUD that displays to inform the player the chance to purchase the weapon is there (it reads: "Press Y for G36 (1000)).

I tried messing around with 'playerdrop/playertake' to no avail, and 'removeplrweapon=1' gave the same result.

I also tried messing with 'holster=x', which gave the interesting result of giving the player the weapon, but graphically the old weapon was still present (Imagine a 1911 firing like a G36, that's what happened).
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Mar 2014 01:40
ApertureGFX
OK, so that is for the hud. But what script/scripts are you using for the weapon pickup or buy? First take a look at this thread.
http://forum.thegamecreators.com/?m=forum_view&t=209050&b=23 The member wanted to just have the player carry only 2 (two) weapons and no more. But be able to drop the current weapon held. After some trial and error got the script to work. (near bottom of thread). Try this script...
Weapon Main script.
I believe the weapon physics have to be set to "always active" also to work. But this will allow the player to drop current weapon
and switch for another. One still has to turn "mouse wheel" to
bring up weapon. If this works for you, try integrating
your purchase script slowly.
best luck

You know you're a bad gamer when you're able to run out of infinite lives.
ApertureGFX
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location: United Kingdom
Posted: 11th Mar 2014 01:02
Everything is in that one script, the weapon pickup and everything.

That 'mouse wheel' is what I'm having issues with, is there any way to go about fixing that? I don't know whether I'm just being over-critical, but it seems tedious and it may cause problems with others who aren't aware of the bug.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 12th Mar 2014 18:10
ApertureGFX
Ah yes, I see it now. It is all there. In your first post you said
Quote: "purchased weapon doesn't appear on-screen until the '1' key is pressed "
But your actually having to use the mouse wheel. This is not so much a bug, but rather how the engine handles
the scripts. Taking a look at my script I decided to drop the weapon before picking it up. "playerdrop,removeplrweapon=1" This
also clears slot #1 for the next weapon. Then pickup next weapon
"playertake,coloff,showplrweapon" The "showplrweapon" brings the
weapon into view without having to use mouse wheel. Works like a charm
You will probably have to play with it a little to get it to work
just right with your script. But it does Work.
best

You know you're a bad gamer when you're able to run out of infinite lives.
s4real
VIP Member
17
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 16th Mar 2014 12:10
Quote: "and it may cause problems with others who aren't aware of the bug. "


This is not a bug just an error in how you making your script and depends what version of FPSC you using.

If you using the latest version you can do a simple



best s4real

Pack ya games with vishnu packer its free. Vishnu game launcher is now released.
Help keep vishnu free by Donating now :- http://forum.thegamecreators.com/?m=forum_view&t=208057&b=21
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 17th Mar 2014 14:34
Ah yes, the "swap". Thanks S4real.
But isn't it "swapplrweapon=x" or is it now "swapcharacterweap=x"?
Just wondering.
thanks

You know you're a bad gamer when you're able to run out of infinite lives.
s4real
VIP Member
17
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 17th Mar 2014 17:30
@ncmako :- Yes it is swapplrweapon=x scene changed them sometime ago sorry about that I forgot he changed a few of the commands.

I'm working on an older version of fpsc so forgot it changed.

best s4real

Pack ya games with vishnu packer its free. Vishnu game launcher is now released.
Help keep vishnu free by Donating now :- http://forum.thegamecreators.com/?m=forum_view&t=208057&b=21
ApertureGFX
10
Years of Service
User Offline
Joined: 5th Mar 2014
Location: United Kingdom
Posted: 17th Mar 2014 21:18
@ncmako: Thanks for the right command (also, were you involved in 'The Curse of Blackwater'? I recognise your username...)

@s4real: Thank you, it now works perfectly.

Login to post a reply

Server time is: 2024-04-20 16:33:41
Your offset time is: 2024-04-20 16:33:41