Hi there, I am looking for help with the following:
I am modding the VIP gametype to become my own SPY/TRAITOR gametype. More details here:
http://dbtactical.clanservers.com/Forums/index.php/topic,1136.msg6504.html%23msg6504
First feature to change is:
setting the "axis" VIP model to spawn as "ally" model
I have had no success yet, only ever get "script compile error". However here are several scripts I've attempted.
Attempt 1:
In my first week of learning script, I tried only changing the teams.gsc file like this:
Code:
model()
{
self detachAll();
if((self.pers["team"] == "allies") && (self IsVIP ()))
[[game["axis_model"] ]]();
else if((self.pers["team"] == "allies") ! (self IsVIP ()))
[[game["allies_model"] ]]();
else if((self.pers["team"] == "axis") && (self IsVIP ()))
[[game["allies_model"] ]]();
else if((self.pers["team"] == "axis") ! (self IsVIP ()))
[[game["axis_model"] ]]();
self.pers["savedmodel"] = maps\mp\_utility::saveModel();
}
The problem I suspect is that the definition (self isVIP) is only defined within the vip.gsc file NOT the teams.gsc file. Therefore my script didn't make sense. So i reverted the teams.gsc file and moved on to try a different way.
Attempt 2:
Reverting the teams.gsc file to unmodified, and changing the vip.gsc file like this:
Code:
spawnPlayer()
{
self endon("disconnect");
self notify("spawned");
self notify("end_respawn");
team = self.pers["team"];
resettimeout();
// Stop shellshock and rumble
self stopShellshock();
self stoprumble("damage_heavy");
self.sessionteam = team;
self.sessionstate = "playing";
self.spectatorclient = -1;
self.archivetime = 0;
self.psoffsettime = 0;
if (self IsVIP ())
{
setvipteammodels();
}
That part of the code continues on like a usual vip.gsc file, but then later it defines:
Code:
setVIPteamModels()
{
switch(game["allies"])
{
case (isdefined(self IsVIP () && "british"):
if((isdefined(game["british_soldiertype"]) && game["british_soldiertype"] == "africa")) && (self IsVIP ())
{
mptype\british_africa::precache();
game["vipaxis_model"] = mptype\german_africa::main;
}
else
{
mptype\british_normandy::precache();
game["vipaxis_model"] = mptype\german_normandy::main;
}
break;
case (isdefined(self IsVIP () && "russian"):
if(isdefined(game["russian_soldiertype"]) && game["russian_soldiertype"] == "padded") && (self IsVIP ())
{
mptype\russian_padded::precache();
game["vipaxis_model"] = mptype\german_winterdark::main;
}
else
{
mptype\russian_coat::precache();
game["vipaxis_model"] = mptype\german_winterlight::main;
}
break;
case (isdefined(self IsVIP () && "american"):
default:
mptype\american_normandy::precache();
game["vipaxis_model"] = mptype\german_normandy::main;
}
if((isdefined(game["german_soldiertype"]) && game["german_soldiertype"] == "winterdark") && (self IsVIP ())
{
mptype\german_winterdark::precache();
game["vipallies_model"] = mptype\russian_padded::main;
}
else if((isdefined(game["german_soldiertype"]) && game["german_soldiertype"] == "winterlight") && (self IsVIP ())
{
mptype\german_winterlight::precache();
game["vipallies_model"] = mptype\russian_coat::main;
}
else if((isdefined(game["german_soldiertype"]) && game["german_soldiertype"] == "africa") && (self IsVIP ())
{
mptype\german_africa::precache();
game["vipallies_model"] = mptype\british_africa::main;
}
else if(((isdefined(game["german_soldiertype"]) && game["german_soldiertype"] == "normandy") && (self IsVIP ()) && ((enemyteam = "allies") && ("allies" = "british"))
{
mptype\german_normandy::precache();
game["vipallies_model"] = mptype\british_normandy::main;
}
else if(((isdefined(game["german_soldiertype"]) && game["german_soldiertype"] == "normandy") && (self IsVIP ()) && ((enemyteam = "allies") && ("allies" = "american"))
{
mptype\german_normandy::precache();
game["vipallies_model"] = mptype\american_normandy::main;
}
return;
}
//Defining unique class of VIP on Axis vs. Allies team
vipmodel()
{
self detachAll();
if((self.pers["team"] == "allies") && (self IsVIP ())
[[game["vipallies_model"] ]]();
else if((self.pers["team"] == "axis") && (self IsVIP ())
[[game["vipaxis_model"] ]]();
self.pers["savedmodel"] = maps\mp\_utility::saveModel();
}
Attempt/idea 3:
Another idea I have is modding the mptype models. For example, in addition to the mptype\british_africa.gsc file I will have a custom mptype\VIP_british_africa.gsc file which inside will point to loading the mptype\german_africa.gsc file.
Then in the vip.gsc file:
*** I would have to precachemodel for these custom models. I don't know how to write that.
*** I would have state that if player IsVIP set VIPmodel. I don't really know where/how to define VIPmodel. Any ideas? Maybe this is similar to defining the pistol used by VIP players.
edited on Jan. 9, 2011 10:44 am by ODAWA
edited on Jan. 9, 2011 01:04 pm by ODAWA