2007.09.09, 04:56 AM
Okay, you know how i'm basing bw of the demo? weeell, i wanna get rid of the raygun, or at least make it so that you don't have to get it.
If i remove the part in red:
If i remove the parts in blue:
If i remove the part in red:
Quote://Then it won't open due to "references to undefined weapon.
// This is the object definition for a weapon.
//
function playerWeapon(name,bitmapName,meshName,hasClip,hasAmmo,hasAltAmmo)
{
this.name=name; // name of weapon
this.bitmapName=bitmapName; // name of bitmap in hud that represents this weapon
this.meshName=meshName; // name of mesh in player model that represents this weapon
this.hasClip=hasClip; // if this weapon uses clips
this.hasAmmo=hasAmmo; // if this weapon has ammo
this.hasAltAmmo=hasAltAmmo; // if this weapon has alternative ammo
}
//
// Now we create an array of these definitions
//
var weapons=new Array(6);
weapons[0]=new playerWeapon('Hammer','Hammer Icon','Hammer',false,false,false);
weapons[1]=new playerWeapon('Pistol','Pistol Icon','Pistol',true,true,false);
weapons[2]=new playerWeapon('Missile Launcher','Missile Icon','Missile Launcher',false,true,false);
weapons[3]=new playerWeapon('Mine','Mine Icon','Mine',false,true,false);
weapons[4]=new playerWeapon('Shock Launcher','Shock Cube Icon','Shock Launcher',false,true,false);
weapons[5]=new playerWeapon('Machine gun','Ray Gun Icon','B',true,true,false);
weapons[6]=new playerWeapon('Ray Gun','Ray Gun Icon','Ray Gun',true,true,false);
If i remove the parts in blue:
Quote:Then it won't open at all, can't remember why.
// setup weapons
for (i=0;i!=weapons.length;i++) obj.weapon.add(weapons[i].name);
// in game, start without raygun
if (!map.setting.multiplayer) {
obj.weapon.hideSingle('Ray Gun',true);
}
}
//
// player spawing
//
function playerSpawn(obj)
{
// select the hammer and hide the raygun
// we need to pick up the raygun, we start with
// all other weapons
obj.weapon.setSelect(weapons[0].name);
obj.weapon.hideSingle('Ray Gun',true);
.
.