Jump to content
  • 0

Warp in Warp out.


Cephaler

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  132
  • Reputation:   2
  • Joined:  02/02/12
  • Last Seen:  

Guys, I know it might be easy due to you godlike scripting skills, but if you could help a poor newbie i'd appreciate!

I'd like something like:

1: Custom item, player clicks on the item and is warped to a desired map

2: When the players arrives in the map, a countdown of x minutes start ( I'd like something around 10 minutes )

3: Once it reaches the time, it gets warped back to the savepoint.

Thanks ;)

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  297
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

well if you're asking for a custom item as invoker of that, there must be some src mod needed to this.

i used to want to have a similar thing, then i ended up giving up on it just because i'm a noob at src and scripting.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  132
  • Reputation:   2
  • Joined:  02/02/12
  • Last Seen:  

well if you're asking for a custom item as invoker of that, there must be some src mod needed to this.

i used to want to have a similar thing, then i ended up giving up on it just because i'm a noob at src and scripting.

Why is there a difference between custom/normal item? Also is there a normal item currently doing that o_o?

I honestly don't mind much the catalyst, but more the function of warping, 10 minutes after warping out.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

Guys, I know it might be easy due to you godlike scripting skills, but if you could help a poor newbie i'd appreciate!

I'd like something like:

1: Custom item, player clicks on the item and is warped to a desired map

2: When the players arrives in the map, a countdown of x minutes start ( I'd like something around 10 minutes )

3: Once it reaches the time, it gets warped back to the savepoint.

Thanks ;)

im no pro, but try this..

made it from scratch.. actually, its my 1st script /whisp

if it doesn't work i will make another one /ok


prontera,155,185,4 script ItemWarp 801,{

OnTouch:
mapwarp .Map$,"sec_in02",37,177;
announce "You are warped to another realm";
}
OnMinute10:
mapwarp .Map$,"prontera",155,185;
announce "what the @#$! happened?";
end;
}

Edited by stydianx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

callfunc warpinout; //<-- put in item
function	script	warpinout	{
warp "mapname",0,0;
sleep2 600000;
if(strcharinfo(3) != "mapname"){end;}
warp "savepoint",0,0;
end;
}

Edit: Made the changes to check for the map, but i didn't add the getmapxy, since the request was for savepoint.

Edited by GmOcean
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I like your script GmOcean. I suggest you put a check in after the sleep2 to check if the player is still on the same map. If they die and go back to their savepoint early, it shoud prevent warping them back to their savepoint when the time is up. Also you could use a getmapxy to return them to their original location instead of their savepoint if you want to.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

However, you should know the script is flawed... for example... if they leave and reenter, i can't stop it from warping out.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I already thought of that but if you have to have the item to warp to the map then it will require another item to come back anyway. That then resets the timer.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

However, you should know the script is flawed... for example... if they leave and reenter, i can't stop it from warping out.

You'd need to attach a timer for this, with a new/reset timer upon map warp. 'awake' won't work for a specific instance, unfortunately.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  132
  • Reputation:   2
  • Joined:  02/02/12
  • Last Seen:  

Thanks everyone, it worked brilliantly. Just one observation: When I used " savepoint" the map server would send me an error saying the mapindex could not locate " savepoint " as a valid map. So i changed it to our maintown map name and it worked fine.

Thanks a lot all of you ;)!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

@Euphy - Yea, I noticed that, but, timer's are just so.... ugly, i'd like to not use em if i could lolz..., i could however, use gettimetick and still use sleep2....

function    script    warpinout    {
set warpinout,gettimetick(2) + 600000;
warp "mapname",0,0;
sleep2 600000;
if(strcharinfo(3) != "mapname" || gettimetick(2) < warpinout){end;}
set warpinout,0;
warp "SavePoint",0,0;
end;
}

This way, everytime they re-enter, it'll change the variable to 10mins from the current time, that way, when the older sleep2 checks, it'll be eariler then the new time... so nothing should happen.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

actually I only use sleep2 if the timer is low, like pause for several seconds before warping them out

if the timer is long running one like over 10 minutes, I prefer to use addtimer command

doevent "testtimer::Onuse";

-	script	testtimer	-1,{
Onuse:
deltimer "testtimer::Ontimeup";
addtimer 10000, "testtimer::Ontimeup";
warp "guild_vs2", 0,0;
end;

Ontimeup:
if ( strcharinfo(3) != "guild_vs2" ) end;
warp "SavePoint", 0,0;
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

That could work, also it does save the hassle of using a variable.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  132
  • Reputation:   2
  • Joined:  02/02/12
  • Last Seen:  

So.. it was working fine until I updated to latest version.

This is the error I get:

[Debug]: Data: variable name='warpinout'

[Debug]: Function: callfunc

[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)

[Error]: script:callfunc: function not found! [0]

[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)

This is the script i was using and worked fine until latest update

function script warpinout {
warp "dew_fild01",0,0;
sleep2 600000;
if(strcharinfo(3) != "dew_fild01"){end;}
warp "Mellina",82,84;
end;
}

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

i would suggest you to use the method posted by Annie.. in post#12

i would have show you the same method if annie had not posted that previously...

the reason why you get error is .....

function are not loaded yet when the map-server console start loading the trunk/db/re/item_db.txt

perhap you are calling the function like this ?

warpinout();

in order to solve this problem.... you have to either change the function to npc script... or edit source to enable NPC files is loaded before database folder...

or try change to this

callfunc "warpinout";

Edited by Emistry
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
Answer this question...

×   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.

×
×
  • Create New...