modmdlbounceN - load custom gib/static grenade models via cubescript
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7216 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+1
-1
@@ -33,4 +33,4 @@ nonSurvDefaults = 0
|
||||
survDamageEffects = 1
|
||||
autosavemap = 0
|
||||
timeBetAutoSaves = 300000
|
||||
numAutoSaveBackups = 12
|
||||
numAutoSaveBackups = 3
|
||||
@@ -841,6 +841,13 @@ docexample [echo (modenum ctf)] [Output: 5];
|
||||
docexample [echo (modenum btosok)] [Output: 21];
|
||||
docident [modlanconnect] [Connect to a modified LAN server.];
|
||||
docremark [The modified server needs to use the original client-server protocol. The protocol version number will be the negated value of an unmodded server.];
|
||||
docident [modmdlbounceN] [change name of directory used for bounce model number N];
|
||||
docremark [These setting should be loaded from config/autoexec.cfg, but they work on-the-fly too.];
|
||||
docremark [If the model fails to load you will end up with nothing being displayed; use delalias to get back to default];
|
||||
docexample [modmdlbounce0 = misc/my_gib1] [This will make the gib 1 model use the data inside packages/models/misc/my_gib1];
|
||||
docexample [modmdlbounce1 = misc/my_gib2] [This will make the gib 2 model use the data inside packages/models/misc/my_gib2];
|
||||
docexample [modmdlbounce2 = misc/my_gib3] [This will make the gib 3 model use the data inside packages/models/misc/my_gib3];
|
||||
docexample [modmdlbounce3 = weapons/grenade2/static] [This will make the grenade static model use the data inside packages/models/weapons/grenade2/static];
|
||||
docident [modmdlpickupN] [change name of directory used for pickup model number N];
|
||||
docremark [These setting should be loaded from config/autoexec.cfg, but they work on-the-fly too.];
|
||||
docremark [If the model fails to load you will end up with nothing being displayed; use delalias to get back to default];
|
||||
|
||||
+9
-1
@@ -7,16 +7,24 @@ const addListOnQuit [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQ
|
||||
|
||||
const on_quit_aliases [
|
||||
_demofile
|
||||
__fontsetting
|
||||
__screenshottype
|
||||
acc1
|
||||
acc2
|
||||
acc3
|
||||
badargs
|
||||
cc1
|
||||
cc2
|
||||
cc3
|
||||
cmapp
|
||||
cs_sets
|
||||
cs_newsets
|
||||
gametimestart
|
||||
i
|
||||
len
|
||||
modifier
|
||||
numcla
|
||||
numrvsf
|
||||
omit_idents
|
||||
preload_music
|
||||
r
|
||||
s
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
bind MOUSE1 attack
|
||||
bind MOUSE2 altaction
|
||||
editbind MOUSE2 [ showmenu editing ]
|
||||
bind MOUSE3 [ weapon ]
|
||||
bind MOUSE3 weapon
|
||||
bind MOUSE4 [ universaldelta 1 ]
|
||||
bind MOUSE5 [ universaldelta -1 ]
|
||||
bind BACKSPACE dropflag
|
||||
|
||||
@@ -516,7 +516,7 @@ void preload_playermodels()
|
||||
}
|
||||
|
||||
void preload_entmodels()
|
||||
{
|
||||
{
|
||||
string buf;
|
||||
|
||||
extern const char *entmdlnames[];
|
||||
@@ -538,10 +538,17 @@ void preload_entmodels()
|
||||
static const char *bouncemdlnames[] = { "misc/gib01", "misc/gib02", "misc/gib03", "weapons/grenade/static" };
|
||||
loopi(sizeof(bouncemdlnames)/sizeof(bouncemdlnames[0]))
|
||||
{
|
||||
model *mdl = loadmodel(bouncemdlnames[i]);
|
||||
model *mdl = NULL;
|
||||
defformatstring(widn)("modmdlbounce%d", i);
|
||||
|
||||
if (identexists(widn))
|
||||
mdl = loadmodel(getalias(widn));
|
||||
else
|
||||
mdl = loadmodel(bouncemdlnames[i]);
|
||||
|
||||
if(dynshadow && mdl) mdl->genshadows(8.0f, 2.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void preload_mapmodels()
|
||||
{
|
||||
|
||||
@@ -509,13 +509,23 @@ void renderbounceents()
|
||||
switch(p->bouncetype)
|
||||
{
|
||||
case BT_NADE:
|
||||
if (identexists("modmdlbounce3"))
|
||||
copystring(model, getalias("modmdlbounce3"));
|
||||
else
|
||||
copystring(model, "weapons/grenade/static");
|
||||
break;
|
||||
case BT_GIB:
|
||||
default:
|
||||
{
|
||||
uint n = (((4*(uint)(size_t)p)+(uint)p->timetolive)%3)+1;
|
||||
|
||||
defformatstring(widn)("modmdlbounce%d", n-1);
|
||||
|
||||
if (identexists(widn))
|
||||
copystring(model, getalias(widn));
|
||||
else
|
||||
formatstring(model)("misc/gib0%u", n);
|
||||
|
||||
int t = lastmillis-p->millis;
|
||||
if(t>p->timetolive-2000)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user