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

explodestring trouble


Post New Thread Reply   
 
Thread Tools Display Modes
JOSHBOX
Junior Member
Join Date: Sep 2010
Old 12-01-2010 , 01:14   Re: explodestring trouble
Reply With Quote #11

After many many hours of trial and error today I finally got this method working! Thank you so much for pointing me in that direction. I should be able to finish the rest of my plugin tomorrow.

Thanks again for all the help!
JOSHBOX is offline
JOSHBOX
Junior Member
Join Date: Sep 2010
Old 12-02-2010 , 13:31   Re: explodestring trouble
Reply With Quote #12

I ran into another problem last night...

I noticed that after my map changes I am doubling my counter, and duplicating all the contents of my enum structure.

I believe this is happening because my enum struct, my line counter, etc are all declared globally, but my ReadKVFile and Precache functions are called on map start. Would it be better to initialize my enum, counter, etc on map start as well? Would those variables be closed at the end of each map?

My goal is to have it read a fresh copy of my KV file into the struct, and recount all of the lines every time the map changes.

Sorry if this is a dumb question, I searched but couldn't seem to find a clear answer to this.
JOSHBOX is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 12-02-2010 , 14:42   Re: explodestring trouble
Reply With Quote #13

In our ZR plugin we reload the entire configuration on each map change. It's reading config files in the OnConfigsExecuted forward. That way the plugin will be compatible with map configs.

On each map change it's rebuilding all arrays. All counters start from zero again. Variables are declared globally, but initialized in the configs executed event.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
JOSHBOX
Junior Member
Join Date: Sep 2010
Old 12-02-2010 , 15:19   Re: explodestring trouble
Reply With Quote #14

If I am precaching sound and adding files to the downloadtable on map start, are those automatically cleared each time the map ends? Is it good practice to reload those each time the map changes?
JOSHBOX is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-02-2010 , 15:34   Re: explodestring trouble
Reply With Quote #15

Quote:
Originally Posted by JOSHBOX View Post
If I am precaching sound and adding files to the downloadtable on map start, are those automatically cleared each time the map ends? Is it good practice to reload those each time the map changes?
Yes. Add to the downloads table and precache every map start.
psychonic is offline
JOSHBOX
Junior Member
Join Date: Sep 2010
Old 12-03-2010 , 11:44   Re: explodestring trouble
Reply With Quote #16

OK my duplication problem was actually an easy fix. The first thing I did on map start is define my global counter variable to 0 again. Once I do that it just overwrites the pre-existing data from the last time it loaded into the array.

I am happy to say my plugin is now 100% complete. Thank you again to everyone that contributed.
JOSHBOX is offline
Reply


Thread Tools
Display Modes

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 17:10.


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