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 → Newbie Cogger need help...
Newbie Cogger need help...
2002-03-11, 1:04 PM #1
I'm writing a teleport cog that does the following: once you activate one of two switches it opens up two gates. Once you go through one it takes you to the other. (Note: I have just made it so you can only go through one side at the moment...)

Portal.cog
Code:
# Jedi Knight Cog Script
#
# portal.COG


symbols
surface portaf1
surface portaf2
surface protaf3
surface portaf4

surface switch
surface switch2

message startup
message activated
message crossed
thing teleport
end

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

code
startup:
player=GetLocalPlayerThing();
return;

activated:
SetFaceGeoMode(portaf1,4);
SetFaceGeoMode(portaf2,4);
SetFaceGeoMode(portaf3,4);
SetFaceGeoMode(portaf4,4);
Sleep(10);
SetFaceGeoMode(portaf1,0);
SetFaceGeoMode(portaf2,0);
SetFaceGeoMode(portaf3,0);
SetFaceGeoMode(portaf4,0);
return;

crossed:
geomode=GetFaceGeoMode();
if(geomode == 4)
{
TeleportThing(player, teleport);
}
return;
# ........................................................................................

end


The surfaces appear, however it doesn't teleport you. [http://forums.massassi.net/html/frown.gif]
Any ideas?

------------------
Script Warehouse
The Jedi's Saber

[This message has been edited by SG1_129 (edited March 11, 2002).]
2002-03-11, 1:31 PM #2
I see one prob...

geomode=GetFaceGeoMode();

You didnt specify which surface to check the GeoMode on..

I think you need it like:

geomode=GetFaceGeoMode(GetSenderRef());
- Wisdom is 99% experience, 1% knowledge. -
2002-03-11, 3:19 PM #3
When it sends me to the ghost position I'm stuck in a HOM. Also, once the surface flags off, the sky flags go into a HOM.

------------------
Script Warehouse
The Jedi's Saber
2002-03-12, 8:02 AM #4
Quote:
<font face="Verdana, Arial" size="2">When it sends me to the ghost position I'm stuck in a HOM.</font>


Most likey your teleport thing does not have the correct sector. When the player is teleported, he will be given the sector of the teleport thing. And if it's wrong, you'll get HOM.

Quote:
<font face="Verdana, Arial" size="2">Also, once the surface flags off, the sky flags go into a HOM.</font>


[http://forums.massassi.net/html/confused.gif] Perhaps you could elaborate?

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-03-13, 7:47 AM #5
1.)How do I chose the right sector?
2.)When I turn the switch on for the first time, the portal comes on. Once the surfaces disapear, the sky above me HOMs. However, whenever I activate the switch again, it stops HOMing, but when the portal closes, it HOMs again...

------------------
Script Warehouse
The Jedi's Saber
2002-03-14, 12:25 PM #6
*bump*

------------------
Script Warehouse
The Jedi's Saber
2002-03-14, 1:40 PM #7
Quote:
<font face="Verdana, Arial" size="2">How do I chose the right sector?</font>


There's a thing setting in JED for this. Enter the sector that your thing is in and see if that fixes it.

From what you said, it's hard to tell what your HOM problem is caused by. It could be a problem with the level settings, JED, or the cog verbs used. If you can't fix it, email the level to me and I'll take a look. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!