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

Help / Support .ini vs .sma


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GAARA54
Veteran Member
Join Date: Oct 2009
Location: Everywhere
Old 01-03-2012 , 13:47   .ini vs .sma
Reply With Quote #1

as you know all options of models and sounds in zp 4.3 make in .INI file

but 4.2 source code have this instead .INI file:
PHP Code:
// Sounds (randomly chosen if more than one)
new const sound_win_zombies[][] = { "ambience/the_horror1.wav""ambience/the_horror3.wav""ambience/the_horror4.wav" }
new const 
sound_win_humans[][] = { "zombie_plague/win_humans1.wav""zombie_plague/win_humans2.wav" }
new const 
sound_win_no_one[][] = { "ambience/3dmstart.wav" }
new const 
zombie_infect[][] = { "zombie_plague/zombie_infec1.wav""zombie_plague/zombie_infec2.wav""zombie_plague/zombie_infec3.wav""scientist/c1a0_sci_catscream.wav""scientist/scream01.wav" }
new const 
zombie_pain[][] = { "zombie_plague/zombie_pain1.wav""zombie_plague/zombie_pain2.wav""zombie_plague/zombie_pain3.wav""zombie_plague/zombie_pain4.wav""zombie_plague/zombie_pain5.wav" }
new const 
nemesis_pain[][] = { "zombie_plague/nemesis_pain1.wav""zombie_plague/nemesis_pain2.wav""zombie_plague/nemesis_pain3.wav" }
new const 
zombie_die[][] = { "zombie_plague/zombie_die1.wav""zombie_plague/zombie_die2.wav""zombie_plague/zombie_die3.wav""zombie_plague/zombie_die4.wav""zombie_plague/zombie_die5.wav" }
new const 
zombie_fall[][] = { "zombie_plague/zombie_fall1.wav" }
new const 
zombie_miss_slash[][] = { "weapons/knife_slash1.wav""weapons/knife_slash2.wav" }
new const 
zombie_miss_wall[][] = { "weapons/knife_hitwall1.wav" }
new const 
zombie_hit_normal[][] = { "weapons/knife_hit1.wav""weapons/knife_hit2.wav""weapons/knife_hit3.wav""weapons/knife_hit4.wav" }
new const 
zombie_hit_stab[][] = { "weapons/knife_stab.wav" }
new const 
zombie_idle[][] = { "nihilanth/nil_now_die.wav""nihilanth/nil_slaves.wav""nihilanth/nil_alone.wav""zombie_plague/zombie_brains1.wav""zombie_plague/zombie_brains2.wav" }
new const 
zombie_idle_last[][] = { "nihilanth/nil_thelast.wav" }
new const 
zombie_madness[][] = { "zombie_plague/zombie_madness1.wav" }
new const 
sound_nemesis[][] = { "zombie_plague/nemesis1.wav""zombie_plague/nemesis2.wav" }
new const 
sound_survivor[][] = { "zombie_plague/survivor1.wav""zombie_plague/survivor2.wav" }
new const 
sound_swarm[][] = { "ambience/the_horror2.wav" }
new const 
sound_multi[][] = { "ambience/the_horror2.wav" }
new const 
sound_plague[][] = { "zombie_plague/nemesis1.wav""zombie_plague/survivor1.wav" }
new const 
grenade_infect[][] = { "zombie_plague/grenade_infect.wav" }
new const 
grenade_infect_player[][] = { "scientist/scream20.wav""scientist/scream22.wav""scientist/scream05.wav" }
new const 
sound_survivor[][] = { "zombie_plague/grenade_explode.wav" }
new const 
grenade_fire_player[][] = { "zombie_plague/zombie_burn3.wav","zombie_plague/zombie_burn4.wav","zombie_plague/zombie_burn5.wav","zombie_plague/zombie_burn6.wav","zombie_plague/zombie_burn7.wav" }
new const 
grenade_frost[][] = { "warcraft3/frostnova.wav" }
new const 
grenade_frost_player[][] = { "warcraft3/impalehit.wav" }
new const 
grenade_frost_break[][] = { "warcraft3/impalelaunch1.wav" }
new const 
grenade_flare[][] = { "items/nvg_on.wav" }
new const 
sound_antidote[][] = { "items/smallmedkit1.wav" }
new const 
sound_thunder[][] = { "zombie_plague/thunder1.wav""zombie_plague/thunder2.wav" 
for example 4.2 have this code:

PHP Code:
new const sound_survivor[][] = { "zombie_plague/survivor1.wav""zombie_plague/survivor2.wav" 
PHP Code:
        // Play survivor sound 
        
PlaySound(sound_survivor[random_num(0sizeof sound_survivor -1)]); 
and precache...

4.3 have this:

PHP Code:
Array:sound_survivor
PHP Code:
    sound_survivor ArrayCreate(641
PHP Code:
        // Play survivor sound 
        
ArrayGetString(sound_survivorrandom_num(0ArraySize(sound_survivor) - 1), soundcharsmax(sound)) 
        
PlaySound(sound); 
PHP Code:
                else if (equal(key"ROUND SURVIVOR")) 
                { 
                    
// Parse sounds 
                    
while (value[0] != && strtok(valuekeycharsmax(key), valuecharsmax(value), ',')) 
                    { 
                        
// Trim spaces 
                        
trim(key
                        
trim(value
                         
                        
// Add to sounds array 
                        
ArrayPushString(sound_survivorkey
                    } 
                } 
and precache....


and in 4.2 and in 4.3 this:

PHP Code:
// Plays a sound on clients 
PlaySound(const sound[]) 

    
client_cmd(0"spk ^"%s^""sound


as you see 4.3 use more code than 4.2 AND what doing in 4.3:

source need to find name of line in .ini file, consider it and than play sound...

in 4.2 sound play at once from new const in source ...

and question:

whether there will be a sense if to make in 4.3 also as in 4.2
will be less loading on the server or not?
or this is stupid idea ?
__________________
GAARA54 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-03-2012 , 16:29   Re: .ini vs .sma
Reply With Quote #2

ZP4.2:
* Easy to control which file we need to precache or not.
* Need to recompile for each customization is done.
* Fast loading maybe.. because it doesn't need to call for an external setting files.

ZP4.3:
* Easy to make customization.
* No need to recompile for each customization is done.
* If mess with .ini file it will give an array error in game.

For me it seems zp4.2 style is good to use.

*** Who still have zp4.2 sourcecode please share here, i wanna explore the code uhuh uhuh classic.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
GAARA54
Veteran Member
Join Date: Oct 2009
Location: Everywhere
Old 01-03-2012 , 19:18   Re: .ini vs .sma
Reply With Quote #3

yokomo thanks for explain
in attachment source code 4.2

Quote:
* Need to recompile for each customization is done.
* If mess with .ini file it will give an array error in game.
i'm not lazy to recompile each when i change ways to sounds models...
and i don't so stupid to lose .ini file or get errors in it

but about code...
what i do now: i delete in my source unnecessary codes, cvars, which i don't using...(i think it make less load on server) and how you think it will be better to change .ini code in 4.3 to new const like 4.2 ? it will be make less load on server or not ? i think yes, because code in 4.2 is easyer than in 4.3.... (maybe i don't right)
what you opinion about this?
Attached Files
File Type: sma Get Plugin or Get Source (zombie_plague40 4,2mod.sma - 506 views - 263.5 KB)
__________________

Last edited by GAARA54; 01-03-2012 at 19:19.
GAARA54 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-03-2012 , 23:14   Re: .ini vs .sma
Reply With Quote #4

Quote:
Originally Posted by GAARA54 View Post
yokomo thanks for explain
in attachment source code 4.2

i'm not lazy to recompile each when i change ways to sounds models...
and i don't so stupid to lose .ini file or get errors in it

but about code...
what i do now: i delete in my source unnecessary codes, cvars, which i don't using...(i think it make less load on server) and how you think it will be better to change .ini code in 4.3 to new const like 4.2 ? it will be make less load on server or not ? i think yes, because code in 4.2 is easyer than in 4.3.... (maybe i don't right)
what you opinion about this?
You do a same thing as me, i also delete all code that i doesn't use. That mean a lot of default code i've delete. So less cvar, less precache file, less native and so on . Yup server load a bit fast.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 01-04-2012 , 08:41   Re: .ini vs .sma
Reply With Quote #5

What you gonna do ?
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
GAARA54
Veteran Member
Join Date: Oct 2009
Location: Everywhere
Old 01-04-2012 , 16:43   Re: .ini vs .sma
Reply With Quote #6

Quote:
What you gonna do ?
Quote:
what i do now: i delete in my source unnecessary codes, cvars, which i don't using...(i think it make less load on server)
what i get when i change way to play sounds with method like 4.3 to way like in 4.2

before: 11 500 + lines of code
after: 9224 lines of code

(don't exactly because i delete some things too)

i think it is better

the lesser code is better code
__________________
GAARA54 is offline
xfile_
Senior Member
Join Date: Apr 2009
Old 01-04-2012 , 17:12   Re: .ini vs .sma
Reply With Quote #7

after the vercion 4.3 (beta 3), mercylezz began to customize the plugin for those who do not understand. and facilitate the changes made by third.

memory and cpu usage much.

if you use an older version, update with the bugs fixed in the current vercion.
__________________

Last edited by xfile_; 01-04-2012 at 17:13.
xfile_ is offline
Send a message via MSN to xfile_
GAARA54
Veteran Member
Join Date: Oct 2009
Location: Everywhere
Old 01-04-2012 , 17:59   Re: .ini vs .sma
Reply With Quote #8

you mean the 5.0 version use more cpu than 4.3 ?

offtop:
xfile_ picture in your signature is my favourite scene in this film
__________________
GAARA54 is offline
xfile_
Senior Member
Join Date: Apr 2009
Old 01-04-2012 , 22:42   Re: .ini vs .sma
Reply With Quote #9

Quote:
Originally Posted by GAARA54 View Post
picture in your signature is my favourite scene in this film


Quote:
Originally Posted by GAARA54 View Post
you mean the 5.0 version use more cpu than 4.3
the vercion 5.0, use the code base (4.3) but separated in external files, each file has its function in relation to the game.
in order to make, it easy to add changes, external to the zp.
errors can prevent or fix, if any will have to verify the part affected.

example of the part affected

Quote:
zp50_core.sma
zp50_zombie_class.sma
zp50_human_class.sma
and more ...
create external files for the base code, call functions, different and repeated, then run them all at the same time, the cpu usage and memory varies.
__________________
xfile_ is offline
Send a message via MSN to xfile_
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 23:04.


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