Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → ok i need cog help
ok i need cog help
2001-03-02, 10:14 PM #1
ok...im new to cog editing/making so i need help...i want my cog to freeze the victim when it shoots...but everytime i shoot a victim it doesnt freeze them...but when i run out of ammo it freezes me...here is the cog...

fire:
player = GetSourceRef();
mode = GetSenderRef();

// Check that the player is still alive.
if(GetThingHealth(player) <= 0)
{
Return;
}

// Check Ammo - If we are out, autoselect best weapon.
// It should always use two energy cells, but -- as in DF --
// allow the last fire if there is only one left...
if(GetInv(player, 11) < 1.0)
{
PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
if((GetAutoSwitch() & 1))
SelectWeapon(player, AutoSelectWeapon(player, 1));
Return;
}
// Get random aiming error
randVec = VectorSet((Rand()-0.5)*5, (Rand()-0.5)*5, 0.0);

SetPOVShake('0.0 -.003 0.0', '1.5 0.0 0.0', .05, 80.0);
dummy = FireProjectile(player, projectile, fireSound, 8, '0.0168 0.1896 0.00', randVec, 1.0, 0x30, autoAimFOV, autoAimFOV*2);
// SetThingVel(dummy, vectorScale(GetThingVel(dummy), 0.01));

ChangeInv( player, 11, -2.0 );
jkPlayPOVKey( player, povfireAnim, 1, 0x38 );

powerBoost = GetInv(player, 63);
ChangeFireRate(player, fireWait/powerBoost);
holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
SetMountWait(player, holsterWait);
jkSetPOVModel(player, povModel);
jkPlayPOVKey(player, dismountAnim, 0, 0x18);

Return;

# ........................................................................................

activated:
player = GetSourceRef();
mode = GetSenderRef();

jkSetWaggle(player, '0.0 0.0 0.0', 0);
powerBoost = GetInv(player, 63);
ActivateWeapon(player, fireWait/powerBoost, mode);
Return;

# ........................................................................................

deactivated:
player = GetSourceRef();
jkSetWaggle(player, '10.0 7.0 0.0', 350);
DeactivateWeapon(player, mode);
Return;

# ........................................................................................

selected:
player = GetSourceRef();

PlayMode(player, 41);
PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);
TeleportThing(venom, player);
SetArmedMode(player, 1);
jkSetWeaponMesh(player, weaponMesh);
jkSetWaggle(player, '10.0 7.0 0.0', 350);
trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
SetMountWait(player, GetKeyLen(mountAnim));
jkClearFlags(player, 0x5);
SetCurWeapon(player, 3);

Return;

# ........................................................................................

deselected:
player = GetSourceRef();

PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
DamageThing(venom, 2e2, 0x1, player);
holsterWait = GetKeyLen(holsterAnim);
SetActorFlags(venom, 0xa00000);
venom = FirstThingInView(player, 107, 0x1, 0x404);
SetTimerEx(holsterWait, 2, 0.0, 0.0);
if (trackID != -1)
{
jkStopPOVKey(player, trackID, 0);
trackID = -1;
}
jkSetWaggle(player, '0.0 0.0 0.0', 0);

Return;

# ........................................................................................

autoselect:
player = GetSourceRef();

// If the player has the weapon
if(GetInv(player, 3) != 0.0)
{
// If the player has ammo
if(GetInv(player, 11) != 0.0)
{
ReturnEx(600.0);
}
else
{
ReturnEx(-1.0);
}
}
else
{
ReturnEx(-1.0);
}

Return;

# ........................................................................................

timer:
StopKey(player, holsterTrack, 0.0);
Return;

end


[This message has been edited by ESW_pLaGuE (edited March 03, 2001).]
2001-03-04, 3:05 PM #2
Where is your Symbols section?

------------------
Together we stand.
Divided we fall.

↑ Up to the top!