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 → Goa'uld Teleporter cog (Cave_Demon PLEASE READ)
Goa'uld Teleporter cog (Cave_Demon PLEASE READ)
2001-07-27, 10:35 AM #1
Right. I had a brainwave the other day. I thought, "Why should'nt I do a cog that emulates the Goa'uld teleporter from Stargate. I know why... because I don't know very much cog."

Now, the reason Cavey has to read this is because I used the idea from his funky teleporter. THe one with the camera changing etc. Very nice cog, Btw.

Well, here is the current version of the cog that I have done, I'm just going to implement it into a test level and see if it works. If there are any errors that you can see and that stand out like the lights on an ambulance then please tell me how I can fix them. Thanx all and especially thanx Cavey.

<edit - updated cog 1st>
<edit - updated cog 2nd>
<edit - updated cog with WORKING version!>
<edit - updated cog below so less scrolling on this page! arnt I nice?>
[This message has been edited by Nomi (edited July 27, 2001).]

[This message has been edited by Nomi (edited July 27, 2001).]

[This message has been edited by Nomi (edited July 27, 2001).]

[This message has been edited by Nomi (edited July 27, 2001).]
2001-07-27, 1:04 PM #2
I'm doing an sg1 level , the old one had this simple cog:


# Moves a camera around when an adjoin is crossed
#
#
# Modified from Dak's camera script
# Modified further from Antony's script
#


symbols
thing ringglow0
thing ringglow1
thing door0 desc=door_object
thing door1 desc=door_object
thing door2 desc=door_object
thing door3 desc=door_object
thing door4 desc=door_object
thing door0a desc=door_object
thing door1a desc=door_object
thing door2a desc=door_object
thing door3a desc=door_object
thing door4a desc=door_object
thing gotospot
surface plate0 desc=plate0
flex movespeed desc=movespeed_of_door
flex delay=3.0 desc=delay_before_close

int doorsector=-1 local
int player local

sound zapsound

message startup
message activated
message entered
message timer

end

code

startup:

doorsector = GetThingSector(door);
SectorAdjoins(doorsector, 0);

Return;

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

entered:
activated:
if(IsMoving(door)) Return;
if(GetCurFrame(door) == 1) Return;

player=GetLocalPlayerThing();


SectorAdjoins(doorsector, 1);
//SetTimerEx(0.2, 1, 0, 0);
//SetTimerEx(0.4, 1, 0, 0);

SetThingLight(ringglow0, 1, 1);
SetThingLight(ringglow1, 1, 1);

MovetoFrame(door0, 1, movespeed);
MovetoFrame(door0a, 1, movespeed);
Sleep(0.4);
MovetoFrame(door1, 1, movespeed);
MovetoFrame(door1a, 1, movespeed);
Sleep(0.4);
MovetoFrame(door2, 1, movespeed);
MovetoFrame(door2a, 1, movespeed);
Sleep(0.4);
MovetoFrame(door3, 1, movespeed);
MovetoFrame(door3a, 1, movespeed);
Sleep(0.4);
MovetoFrame(door4, 1, movespeed);
MovetoFrame(door4a, 1, movespeed);


if(delay == -1.0) Return;
Sleep(delay);


StopThing(player);
PlaySoundLocal(zapsound, 1.0, 0, 0);
TeleportThing(player, gotospot);

sleep(1);

MovetoFrame(door4, 0, movespeed);
MovetoFrame(door4a, 0, movespeed);
Sleep(0.4);
MovetoFrame(door3, 0, movespeed);
MovetoFrame(door3a, 0, movespeed);
Sleep(0.4);
MovetoFrame(door2, 0, movespeed);
MovetoFrame(door2a, 0, movespeed);
Sleep(0.4);
MovetoFrame(door1, 0, movespeed);
MovetoFrame(door1a, 0, movespeed);
Sleep(0.4);
MovetoFrame(door0, 0, movespeed);
MovetoFrame(door0a, 0, movespeed);


