Jump to content
  • 0

Custom Warper Help


Yummy

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   12
  • Joined:  03/07/12
  • Last Seen:  

Help The first warp is working fine but the 2nd and 3rd warp is not working.. I can click it but it won't let me warp to the place Donation Area and Luneta Vend Room

philtown,170,195,5 script Main Town Warper 965,{
setarray .@MapList$,
  "turbo_room","Luneta Mall","100","68",
  "turbo_room","Donation Area","115","94",
  "pron_mall","Luneta Vend Room","98","42",
  "Payon","Payon","162","133";
for( set .@i,0; .@i < getarraysize( .@MapList$ ) - 4; set .@i,.@i + 4 )
set .@Menu$,.@Menu$ + .@MapList$[.@i+1]+":";
set .@i,( select( .@Menu$ ) - 1 );
warp .@MapList$[.@i],atoi( .@MapList$[.@i+2] ),atoi( .@MapList$[.@i+3] );
end;
OnInit:
waitingroom "Main town Warper",0;
end;
}
//-------------------MAP FLAG-----
turbo_room mapflag nogo

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   52
  • Joined:  11/15/11
  • Last Seen:  

I suck at looping and all but from my first few at this I gotta question the -4 on getarraysize.. and the .@i+1 on the menu one.. I mean the .@i changes by itself so why's it need a +1?

but then again like I said I suck a looping and never find the time to actually improve upon it.. love how emistry uses it for like every single problem, I suppose it's kind of like practice makes perfect..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   12
  • Joined:  03/07/12
  • Last Seen:  

Help! BUMP

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:  

try this

[ Pastebin ] Custom Warper

i forget to do the calculation after select the map...

@namelesss

ya...practice make perfect....

i started to do like this after AnnieRuru ask me to do it in this way to improve my skills last time

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   52
  • Joined:  11/15/11
  • Last Seen:  

I remember... I think it was back at the time when she was teaching me scripting a bit, and talking about 3 different levels

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  268
  • Reputation:   27
  • Joined:  12/06/11
  • Last Seen:  

Hmm..

I'm kinda confuse with your script

What cause error to your script is that during

set .@i,( select( .@Menu$ ) - 1 );

Of course the output would be like this

Luneta Mall
Donation Area
Luneta Vend Room
Payon

When the user select Donation Area for example select function would return '2'

Lets take a look back at your setarray

setarray .@MapList$,
"turbo_room","Luneta Mall","100","68",
"turbo_room","Donation Area","115","94",
"pron_mall","Luneta Vend Room","98","42",
"Payon","Payon","162","133";

during this line

warp .@MapList$[.@i],atoi( .@MapList$[.@i+2] ),atoi( .@MapList$[.@i+3] );

.@i = 2 - 1. right?

therefore since .@i = 1, I'll replace .@i with 1

warp .@MapList$[1],atoi( .@MapList$[3] ),atoi( .@MapList$[4] );

Therefore your 2nd warp and above wouldn't work because

your index 1 is "Luneta Mall" which will cause an unknown map when used on warp function.

How about instead of having this

setarray .@MapList$,
"turbo_room","Luneta Mall","100","68",
"turbo_room","Donation Area","115","94",
"pron_mall","Luneta Vend Room","98","42",
"Payon","Payon","162","133";

What if you change it to this?

setarray .@Map$, "turbo_room", "turbo_room", "pron_mall", "Payon";
setarray .@MapName$, "Luneta Mall", "Donation Area", "Luneta Vend Room", "Payon";
setarray .@MapX,100,115,98,162;
setarray .@MapY, 68,94,42,133;

So that during selection when the user selects an option your warp function would be like

warp .@Map$[.@i],.@MapX[.@i],.@MapY[.@i];

Uh. just a suggestion for this part. :)

Edited by Kaito_Kid
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  308
  • Reputation:   3
  • Joined:  12/18/11
  • Last Seen:  

you miss something (:)

in this part

"turbo_room","Donation Area","115","94",

"turbo_room","Donation Area","115","94";

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:  

thx for the suggestion kaito...but i already fixed that ...

i just dont want to use multiple array xP

jus a simply calculation is needed to make sure it warp to the correct location

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