Raised This Month: $ Target: $400
 0% 

[How To] Remove ArrayGetString Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 05-01-2014 , 03:22   [How To] Remove ArrayGetString Error
Reply With Quote #1

This is my first "How To", so go easy on me.

this will happen when you remove a sound/model from your zombieplague.ini because you may not want the sound/model.

Never leave a string with no path.


Like this:
Code:
WIN ZOMBIES =  //You removed this because you didnt want it.
WIN HUMANS = Infinity/win_human.wav , Infinity/win_humans3.wav
WIN NO ONE = Infinity/roundclear.wav
If you follow this "How To" correctly, you can remove it like this:
Code:
WIN HUMANS = Infinity/win_human.wav , Infinity/win_humans3.wav
WIN NO ONE = Infinity/roundclear.wav
Thats an example. Now lets move futher to the fix.

Fix for 1st sound in zombieplauge.ini:

Step 1. Open your zombie_plague40.sma

Step 2. Search for the name of the sound you had removed. in my case its "WIN ZOMBIES" and this is the first sound in zombieplague.ini

Step 3. Now you will see this:

PHP Code:
case SECTION_SOUNDS:
            {
                if (
equal(key"WIN ZOMBIES"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_zombieskey)
                        
ArrayPushCell(sound_win_zombies_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                }
                else if (
equal(key"WIN HUMANS"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_humanskey)
                        
ArrayPushCell(sound_win_humans_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                } 
Now, just remove WIN_ZOMBIES code. so it looks like this:

Notice: don't forget to change
PHP Code:
else if (equal(key"WIN HUMANS")) 
To:

PHP Code:
if (equal(key"WIN HUMANS")) 
PHP Code:
case SECTION_SOUNDS:
            {
                         if (
equal(key"WIN HUMANS"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_humanskey)
                        
ArrayPushCell(sound_win_humans_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                } 

Step 3. Now, save the sma, and compile it.

Step 4. go to your zombieplague.ini and remove this line:

Code:
WIN ZOMBIES = Infinity/blabla.wav
Step 5. Done.

-------------------------------------------------------------------

Fix for 2nd/3rd/4th etc, sound:

Code:
WIN ZOMBIES =  first sound.
WIN HUMANS = Second sound, this is the one we are going to fix. 
WIN NO ONE = Third sound
Thats an example. Now lets move futher to the fix for 2nd and more sounds.

The fix. if this is the SECOND and MORE sounds in your zombieplauge.ini:

Step 1. Open your zombie_plague40.sma

Step 2. Search for the name of the sound you had removed. in my case its "WIN HUMANS" and this is the first sound in zombieplague.ini

Step 3. Now, this time, you will see this:

PHP Code:
case SECTION_SOUNDS:
            {
                if (
equal(key"WIN ZOMBIES"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_zombieskey)
                        
ArrayPushCell(sound_win_zombies_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                }
                else if (
equal(key"WIN HUMANS"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_humanskey)
                        
ArrayPushCell(sound_win_humans_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                }
                else if (
equal(key"WIN NO ONE"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_no_onekey)
                        
ArrayPushCell(sound_win_no_one_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                } 
Now, just remove WIN HUMANS code. so it looks like this:

PHP Code:
                case SECTION_SOUNDS:
            {
                if (
equal(key"WIN ZOMBIES"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_zombieskey)
                        
ArrayPushCell(sound_win_zombies_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                }
                else if (
equal(key"WIN NO ONE"))
                    {
                    
// Parse sounds
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ','))
                        {
                        
// Trim spaces
                        
trim(key)
                        
trim(value)
                        
                        
// Add to sounds array
                        
ArrayPushString(sound_win_no_onekey)
                        
ArrayPushCell(sound_win_no_one_ismp3equal(key[strlen(key)-4], ".mp3") ? 0)
                    }
                } 
Step 3. Now, save the sma, and compile it.

Step 4. go to your zombieplague.ini and remove this line:

Code:
WIN HUMANS = Infinity/blabla.wav

Step 5.
Done?, alright.
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 05-01-2014 at 03:26.
SkumTomteN 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 09:02.


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