Jump to content
  • 0

Warp in Warp out.


Question

Posted

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 ;)

14 answers to this question

Recommended Posts

Posted

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.

Posted

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.

Posted (edited)

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
Posted (edited)

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
Posted

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

Posted

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.

Posted

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 ;)!

Posted

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

Posted

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;
}

Posted

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;
}

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...