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 → Blast my ship is in reverse.( need another way to go)
Blast my ship is in reverse.( need another way to go)
2000-11-28, 1:44 PM #1
Okay I wrote my cog but after teleporting to the ship sector and starting my timer.(Which ran rather long by my mistake of setting it to 500.) It then teleported me back to the first sector.

I am working on a fix to that now, So what I need to know is how do I send a message to another cog to change an int in it? Like say cog1.cog needs to change the int myint=0 in Cog2.cog to =1? can I do that?

thanks for any help in advance...

------------------
2000-11-28, 2:28 PM #2
I am posting my code here becuase I can't figure out why, but it keeps sending the player and ship back to the originol spots. I am burnt out so I am probabbly missing a minor detail... anyways Id appreciate it if someone could point out my mistake to me.

Code:
# Jedi Knight Cog Script
#
# new.COG
#
# Description
# 
#
# This Cog is Not supported by LucasArts Entertainment Co


symbols
 message             activated
 message             entered
 
 int                 shippos=0            local    

 
 sector              inship               

 flex                spacetime         
 
 thing               ship
 thing               shippos1
 thing               shippos2
 thing               ghost1
 thing               playerpos1
 thing               playerpos2
  
end                                                                           
code
activated:
if (GetSenderRef() = ship) {           // See if the ship is what was activated.

if (shippos = 0) {                       //check and see what position the ship is at.
   TeleportThing(GetSourceRef(), ghost1);     //if its at shippos1 then teleport it to the inship sector
   TeleportThing(ship(), shippos2);           // teleport the ship to its second position.
shippos = 1;                                  // set the shippos to its new shippos
}
else {
if (shippos = 1) {                            //else it will send the ship to the start position when activated
TeleportThing(GetSourceRef(), ghost1);
   TeleportThing(ship(), shippos1);

shippos = 0;
}
}
}

Entered:
sleep(spacetime);
  if (shippos = 1) {
      TeleportThing(GetSourceRef(), playerpos1);

}
else {
  if (shippos = 2) {
      TeleportThing(GetSourceRef(), playerpos2);
}
}
end



The notes are really shabby, but the general idea is stated and then repeated.

[This message has been edited by Loki (edited November 28, 2000).]
2000-11-29, 6:12 PM #3
Im really needed some help on this. if you know why this isn't working for me I would love to know... (Hehehe, im just trying to refresh my topic... I think you all missed it thinking the 1 reply was a solve?)
2000-11-30, 7:29 PM #4
The only problem I see is that you are using single equals signs in your if statements. A single eguals sets a variable, a double equals compares.

It should be like this:
if (shippos == 0)

Not this:
if (shippos = 0)


I hope this helps.

[This message has been edited by The Orkin Man (edited November 30, 2000).]

↑ Up to the top!