Raised This Month: $51 Target: $400
 12% 

[L4D2] Find transitioned items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BrianGriffin
Senior Member
Join Date: Oct 2008
Old 09-02-2011 , 14:52   [L4D2] Find transitioned items
Reply With Quote #1

I want to make a weapon upgrade system where you buy upgrades and they stay fixed to the gun you attached them to. If you throw it away somebody else can pick it up and enjoy the upgrades you bought for it. This is all no problem, but what I'm struggling with is transitioning the upgrades properly between maps.

Problems:
  1. Only want to carry the upgrades over between campaign levels, not when somebody leaves during a campaign level and then starts a survival game on the server
  2. Mapping the old entitys to the new ones. The entity index and reference change between maps, so I can't just store that. If I just carry over the upgrades for the guns in a players inventory after map change I might be able to do it with some hacking, but then I'm missing upgraded weapons in the saferoom floor that that were recreated when transitioning. I tried setting the m_Gender of the weapon since I don't think that's used for anything but it was missing in the next map
BrianGriffin is offline
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 09-02-2011 , 17:33   Re: [L4D2] Find transitioned items
Reply With Quote #2

At the end of every round, store the weapons on the map into an SQL database. On the next map, reload them.

Also, check this out. Idk if it will save the weapon upgrades or whatever.
http://forums.alliedmods.net/showthread.php?p=1349430

Last edited by ajr1234; 09-02-2011 at 17:47.
ajr1234 is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-04-2011 , 05:55   Re: [L4D2] Find transitioned items
Reply With Quote #3

SQL database o_O a Trie or an Array will do just fine

1. Wipe your stored upgrades upon changing of mp_gammode

2. Use the players as reference. Save their steamids, and upon re-gaining control of their chars re-apply the upgrades you had saved for them. Alternatively you can use the player models.
AtomicStryker is offline
BrianGriffin
Senior Member
Join Date: Oct 2008
Old 09-04-2011 , 11:08   Re: [L4D2] Find transitioned items
Reply With Quote #4

For wiping I can actually use the first_spawn event (or something like that). It fires the first time somebody enters in a campaign/survival/whatever.

Storing the upgrades for the weapons the player currently has is also no problem at all.

My main regard is storing the upgrades on dropped weapons that were dropped in the saferoom and did transition to the next map!
BrianGriffin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode