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 / "playerdrop" doesn't work

Author
Message
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 17th Feb 2017 03:21 Edited at: 17th Feb 2017 03:22
I modified the "weapon.fpi" file so that it enables the player to pick up the weapon then drop it if the player presses G, picking up the weapon works fine, but when I press G ,nothing happens
I keep holding the weapon I tried to use it with different weapons from different model packs but it is the same thing ..

Here's the code:

2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 03:50
In order to use drop/pickup you must set the entity's/weapons "always active" property to yes. Otherwise it will not let you drop the item.
2S!K Productions
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 17th Feb 2017 04:11 Edited at: 17th Feb 2017 04:12
It worked but there are two problems now:

1) The weapon doesn't show up on the screen when I pick it up for the first time

2) When I drop the weapon, I can't pick it up again although the code enables me to
2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 04:11
So I just tested the script and noticed after dropping you could not pick the weapon back up! There is a similar script called "pickupcandrop" and it says after the key is pressed the state is automatically incremented.
REMOVE "state=4," in the third line to fix this. I have tried putting it at the end of the line and still nothing, I suggest just leaving it out as it is not needed.
Also when dropped the weapon hovers slightly above the floor for me (not a big deal), possibly a collision issue. Im curious to know if the "rundecal=-1" is needed since you never tell the script to run a decal in the first place?

Keep up the work!
2S!K Productions
2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 04:14
Quote: "1) The weapon doesn't show up on the screen when I pick it up for the first time"

As in the hud? Can you attatch an image.

Quote: "2) When I drop the weapon, I can't pick it again although the code enables me to"

Lol I just noticed and fixed that read above.
2S!K Productions
Mriganka
4
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 17th Feb 2017 04:53
Hello! The fix works but I found that when the script applies to more than one weapon, then all of the weapons are dropped together. Also, picking up the weapons again increases the ammo of that weapon by a mag. Do you happen to know what causes this error?
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 17th Feb 2017 04:57
@Mriganka
I think there is an action called "playerdropcurrent" or something ... it makes you drop only if it is the current weapon
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 17th Feb 2017 04:58 Edited at: 17th Feb 2017 05:03
[DELETED]
KingMassen
2
Years of Service
User Offline
Joined: 23rd Dec 2016
Location:
Posted: 17th Feb 2017 05:10
@2S!K
Ok It works but There are some issues here:

1) As Mriganka said, it adds ammo when I re-pick it up ... I want the same ammo that I had but it adds one clip ... any solutions?

2) Does "playerdrop" only the one that causes 'state' value to increment by one or are there any other actions? What about 'playertake'? And how did you know that in the first place? Like it is not in the manual or the synatx list lol

Anyway ... thank you for your help
2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 05:13
@KingMassen
Are you deleting state=4 in the third line? The one that reads
. Leave the last line there it is needed to reset the pickup.
I find it strange that Mriganka replicated the results and you could not.
As always, Game on! -2S!K Productions
2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 05:19
I will try to work out a solution for it now just give me time.
Quote: "2) Does "playerdrop" only the one that causes 'state' value to increment by one or are there any other actions? What about 'playertake'? And how did you know that in the first place? Like it is not in the manual or the synatx list lol"

Im not sure I found that strange myself, it is not in the syntax list but there is a premade script for picking up and dropping items (not weapons) and it states so in there. ";playerdrop when press H key causes an automatic increment of the state value"
As always, Game on! -2S!K Productions
2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 05:24 Edited at: 17th Feb 2017 08:00
Solution 1: Change "playerdrop" in line 3 for "playerdropcurrent". This will drop the weapon you are currently using.
Solution 2: Fix additional ammo being added when picking up weapon.
As always, Game on! -2S!K Productions
Mriganka
4
Years of Service
User Offline
Joined: 16th Jun 2014
Location: Virtuality
Posted: 17th Feb 2017 07:17
It works! Thank you. This adds a whole lot of functionality to the game. Too bad this cannot be applied to the vweaps of enemies.
2S!K
6
Years of Service
User Offline
Joined: 21st Jul 2012
Playing: Working on "This Is Home" an FPSc project
Posted: 17th Feb 2017 07:57
Yes I am still working out the ammo being added and I believe I have made a break through!! However it is getting late so I am stopping for today. I will continue to toy with this subject but with my work schedule this may take a while.
Quote: "Too bad this cannot be applied to the vweaps of enemies."

I don't see why not? It is possible for the enemy to drop their weapon on death so this could work.
As always, Game on! -2S!K Productions
Pain
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 4th Apr 2007
Location: Lake Orion, MI - USA
Posted: 17th Feb 2017 20:10
Interesting. Now I want to play with this.

I will try playing around this weekend also. I will report back if I have any luck.

PAIN!
Me = noob
arrojar entidad y que explote
4
Years of Service
User Offline
Joined: 3rd Jan 2015
Location:
Posted: 25th Feb 2017 05:31
Hello, is there any way to solve the drop entity, which appears front and not down? I leave a video sample.



https://www.youtube.com/watch?v=CceW82KAw0U

Login to post a reply

Server time is: 2019-03-22 15:09:35
Your offset time is: 2019-03-22 15:09:35