Hmmm still doesn't work. Blah. And I'm so close to having a cog that lets you drive a vehicle.
Here we go. I'm gonna scale it down to client/server later once its working.
I'll try to include the relavant stuff b/c
copying into this box doesn't work very well.
Lemme know if you would like to see the gob.
symbols
thing player local
thing vehicle linkid=1
thing weapon local
vector vehiclepos local
template atst
model vehicle3do
sector vehiclesector local
flex vehiclecog local
int oldweapon local
int oldhealth local
int atstflags local
int gun1 local
int gun2 local
int gun3 local
int gun4 local
int gun5 local
int gun6 local
int gun7 local
int gun8 local
int gun9 local
int gun10 local
int bacta local
int mana local
int prevweap local
message activated
message startup
message selected
end
# ========================================================================================
code
startup:
vehicletemplate=GetThingTemplate(vehicle);
vehiclecog=GetThingClassCog(vehicle);
vehiclepos=GetThingPos(vehicle);
vehiclesector=GetThingSector(vehicle);
return;
activated:
player = GetLocalPlayerThing();
if(GetSenderRef()==vehicle)
{
Print("You have entered an ATST!!");
DestroyThing(vehicle);
oldhealth = GetThingHealth(player);
oldweapon = GetCurWeapon(player);
SetInvActivated(player, 116, 1);
SelectWeapon(player, 1);
SetInvActivated(player, 119, 0);
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
SetThingHealth(player, 400);
ParseArg(player, "model3d=at.3do");
ParseArg(player, "maxhealth=400.00");
ParseArg(player, "health=400.00");
ParseArg(player, "puppet=atst.pup");
ParseArg(player, "soundclass=atst.snd");
ParseArg(player, "maxvel=0.400000");
ParseArg(player, "maxthrust=0.30");
ParseArg(player, "maxrotthrust=10.00");
//ParseArg(player, "jumpspeed=0.0");
//ParseArg(player, "eyeoffset=(0.300000/0.300000/0.000000)";
//ParseArg(player, "weapon=+lasercannon";
//ParseArg(player, "thingflags="0x4");
//Gun1 = GetInv(player, 1);
//Gun2 = GetInv(player, 2);
//Gun3 = GetInv(player, 3);
//Gun4 = GetInv(player, 4);
//Gun5 = GetInv(player, 5);
//Gun6 = GetInv(player, 6);
//Gun7 = GetInv(player, 7);
//Gun8 = GetInv(player, 8);
//Gun9 = GetInv(player, 9);
//Gun10 = GetInv(player, 10);
//bacta = GetInv(player, 40);
//mana = GetInv(player, 14);
//SetInv(player, 1, 0);
//SetInv(player, 2, 0);
//SetInv(player, 3, 0);
//SetInv(player, 4, 0);
//SetInv(player, 5, 0);
//SetInv(player, 6, 0);
//SetInv(player, 7, 0);
//SetInv(player, 8, 0);
//SetInv(player, 9, 0);
//SetInv(player, 10, 0);
SetInv(player, 40, 0);
SetInv(player, 14, 0);
//SetCurWeapon(player,0);
//SetThingFlags(vehicle,0x0);
}
else
if(IsInvActivated(player, 116) == 1)
{
ParseArg(player, "model3d=ky.3do");
ParseArg(player, "puppet=ky.pup");
ParseArg(player, "soundclass=ky.snd");
Print("Exiting Vehicle!");
ParseArg(player, "maxhealth=100.00");
ParseArg(player, "health=100.00");
ParseArg(player, "maxvel=0.400000");
ParseArg(player, "maxthrust=1.5");
ParseArg(player, "maxrotthrust=1.0");
ParseArg(player, "jumpspeed=2.0");
//SetInvActivated(player, 116, 0);
//SelectWeapon(player, oldweapon);
//SetThingHealth(player, oldhealth);
//Prevweap=GetCurWeapon(player);
//SetInv(player, 1, Gun1);
//SetInv(player, 2, Gun2);
//SetInv(player, 3, Gun3);
//SetInv(player, 4, Gun4);
//SetInv(player, 5, Gun5);
//SetInv(player, 6, Gun6);
//SetInv(player, 7, Gun7);
//SetInv(player, 8, Gun8);
//SetInv(player, 9, Gun9);
//SetInv(player, 10, Gun10);
//SetInv(player, 40, bacta);
//SetInv(player, 14, mana);
//SetCurWeapon(player,prevweap);
//SetThingFlags(vehicle,atstflags);
//SetThingClassCog(vehicle, vehiclecog);
CreateThing(atst,vehiclepos);
}
return;
selected:
return;
end
The long and short is. When you click on a thing it transforms your template into that thing. That part works. Turret Guns for this shouldn't be a problem. When I "get in" I destroy the ATST I activated, thus "becoming" the ATST. I can go reset the kyle template properties with the "Exit Vehicle" key i defined, that works. But for some reason right after that code I can't do a creatething of an atst at my player location.
I guess the question is can you create 2 things at the same position? If not, how would you go about getting past this.
I saw the bacta tank dispenser thing and thought I'd try that using a player
.(To try to put a bactatank at the players pos) But when I use player as the position it did nothing.
ARgghghghg. So close.
--==CWE_Darth_Opie==--
PS sorry i like to comment irrlevant stuff out that i've tried