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 → Will this work?
Will this work?
2001-05-13, 4:38 PM #1
Will this cog work it should be self explanatory

Code:
#JK COG YIPEE!!
#[Han5687]
#Top secret cog for level
#[may 13 9:41 pm 2001]

symbols
thing player local
thing bot1  
thing bot2
thing bot3
thing bot4
thing bot5
model bot1 
model bot2
model bot3
model bot4
model bot5
sector bot1 linkid=1
sector bot2 linkid=2
sector bot3 linkid=3
sector bot4 linkid=4
sector bot5 linkid=5
message entered
end
# =======================================
code
entered:
player=jkGetLocalPlayerThing;
  if (GetSourceRef==player)
    {
  if (GetSenderID() == 1)
    {
  SetThingModel(player,bot1);  
  TeleportThing(player,bot1);
    }
  else if (GetSenderID() == 2)
    {
  SetThingModel(player,bot2);  
  TeleportRhing(player,bot2);
    }
  else if (GetSenderID() == 3)
    {
  SetThingModel(player,bot3);  
  TeleportRhing(player,bot3);
    }
  else if (GetSenderID() == 4)
    {
  SetThingModel(player,bot4);  
  TeleportRhing(player,bot4);
    }
  else if (GetSenderID() == 5)
    {
  SetThingModel(player,bot5);  
  TeleportRhing(player,bot5);
    }
  }
 return;
 end



------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-05-13, 7:23 PM #2
Well for one , I don't think the Getsenderid , should be there for any reason , because it's saying if the person is entering == player , then do the stuff else don't do it , then you go onto say if linkid = bot3 ... do stuff , so i suggest you just make a link cog from the bot ...

and lastly , it's Teleportthing(player, bot3);

|

not Teleportring [http://forums.massassi.net/html/smile.gif]
2001-05-14, 9:27 AM #3
It looks to me like he is using the GetSenderId to find out which sector the player entered, then change the player to the appropriate bot for the sector. So it makes sense to me.

I'm wondering though, does the cog keep straight these variable names if you have a thing, a model, and a sector reference all called bot1?? Wouldn't it be better to use different names for the thing, model, and sector -- not use bot1 for all three but something like: bot1, model1, sector1 etc. ?

------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-05-14, 5:07 PM #4
Okay so this should work aside from the teleportring. and i think it makes perfect sense but i am the one who wrote it so i should think it works. I think it should keep them straight because they are all different things like model, thing, sector, so it should have them all register different according to the verb. I will change it to be on the safe side though. Thanks

------------------
Join the army,
Visit new places,
Meet new people,
Then drop bombs on them
roses are red, violets are blue, I am schizophrenic, and I am too!

↑ Up to the top!