Hello. I am struggling with Cog code...and I need help. This cog will drop powerup weapons in ghost positions when activated. The problem I am encountering is, although all players can see the powerups...ONLY THE HOST can pick them up cand use them. Here is the server and client cog...followed by the templates relevant to the cog...
# Jedi Knight Cog Script
#
# RaildetServer.COG
#
# This will generate a series of rails per 'round' when the switch is activated.
# The trap resets in 'delay' seconds afterwards. Server side.
# Originally a thermal detonater cog edited by Jimanatore.
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
surface switch desc=switch
thing console desc=console
flex totaltime=8.0 // 4 * rate * rounds + delay + 0.05
int active=0 local
int trapID
message activated
message timer
end
# ========================================================================================
code
activated:
if(active == 1) Return;
active = 1;
// Send a TRIGGER_f.destructions with its parameters
SendTrigger(-1, 11001 + trapID, GetThingGuid(GetSourceRef()), 0, 0, 0);
SetTimer(totalTime);
Return;
# ........................................................................................
timer:
active = 0;
Return;
end
# Jedi Knight Cog Script
#
# RailtrapClient.cog
#
# This will generate a series of 10 rails per 'round' when the switch is activated.
# The trap resets in 'delay' seconds afterwards. Client side.
# Originally a thermal detonator trap editied by Jimanatore
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
flags=0x240
symbols
surface switch desc=switch
thing console desc=console
thing fdest1 nolink,desc=fdest1
thing fdest2 nolink,desc=fdest2
thing fdest3 nolink,desc=fdest3
thing fdest4 nolink,desc=fdest4
thing fdest5 nolink,desc=fdest5
thing fdest6 nolink,desc=fdest6
thing fdest7 nolink,desc=fdest7
thing fdest8 nolink,desc=fdest8
int rounds=4 desc=rounds
int trapID
flex rate=0.01 desc=rate
flex delay=0.5 desc=delay
int cur_round=0 local
int dummy local
template proj_tpl=+Theconcrifle local
sound on_snd=set_hi2.wav local
sound off_snd=lgclick1.wav local
message trigger
end
# ========================================================================================
code
trigger:
// Handle only f_destructiontrap
if(GetSourceRef() != 11001 + trapID) Return;
dummy = SetWallCel(switch, 1);
dummy = PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
cur_round = 0;
while(cur_round < rounds)
{
dummy = CreateThing(proj_tpl, fdest1);
// give it the correct parent via the parent's guid passed in the trigger this
// is essential to credit the kill to the guy who activated the switch..
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest2);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest3);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest4);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest5);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest6);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest7);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest8);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
cur_round = cur_round + 1;
}
Sleep(delay);
dummy = SetWallCel(switch, 0);
dummy = PlaySoundPos(off_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
Return;
end
# DESC: RailGun Pickup
# BBOX: -.018484 -.070714 -.030025 .019883 .081826 .013227
+Therailgun _powerup2 timer = 8.0000 thingflags=0x400 model3d=rldp.3do cog=pow_railgun.cog respawn = 0.000000
# DESC: Concussion Rifle Pickup
# BBOX: -.030347 -.072704 -.024787 .009211 .072704 .024341
+Theconcrifle _powerup2 timer = 8.0000 thingflags=0x400 model3d=conp.3do cog=pow_concrifle.cog respawn = 0.000000
# DESC:
# BBOX: 0 0 0 0 0 0
_powerup2 none timer = 8.0000 orient=(0.000000/0.000000/0.000000) type=item collide=1 move=physics size=0.100000 movesize=0.010000 surfdrag=3.000000 airdrag=1.000000 mass=10.000000 height=0.050000 physflags=0x400000 angvel=(45.000000/45.000000/45.000000) typeflags=0x1 respawn=0.000000
# Jedi Knight Cog Script
#
# RaildetServer.COG
#
# This will generate a series of rails per 'round' when the switch is activated.
# The trap resets in 'delay' seconds afterwards. Server side.
# Originally a thermal detonater cog edited by Jimanatore.
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
surface switch desc=switch
thing console desc=console
flex totaltime=8.0 // 4 * rate * rounds + delay + 0.05
int active=0 local
int trapID
message activated
message timer
end
# ========================================================================================
code
activated:
if(active == 1) Return;
active = 1;
// Send a TRIGGER_f.destructions with its parameters
SendTrigger(-1, 11001 + trapID, GetThingGuid(GetSourceRef()), 0, 0, 0);
SetTimer(totalTime);
Return;
# ........................................................................................
timer:
active = 0;
Return;
end
# Jedi Knight Cog Script
#
# RailtrapClient.cog
#
# This will generate a series of 10 rails per 'round' when the switch is activated.
# The trap resets in 'delay' seconds afterwards. Client side.
# Originally a thermal detonator trap editied by Jimanatore
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
flags=0x240
symbols
surface switch desc=switch
thing console desc=console
thing fdest1 nolink,desc=fdest1
thing fdest2 nolink,desc=fdest2
thing fdest3 nolink,desc=fdest3
thing fdest4 nolink,desc=fdest4
thing fdest5 nolink,desc=fdest5
thing fdest6 nolink,desc=fdest6
thing fdest7 nolink,desc=fdest7
thing fdest8 nolink,desc=fdest8
int rounds=4 desc=rounds
int trapID
flex rate=0.01 desc=rate
flex delay=0.5 desc=delay
int cur_round=0 local
int dummy local
template proj_tpl=+Theconcrifle local
sound on_snd=set_hi2.wav local
sound off_snd=lgclick1.wav local
message trigger
end
# ========================================================================================
code
trigger:
// Handle only f_destructiontrap
if(GetSourceRef() != 11001 + trapID) Return;
dummy = SetWallCel(switch, 1);
dummy = PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
cur_round = 0;
while(cur_round < rounds)
{
dummy = CreateThing(proj_tpl, fdest1);
// give it the correct parent via the parent's guid passed in the trigger this
// is essential to credit the kill to the guy who activated the switch..
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest2);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest3);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest4);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest5);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest6);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest7);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
dummy = CreateThing(proj_tpl, fdest8);
SetThingParent(dummy, GetParam(0));
Sleep(rate);
cur_round = cur_round + 1;
}
Sleep(delay);
dummy = SetWallCel(switch, 0);
dummy = PlaySoundPos(off_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
Return;
end
# DESC: RailGun Pickup
# BBOX: -.018484 -.070714 -.030025 .019883 .081826 .013227
+Therailgun _powerup2 timer = 8.0000 thingflags=0x400 model3d=rldp.3do cog=pow_railgun.cog respawn = 0.000000
# DESC: Concussion Rifle Pickup
# BBOX: -.030347 -.072704 -.024787 .009211 .072704 .024341
+Theconcrifle _powerup2 timer = 8.0000 thingflags=0x400 model3d=conp.3do cog=pow_concrifle.cog respawn = 0.000000
# DESC:
# BBOX: 0 0 0 0 0 0
_powerup2 none timer = 8.0000 orient=(0.000000/0.000000/0.000000) type=item collide=1 move=physics size=0.100000 movesize=0.010000 surfdrag=3.000000 airdrag=1.000000 mass=10.000000 height=0.050000 physflags=0x400000 angvel=(45.000000/45.000000/45.000000) typeflags=0x1 respawn=0.000000