SetThingLight(ringglow0, 0, 0);
SetThingLight(ringglow1, 0, 0);

SectorAdjoins(doorsector, 0);

Return;

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

timer:
SectorAdjoins(doorsector, 1);
Return;

end

thus it activates when you step on the surface. To make the sounds work you just edit any soundclass of the door into that of the rings...

It worked for me.
Also, something you could add is some sort of sprite of a bright light when they get teleported, all I have is a ghost light.

Ps, have you got the proper sounds for the gates!!??? [http://forums.massassi.net/html/smile.gif]
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}
2001-07-27, 1:56 PM #3
I've done a lot more to the cog now, Ive added the 8 hatches, "zooming" cameras and Unistring prints.

# Jedi Knight Cog Script
#
# goauldtele v4.1.cog
#
# Teleport cog that emulates the teleporters in Stargate
#
#
# -•?O( VERSION 4.1 )O?•-
#
# ------------------
# Improvements in v4.1
# Added string printing and camera sets back to original
# ------------------
# Improvements in v4
# Added moving cameras
# ------------------
# Improvements in v3
# Tweaked timing of movements and added hatches
# ------------------
# Improvements in v2
# Added delay so as to prevent people following in behind,
# and an active message to stop reactivation whilst in use.
# ------------------
#
#
# Made by Nomi, with thanks to Cave_Demon for the original
# cog from which I learnt to do teleporting and camera
# changing. Cheers Cavey [http://forums.massassi.net/html/smile.gif]
#
# This COG is not made or supported by LEC
#
# [RS]
#
#--------------------------------------------------------

Symbols

thing switch linkid=1

thing source
thing destination
thing storage

thing cameraS
thing cameraD

thing player local

sound startsound
sound endsound

thing ring1 linkid=2
thing ring2 linkid=2
thing ring3 linkid=2
thing ring4 linkid=2

thing ring5 linkid=2
thing ring6 linkid=2
thing ring7 linkid=2
thing ring8 linkid=2

thing hatch11 linkid=2
thing hatch12 linkid=2
thing hatch13 linkid=2
thing hatch14 linkid=2
thing hatch15 linkid=2
thing hatch16 linkid=2
thing hatch17 linkid=2
thing hatch18 linkid=2

thing hatch21 linkid=2
thing hatch22 linkid=2
thing hatch23 linkid=2
thing hatch24 linkid=2
thing hatch25 linkid=2
thing hatch26 linkid=2
thing hatch27 linkid=2
thing hatch28 linkid=2

template telesparks=+firecloud

flex speed=3.0
flex delay=1.0
flex unistring1 desc=startstring
flex unistring2 desc=endstring

int active=0 local
int origcam local

message activated

end

#--------------------------------------------------------

code

activated:

if(GetSenderID() != 1) Return;

if(active) return;
active = 1;

player = GetSourceRef();
origcam = GetCurrentCamera();

Sleep(0.1);
SetActorFlags(jkGetLocalPlayer(), 0xa00000);
SetCameraFocus(1, cameraS);
SetCurrentCamera(1);
jkPrintUNIString(player, unistring1);
Sleep(0.5);

MoveToFrame(hatch11, 1, 5);
MoveToFrame(hatch12, 1, 5);
MoveToFrame(hatch13, 1, 5);
MoveToFrame(hatch14, 1, 5);
MoveToFrame(hatch15, 1, 5);
MoveToFrame(hatch16, 1, 5);
MoveToFrame(hatch17, 1, 5);
MoveToFrame(hatch18, 1, 5);
Sleep(1);

MoveToFrame(CameraS, 1, 2);

MoveToFrame(ring1, 1, speed+3);
Sleep(0.25);
MoveToFrame(ring2, 1, speed+2);
Sleep(0.25);
MoveToFrame(ring3, 1, speed+1);
Sleep(0.25);
MoveToFrame(ring4, 1, speed);

Sleep(2);

