Jump to content

Teleporting


liteluvr
 Share

Recommended Posts

I'm pretty new to GR scripting other than the basic stuff, but I've got an idea I'm wanting to work on... I need to be able to create a pair of zone on a map, and teleport a player between the zones, ie, teleport from zone 1 to zone 2, and back again.

I've played a mod that does something like this, but I can't seem to figure it out in IGOR.

I'm sure it's something simple, and I'm just overlooking it....

Any help would be appreciated!

Thanks,

:blink:

Link to comment
Share on other sites

Use the TeleportObject function and use the query (lower most edit button) to get the player controlled actor.

A couple of things to watch for. The Igor Scripting reference warns against teleporting objects between different map rooms (you can view map rooms by selecting it the View menu and\or clicking on them in the Rooms menu on the right hand side in Igor). In actual fact you can often do it without any problem. However, if you do have any problems that would the first area to suspect.

The other thing is that if you are teleporting a single object like the player actor, then it may be better to teleport to an Effect than a Zone. If you need to use a Zone ensure that it doesn't encompass any areas that are 'Out of Bounds' or you may get random crashes.

Cheers, Jack :rocky:

Link to comment
Share on other sites

Jack,

Thanks for the info. I'm sure I'm doing something wrong, because I can't get the #&$^ thing to work... :angry:

Here's the script as it stands so far. There's nothing to the mission yet other than trying to make the teleport happen:

Group: <Default>

Comment:

Trigger Event:

The simulation is starting.

Responses:

Set (The player-controlled platoon) to PlayerPlatoon.

Group: <Default>

Comment:

Teleport Actor

Trigger Event:

teleported_actor is within 1 meter(s) of Bunker Effect.

Responses:

Allow this block to be reactivated.

Teleport (The actor nearest Bunker Effect) to HighGroundEffect.

The Bunker Effect is inside a building (withing the play boundaries) and the HighGroundEffect is outside, but also withing game boundaries.

Any thoughts? I'm sure it's something simple I'm just not seeing.

Thanks,

Edited by liteluvr
Link to comment
Share on other sites

Okay... bear with me...

:wall:

:stupid:

I tweaked the script...:

Group: <Default>

Comment:

Trigger Event:

The simulation is starting.

Responses:

Set Player_Platoon to (The player-controlled platoon).

Group: <Default>

Comment:

Teleport Actor

Trigger Event:

teleported_actor is within 1 meter(s) of Bunker Effect.

Responses:

Allow this block to be reactivated.

Teleport teleported_actor to HighGroundEffect.

Group: <Default>

Comment:

Set teleported_player

Trigger Event:

A member of Player_Platoon is within 1 meter(s) of Bunker Effect.

Responses:

Allow this block to be reactivated.

Set (The actor nearest Bunker Effect) to teleported_actor.

Am I just making this too hard?

:blink:

Link to comment
Share on other sites

No joy...

I added this:

Trigger Event:

The simulation is starting.

Responses:

Set Player_Platoon to (The player-controlled platoon).

Set teleportedactor to (The player-controlled actor)

I started the mission, then ran to where the effect zone is. No luck.

Maybe I should back up a step and explain what it is I *want* to do....

I want to create a MP scenario where there is a distinct zone (point A) on the map that will transport the nearest player to a destination zone (point B) each time a player is within x meters of the transport zone.

This would work for all teams, all players. Obviously there needs to be a reverse teleport from point B back to point A.

My thought was to set a variable to the nearest actor each time a player gets close to the teleport point, then do the teleport thing.

Or am I barking up the wrong tree?

:wall::wall::wall:

Thanks for the help / patience Stalker and Jack

Link to comment
Share on other sites

No joy...

I added this:

Trigger Event:

The simulation is starting.

Responses:

Set Player_Platoon to (The player-controlled platoon).

Set teleportedactor to (The player-controlled actor)

I started the mission, then ran to where the effect zone is. No luck.

Maybe I should back up a step and explain what it is I *want* to do....

I want to create a MP scenario where there is a distinct zone (point A) on the map that will transport the nearest player to a destination zone (point B) each time a player is within x meters of the transport zone.

This would work for all teams, all players. Obviously there needs to be a reverse teleport from point B back to point A.

My thought was to set a variable to the nearest actor each time a player gets close to the teleport point, then do the teleport thing.

Or am I barking up the wrong tree?

:wall::wall::wall:

Thanks for the help / patience Stalker and Jack

have you tested it in mp??

cause this will only work for the playercontrolled actor in sp :wacko:

Link to comment
Share on other sites

Setting a variable to the player controlled actor at startup won't work if the player switches avatar. If it's for SP and the player controlled actor you want to teleport, then do it like I said above.

Group: <Default>

Comment:

Trigger Event:

A member of PlayerPlatoon is within 10 meter(s) of ThisLocation.

Responses:

Continue executing responses if (The game mode is Single Player).

Allow this block to be reactivated.

Continue executing responses if ((The actor nearest ThisLocation) is equal to (The player-controlled actor)).

Teleport (The player-controlled actor) to NewLocation.

<use BlockRemove here if you only want it to happen once>

If it's for MP and you want any player teleported:

Group: <Default>

Comment:

Trigger Event:

A member of PlayerPlatoon is within 10 meter(s) of ThisLocation.

Responses:

Continue executing responses if (The game mode is Team\Coop).

Allow this block to be reactivated.

Continue executing responses if ((The platoon including (The actor nearest ThisLocation)) is equal to PlayerPlatoon).

Teleport (The actor nearest ThisLocation) to NewLocation.

<use BlockRemove here if you only want one actor teleported>

Remember - KISS,

Jack ;)

Link to comment
Share on other sites

Jack, that second one did the trick....

One last question....

How do I take a mission and make it available as a server-side team mission?

I want to make this a CTF type mission where whoever controls the teleport effectively controls the game...

Thanks to you and Stalker both for the assist on this.

:D:D:D

Link to comment
Share on other sites

If it's a gtf and resides in the GR origmiss\mission folder (or MP1 or MP2 if they are required) and doesn't call any custom objects or actors in the script then it should work serversided.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...