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 → Teleport cogish thing
Teleport cogish thing
2003-04-16, 2:34 PM #1
Hello again [http://forums.massassi.net/html/smile.gif] Im defying my own statement that i would NOT bother you for more cogs but..well ill ask anyway just to see if any nice people will answer.

I need a new type of teleport cog. I am aware of a startrek type cog on this site that does similar function but its parameters were complicated too me.

I would like a cog Activated by an object.
i dont want you to autoteleport when you enter the sector, Instead whenever the object is activated any players in the SPECIFIED sector will be teleported to a ghost position.
If possible have it so you can set a DELAY on how long it takes for it to activate the teleport when you hctivate the object.

i dont know how hard this is ...But thanks for trying for me!

------------------


[This message has been edited by sskakarot51 (edited April 16, 2003).]
2003-04-16, 3:46 PM #2
heres what i came up with.
because you wanted it to teleport anyone in a sector i had to use two cogs and a trigger.
Code:
# Written By DSLS_DeathSythe
flags=0x240
symbols
#=====
message   startup
message   activated
message   timer
message   trigger
thing     console=-1
flex      tele_wait=1.0
int       is_busy=0     local
#Trigs
int       tele_trig=1
#-----
end
#=====
code
#-----
startup:
  is_busy = 0;
return;
#-----
activated:
  if(is_busy == 1) return;
  SendTrigger(-1, tele_trig, 1, 0, 0, 0);
  SetTimer(tele_wait);
return;
#-----
trigger:
  if(GetSourceRef() != tele_trig) return;
  is_busy = GetParam(0);
return;
#-----
timer:
  SendTrigger(-1, tele_trig, 0, 0, 0, 0);
return;
#=====
end

that cog controls when the console is activated and the wait before teleporting.

this cog does the teleporting.
Code:
# Written By DSLS_DeathSythe
flags=0x240
symbols
#=====
message   trigger
sector    tele_sec
thing     destination=-1
sound     tele_snd=forcethrow01.wav
template  tele_tpl=+telesparks
thing     player=-1     local
#Trigs
int       tele_trig=1
#-----
end
#=====
code
#-----
trigger:
  if(GetSourceRef() != tele_trig) return;
  if(GetParam(0) != 0) return;
  player = GetLocalPlayerThing();
  if(GetThingSector(player) == tele_sec)
    {
    PlaySoundThing(tele_snd, player, 1.0, -1, -1, 0x40);
    CreateThing(tele_tpl, player);
    StopThing(player);
    TeleportThing(player, destination);
    PlaySoundThing(tele_snd, player, 1.0, -1, -1, 0x40);
    CreateThing(tele_tpl, player);
    return;
    }
return;
#=====
end

i tried to make them as simple as possible. just make sure that the tele_trig int is the same for both cogs but different from any other cogs using triggers. i havent tested these cogs but they should work. any questions or changes just ask.

------------------
Famous last words - "It seemed like a good idea at the time."
2003-04-17, 9:26 AM #3
IT doesnt work :/ i activate the console after setting the delay accordingly then i moved into the sector. i waited for about 10 seconds and it didint teleport.

Triggers are both the same number. Ive gotthe destination set, the sectorset and the console set :/ hmmmm

does "end" need to be in the middle of the cog?? i dont know much about it But would that cause a problem maybe?
------------------


[This message has been edited by sskakarot51 (edited April 17, 2003).]

[This message has been edited by sskakarot51 (edited April 17, 2003).]
2003-04-17, 2:16 PM #4
hmmm...
i just tried them out and they worked for me.
go through and double check to see if you have all the params right in jed. other than that i dont know what to do.

------------------
Famous last words - "It seemed like a good idea at the time."
2003-04-18, 5:40 AM #5
Well.. the console is outside of the teleport sector. theres a room with a console , computer panels and what not facing a teleport chamber. I activate the object then step into he transporter chamber but nothing happens. DO you need to stand IN the chamber and have someone else activate the switch?

------------------
2003-04-18, 6:04 AM #6
Hi!
I'm no good at inter COG communication but I've come up with 2 guesses on what's wrong.

1: When activating the console, the chamber already sees who's in. If no one's in, then return...

2: You copied the COG straight from the reply. That could be a problem. I did that once and I had to fill in the Spaces/Tabs.

I would say, do a Parsec check on the COG and if Parsec says there is nothing wrong with it, then you may continue complaining...

[This message has been edited by Edward (edited April 18, 2003).]
Edward's Cognative Hazards
2003-04-18, 9:07 AM #7
when i tested them i copied both cogs from what i had posted, then pasted them in cogwriter. then i made a real simple level that consisted of two sectors and a console, the console was not in the tele_sec. when i saved and tested it i activated the console the went into the tele_sec and after the tele_wait was up it teleported me to the destination.

how much time are you putting in the tele_wait? i tried it with 5 and 10 seconds. you need to give yourself enough time to get into the sector.

what program are you using to make the cogs?
when i made the ones i tested i just copied what i posted and put that directly into new files in cogwriter, i didnt change anything in the cogs.

Quote:
<font face="Verdana, Arial" size="2">Originally posted by Edward:
1: When activating the console, the chamber already sees who's in. If no one's in, then return...
</font>


when you activate the console all it does is send a trigger telling it that it was activated and makes it so it cant be activated until its done. when the timer runs out then it sends the trigger that checks who is in the sector and teleports them.
the teleport cog doesnt care about the first trigger sent.
so its not the #1 guess that Edward said.

------------------


[This message has been edited by DSLS_DeathSythe (edited April 18, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-04-20, 10:48 AM #8
I think i found the prob. im going to test it again , if theres a problem ill reply again.

------------------
2003-04-21, 8:13 AM #9
Any way to get it so that it only teleports the person who activated the object?

------------------
"You'll find life is full of surprises."
"You'll find life is full of surprises."
2003-04-21, 9:07 AM #10
Quote:
<font face="Verdana, Arial" size="2">Originally posted by EnsWaters:
Any way to get it so that it only teleports the person who activated the object?
</font>

yes there is but it would take some redoing of the cog. would you want it so the player still has to go into a teleport sector? or just have it teleport him right as he activates the console?

------------------
Famous last words - "It seemed like a good idea at the time."
2003-04-21, 9:35 AM #11
Okay, lets see if I got this correct. You want a teleport that moves the player to a ghost pos when they activate the corresponding thing with a short delay?
If that is true...
Code:
# Jedi Knight Cog Script
#
# TELEPORTER.COG
#
# When someone activates a thing, it gets teleported to a ghost. Eight things and ghosts.
#
# [DP]
#


symbols
thing       player                                 local
thing       spot
thing       spot1
thing       spot2
thing       spot3
thing       spot4
thing       spot5
thing       spot6
thing       spot7

int         dummy                                     local

thing      thing0                                 linkid=0
thing      thing1                                 linkid=1
thing      thing2                                 linkid=2
thing      thing3                                 linkid=3
thing      thing4                                 linkid=4
thing      thing5                                 linkid=5
thing      thing6                                 linkid=6
thing      thing7                                 linkid=7

template    sparks=+telesparks

sound       teleport=ForceThrow01.WAV               local
flex        delay=0.5
int         before=0
int         after=1

message     activated
message     timer

end

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

code
Activated:
player = GetSourceRef();
StopThing(player);
SetActorFlags(player, 0x240000);
SetTimerEx(delay, player, GetThingSignature(player), GetSenderID());
If(before) dummy = CreateThing(sparks, player); 
Return;

Timer:
If(GetThingSignature(GetSenderID()) != GetParam(0)) Return;
TeleportThing(player, spot[GetParam(1)]);
If(after) dummy = CreateThing(sparks, spot[GetParam(1)]); 
dummy = PlaySoundLocal(teleport, 1, 0, 0);
ClearActorFlags(player, 0x240000);
Return;
end

note - before is if you want to do the sparks before teleporting, after, is well, after.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited April 21, 2003).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-04-21, 2:27 PM #12
Cool, thanks!

------------------
"You'll find life is full of surprises."
"You'll find life is full of surprises."
2003-04-22, 10:39 AM #13
Um :/ when they activate the thing it is supposed to teleport whoever is in the assigned sector. Its a room with a console and an alcove with room forabout 4 people. the idea is to have the people who want to teleport step into the chamber then someone else preses the console from OUTSIDE teleporting everyone who is INSIDE. a startrekie type teleporter

------------------

↑ Up to the top!