22.12.2008, 16:12 (Сообщение последний раз редактировалось: 22.12.2008, 16:14 Booyaka.)
Hi
What is wrong in this script ?
Код:
Script #Teleport1
(
if
(
IsEqual( GetLeverState(GetObject(1918)) , 1 ) // object to use to open teleport
)
then
(
KillScript( )
CreateParticleSource( 7, 142.8, 38.7, 1.5, 0.75, "Portal" ) // teleport animation
)
)
Script #Teleport2
(
if
(
IsLess( GetX( this ) , 135.6 )
IsLess( GetY( this ) , 30.39 )
IsGreater( GetX( this ) , 150.91 )
IsGreater( GetY( this ) , 45.83 )
IsEqual( GetLeverState(GetObject(1918)) , 1 )
)
then
(
KillScript( )
SwitchLeverState(GetObject(1918), 0 )
CreateParticleSource( GetObjectId( this ), GetX( this ), GetY( this ), GetZValue( GetX( this ), GetY( this ) ), 1, "Teleport" )
CreateFX( GetX( this ) , GetY( this ) , GetZValue( GetX( this ), GetY( this ) ), 15, 30, "Toolszombi.wav" )
CreateParticleSource( GetObjectId( GetObject(999451) ), GetX( GetObject(999451) ), GetY( GetObject(999451) ), GetZValue( GetX( GetObject(999451) ), GetY( GetObject(999451) ) ), -1, "Teleport" )
CreateFX( GetX( GetObject(999451) ) , GetY( GetObject(999451) ) , GetZValue( GetX( GetObject(999451) ), GetY( GetObject(999451) ) ), 15, 30, "magicTeleportstart.wav" )
Sleep( 15 )
SetCP( this, GetX( GetObject(999451) ) , GetY( GetObject(999451) ) , 0 )
ConsoleString("tp2 - Ok")
)
)
i need teleport to object 999451 location when i enter place:
Код:
(
IsLess( GetX( this ) , 135.6 )
IsLess( GetY( this ) , 30.39 )
IsGreater( GetX( this ) , 150.91 )
IsGreater( GetY( this ) , 45.83 )
IsEqual( GetLeverState(GetObject(1918)) , 1 )
)
can you tell me what is wrong in this scrip that it's not working ?
i look into one of ei-mod .mob file and i copied the teleport scrip from them and it's not working in my map :/
How do you execute this script? Where are your functions called from? What are you passing to #Teleport2 function as an argument?
And first of all, check your script on syntax. Add a ConsoleString() command to WorldScript(), and look at the console in the game. If the syntax is wrong, there would be no string in the console, and if it's right, the passed string should be printed.
Duty is everything, the greatest of joys, the deepest of sorrows.
#Teleport2 function is meant to get an argument when it is called. For example, you could write #Teleport2(GetLeader()) - then it would call function #Teleport2 with the Leader (aka Hero) as it's argument, so in the function's body "this" will be assumed as "Hero".
Calling #Teleport2(NULL) teleports a NULL-object somewhere, but NULL object is virtual, so you won't see anything changing. You should pass something to the #Teleport2 func.
If you want to teleport somebody, who had just switched the lever, you should call #Teleport2 in the #Teleport1 func, but you should get a target-object first. For example, you could determine who is near the Lever and teleport them all.
Duty is everything, the greatest of joys, the deepest of sorrows.
02.01.2009, 16:47 (Сообщение последний раз редактировалось: 02.01.2009, 16:51 Booyaka.)
Hi
Telepor is working ...
but now, another problem, this teleport is working only for server admin, not for other players, maybe u know why ?
Can u help me second time ?
Script:
Код:
GlobalVars (
NULL : object,
VSS#i#val : object,
i : object,
Heroes : group
)
DeclareScript VTriger#2#1 ( this : object )
DeclareScript #Teleport1 ( this : object )
DeclareScript #TeleportTarget ( this : object )
DeclareScript #Teleport2 ( this : object )
02.01.2009, 18:34 (Сообщение последний раз редактировалось: 02.01.2009, 18:35 ALtair.)
You call #TeleportTarget as soon as level starts, so there are no other clients on the map at that moment. If you want to teleport the overall Heroes party on some event, write a script, which will contain event-handling. For example, if you want to teleport the party when somebody switches a lever, write a script, which would check lever state and call #TeleportTarget routine when the lever state changes.
Duty is everything, the greatest of joys, the deepest of sorrows.