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 Product Chat / Swap weapons and set max number of weapons

Author
Message
bojandurmic
14
Years of Service
User Offline
Joined: 28th Dec 2011
Location: My home
Posted: 27th Mar 2013 12:31
Hi guys , I need some help ...

1.) How to swap weapons in FPSC ? Is that even possible ? How ? Please tell me (if I need to) how to add an option for swaping weapons weapons (Like AK47 -> M16)


2.) How to set max number of weapons that player can have ? (I want 3 max weapons)

If someone solves these problems , I would be happy to add him on Special Thanks in credits for my new gamr (Secret Ops)

P.S. I will make a WIP thread as soon as I make something )))
Corno_1
15
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 27th Mar 2013 13:41
1) how do you do this in other shooter? Press 1 2 3 or scroll. That works if the player has more than 1 weapon

2) yes this is also possible:

Put this code into a triggerzone as main script.


bojandurmic
14
Years of Service
User Offline
Joined: 28th Dec 2011
Location: My home
Posted: 27th Mar 2013 21:07
You misunderstood me bro in my question 1

I wanted to do this : so I have 3 weapons and I cant pick another one. And then I see one weapon on the floor I want to have. So any way to change that weapon with some weapon I already have (so I drop AK47 and pick up M16 , which is on the floor
Corno_1
15
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 27th Mar 2013 22:19 Edited at: 27th Mar 2013 22:21
Oh ok. Now there is a little bit sense
and it is possible.
I tell you how it can be done and in the end I will post the finished script! But please read what I did:

How to swap weapon:
- open the weapon.fpi in your scriptbank folder
- delete all the unnessessary line from the script and you should
have something like this:

- the think about what you want:
- see a weapon
- be near the weapon
- press a key
- remove the current weapon and replace it with the other
- what we have in the weapon.fpi
- you are near a weapon and take it(force)
- find actions and conditions what fit into this
- conditions: plrusingaction=1 or keypressed=28 1
- actions: removecurrentweapon
for other keycodes look at this:

- now the last step
- place the commands in the script

End result should look like this:



bojandurmic
14
Years of Service
User Offline
Joined: 28th Dec 2011
Location: My home
Posted: 28th Mar 2013 00:38
Ok and will the dropped weapon be on the ground and ready to be picked up again or it will disappear ?
Corno_1
15
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 28th Mar 2013 10:07
disappear


bojandurmic
14
Years of Service
User Offline
Joined: 28th Dec 2011
Location: My home
Posted: 28th Mar 2013 10:30
Well , Corno_1 , you REALLY helped me . Thank you soo much. I will add you on the credits . Thanks again
Burger
13
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 29th Mar 2013 00:23
To add to this, you could consider adding these conditions:

PLRWEAPONSEQUAL=X
PLRWEAPONSGREATER=X
PLRWEAPONSLESSER=X

With these included in the script you don't always have to replace you're existing gun. ie, PLRWEAPONSLESSER=3:pick up gun and dont replace, PLRWEAPONSEQUAL=3: pick up gun and replace.

I just had another thought. It may be possible to make a script where you have guns sitting somewhere inaccessible to the player, and when a variable is set through the above script it calls that gun to zap to the players location, as if they were swapped. It may not work, but in my mind it may not be impossible with a little bit of advanced scripting.

- An Instinctive Fear IndieDB page, download demo today!
bojandurmic
14
Years of Service
User Offline
Joined: 28th Dec 2011
Location: My home
Posted: 29th Mar 2013 10:29
@Burger can you please write the whole script ? Because I am total noob in scripting . Yes I tried the Cornos script and it was bad because I always changed my weapon :/ . If you please could write it here , you will be REALLY helpful. Please
Corno_1
15
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 29th Mar 2013 13:40
Quote: "Because I am total noob in scripting"

Then learn it. Your game won´t be good if you can not script...
And what burger say is not as hard to integrate. If done it in 30 sec. So a noob needs maybe 1 min. This are two commands which you must integrate as conditions.

Try it. If you not try it, I will not help you....


s4real
VIP Member
19
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 29th Mar 2013 13:48
Corno_1 right if you don't help yourself you will just end up in this same problem when you want to add another feature.

Best thing is to try and have a go and learn scripting and if you have a problem I'm sure someone will help.

Best s4real

Pack ya games with vishnu packer its free. Vishnu game launcher is now released.
Help keep vishnu free by pledging now :- http://vishnu.chipin.com/vishnu
evilangel
13
Years of Service
User Offline
Joined: 17th May 2013
Location:
Posted: 8th Jun 2013 02:37
regards

@bojandurmic here is the script:

;Artificial Intelligence Script
;Header

desc = Weapon Pickup with enter (remove the holded weapon out of the game)

;Triggers

:plrweaponslesser=9:state=12
:plrweaponsequal=9:state=10
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupaweapon.tga,hudname=weaponprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=40,keypressed=28 1:state=1,removecurrentweapon,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt
:state=11,plrdistwithin=40,keypressed=28 1:state=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt
:state=12:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupaweapon.tga,hudname=weaponprompt,hudhide=1,hudmake=display,state=13
:state=13,plrdistwithin=40,keypressed=28 1:state=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt
:state=14,plrdistwithin=40,keypressed=28 1:state=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt

;End of Script

Login to post a reply

Server time is: 2026-06-13 14:18:19
Your offset time is: 2026-06-13 14:18:19