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 → I need help with Invasion! - Cogs
I need help with Invasion! - Cogs
2001-03-24, 6:45 AM #1
Any cogger who has some experience, does understand what this cog should do... it works in new MP levels, but it doesn't work with LEC levels...
Code:
# Jedi Knight Cog Script
#
# invbases.cog
#
# [Cave_Demon]
# 
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols
Thing		consol1		linkid=1
Thing		consol2		linkid=2
Thing		consol3		linkid=3
Thing		consol4		linkid=4
Thing		consol5		linkid=5
Thing		consol6		linkid=6
Thing		flag1
Thing		flag2
Thing		flag3
Thing		flag4
Thing		flag5
Thing		flag6
Model		red
Model		gold
Int		scoret=5	local
Int		team		local

Message	Activated


end

# ========================================================================================

code

# ........................................................................................
Activated:
if(GetSenderId() == 1 &&   GetPlayerTeam(player) == 1)
{
 SetThingModel(flag1, red);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 1 &&   GetPlayerTeam(player) == 2)
{
 SetThingModel(flag1, gold);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 2 &&   GetPlayerTeam(player) == 1)
{
 SetThingModel(flag2, red);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 2 &&   GetPlayerTeam(player) == 2)
{
 SetThingModel(flag2, gold);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 3 &&   GetPlayerTeam(player) == 1)
{
 SetThingModel(flag3, red);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 3 &&   GetPlayerTeam(player) == 2)
{
 SetThingModel(flag3, gold);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 4 &&   GetPlayerTeam(player) == 1)
{
 SetThingModel(flag4, red);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 4 &&   GetPlayerTeam(player) == 2)
{
 SetThingModel(flag4, gold);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 5 &&   GetPlayerTeam(player) == 1)
{
 SetThingModel(flag5, red);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 5 &&   GetPlayerTeam(player) == 2)
{
 SetThingModel(flag5, gold);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 6 &&   GetPlayerTeam(player) == 1)
{
 SetThingModel(flag6, red);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}
else
if(GetSenderId() == 6 &&   GetPlayerTeam(player) == 2)
{
 SetThingModel(flag6, gold);
SetPlayerScore(player, GetPlayerScore(player) + 5);
}

Return;
end



------------------
The death is smiling to all of us,
All what we can do, is smile back.
--
Also, visit my homepage, the Cave
WHAT?
2001-03-24, 6:55 AM #2
Well thats weird it looks like it should work. Well some absolute cog genius will come along and help ya since i can't. Because i see no errors in it.
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-03-24, 7:47 AM #3
Hmm... now it works like it should... almost...only prob is that: The base will always go to hosts team, the flag thing is used to show which team owns it, and it will always have the hosts team model...

------------------
The death is smiling to all of us,
All what we can do, is smile back.
--
Also, visit my homepage, the Cave

[This message has been edited by Cave_Demon (edited March 24, 2001).]
WHAT?
2001-03-24, 9:26 AM #4
well sorry i really am not one of the cog experts but i understand what u are trying to achieve but i don't see y it doesn't fuction right
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-03-24, 12:23 PM #5
You should put parentasis around the different statements in the if, and
shouldn't the else statements have brackets? I'm not sure if these are required or if they are just organizational things I do but I would write the cog like this:

Code:
if((GetSenderID() == 1) && (GetPlayerTeam(player)==1))
{
    SetThingModel(flag1,red);
    SetPlayerScore(player, GetPlayerScore(player) + 5);
    SynchScores(); //Make sure everyone's scores are updated
}
else
{ //open bracked on else
     if((GetSenderID()==1) && (GetPlayerTeam(player)==2))
     {
          SetThingModel(flag1,red);
          SetPlayerScore(player, GetPlayerScore(player) + 5);
          SynchScores(); //Make sure everyone's scores are updated
     }
     else
     {
         //ETC ETC


Not sure, but thats all the problems I see.
2001-03-24, 4:35 PM #6
It doesnt look like your defining the 'player' anywhere. Dont you need a
player = GetSourceRef(); or player = GetLocalPlayerThing(); Depending on how your cog is setup. If you 'player' isnt defined correctly JK will assume player = 0; which happenes to be the HOST's id for all LEC levels.
- Wisdom is 99% experience, 1% knowledge. -

↑ Up to the top!