O Ilusionista
Captain 100K
Hello guys, I need to hear from you all some ideas for a problem I will have in the future if I don't plan it ahead,
Right now, my game has 20 playable characters, and each one has at least one aditional model (weapon) and will have another. So we are talking about 60 models just for the playable characters.
With only 2 exceptions, all those alternate models will be used only in two specific stages (which set the wepaon in the level header) and them nowhere on the game. But since weapons are called using LOAD, all those models will be on the memory all the time, eating resources.
So, how you I could handle it better?
I have an idea, let's see if it's good:
- Call all those alternate models as KNOW, not LOAD
- Track the stage number/name storing it on a Global var
- In SELECT animation, check this Global Var and use a script to load the alternate model - loadmodel(name).
- After the stage end, unloads all the alternate models (probably, using endlevel.c). I know we have a function to "loadmodel", but do we have a function to "unloadmodel" by script?
Any other idea?
Thanks
EDIT: Oh wait, There is a configuration which could help me
Nevermind, it doesn't works with setweap.
Right now, my game has 20 playable characters, and each one has at least one aditional model (weapon) and will have another. So we are talking about 60 models just for the playable characters.
With only 2 exceptions, all those alternate models will be used only in two specific stages (which set the wepaon in the level header) and them nowhere on the game. But since weapons are called using LOAD, all those models will be on the memory all the time, eating resources.
So, how you I could handle it better?
I have an idea, let's see if it's good:
- Call all those alternate models as KNOW, not LOAD
- Track the stage number/name storing it on a Global var
- In SELECT animation, check this Global Var and use a script to load the alternate model - loadmodel(name).
- After the stage end, unloads all the alternate models (probably, using endlevel.c). I know we have a function to "loadmodel", but do we have a function to "unloadmodel" by script?
Any other idea?
Thanks
This would unload the weapon after the level ends, but I would still need to LOAD it right at the start, which impacts the game loading. I would like to bypass this.weapon {name} {bi} Give this spawned enemy {name} as a weapon to start with. The enemy will wield this weapon and attack with it.
~If enemy is knocked down or dies, the weapon will be dropped.
~{bi} determines if model stays in memory or not after current level ends.
0 = Model stays in memory.
1 = Model is unloaded when current level ends.
~Make sure the weapon is available before setting this.
Nevermind, it doesn't works with setweap.