TeleportThing(source, player);
TeleportThing(player, storage);
CreateThing(telesparks, source);
Sleep(0.05);
CreateThing(telesparks, source);
PlaySoundThing(startsound,cameraS,9,9,9,0x1000);

MoveToFrame(ring4, 0, speed);
Sleep(0.25);
MoveToFrame(ring3, 0, speed+1);
Sleep(0.25);
MoveToFrame(ring2, 0, speed+2);
Sleep(0.25);
MoveToFrame(ring1, 0, speed+3);
Sleep(1);

MoveToFrame(hatch11, 0, 5);
MoveToFrame(hatch12, 0, 5);
MoveToFrame(hatch13, 0, 5);
MoveToFrame(hatch14, 0, 5);
MoveToFrame(hatch15, 0, 5);
MoveToFrame(hatch16, 0, 5);
MoveToFrame(hatch17, 0, 5);
MoveToFrame(hatch18, 0, 5);

Sleep(1);
SetCameraFocus(1, cameraD);
SetCurrentCamera(1);
Sleep(0.5);

MoveToFrame(hatch21, 1, 5);
MoveToFrame(hatch22, 1, 5);
MoveToFrame(hatch23, 1, 5);
MoveToFrame(hatch24, 1, 5);
MoveToFrame(hatch25, 1, 5);
MoveToFrame(hatch26, 1, 5);
MoveToFrame(hatch27, 1, 5);
MoveToFrame(hatch28, 1, 5);

MoveToFrame(CameraD, 1, 2);

Sleep(1);
MoveToFrame(ring5, 1, speed+3);
Sleep(0.25);
MoveToFrame(ring6, 1, speed+2);
Sleep(0.25);
MoveToFrame(ring7, 1, speed+1);
Sleep(0.25);
MoveToFrame(ring8, 1, speed);
Sleep(2);

jkPrintUNIString(player, unistring2);
CreateThing(telesparks, destination);
Sleep(0.05);
CreateThing(telesparks, destination);
PlaySoundThing(endsound,cameraD,9,9,9,0x1000);
Sleep(0.01);
TeleportThing(player, destination);

MoveToFrame(ring8, 0, speed);
Sleep(0.25);
MoveToFrame(ring7, 0, speed+1);
Sleep(0.25);
MoveToFrame(ring6, 0, speed+2);
Sleep(0.25);
MoveToFrame(ring5, 0, speed+3);
Sleep(1);

SetCameraFocus(1, player);
SetCurrentCamera(origcam);
ClearActorFlags(jkGetLocalPlayer(), 0xa00000);

MoveToFrame(hatch21, 0, 5);
MoveToFrame(hatch22, 0, 5);
MoveToFrame(hatch23, 0, 5);
MoveToFrame(hatch24, 0, 5);
MoveToFrame(hatch25, 0, 5);
MoveToFrame(hatch26, 0, 5);
MoveToFrame(hatch27, 0, 5);
MoveToFrame(hatch28, 0, 5);

MoveToFrame(CameraS, 0, 20);
MoveToFrame(CameraD, 0, 20);

Sleep(delay);
active=0;

Return;

#--------------------------------------------------------

end


Ruthervain, youre doing the Stargate mod for JK, arnt you?

Ps. I've also got a working test level for this. Looks pretty damn good.

Nomi
2001-07-27, 2:06 PM #4
If you want the test level, anyone, email me at nomi@geomax.idps.co.uk or contact me on the zone (TSA_Nomi)
2001-07-29, 7:51 AM #5
Ahh... long time since i last time visited cog forum...
So, does this cog work now? [http://forums.massassi.net/html/smile.gif]
If it doesn't, then i have to find out what it does, by actually reading the cog [http://forums.massassi.net/html/biggrin.gif] and we don't want that, do we? [http://forums.massassi.net/html/wink.gif]

------------------
Women... Can't live with them, Can't shoot them...
WHAT?

↑ Up to the top!