[Help] Understanding Map scripts!
Hi guys. I need help understand map scripts. Im trying to fix some maps but its very annoying due to my lack of knowledge. I was going through some map scripts and i noticed that the maps that did work would have a code something like this
PHP Code:
<imgdir name="1">
<string name="pn" value="in00" />
<int name="pt" value="2" />
<int name="x" value="-100" />
<int name="y" value="43" />
<int name="tm" value="610040100" />
<string name="tn" value="out00" />
<int name="horizontalImpact" value="0" />
<string name="script" value="" />
<int name="hideTooltip" value="0" />
<int name="onlyOnce" value="0" />
<int name="delay" value="0" />
</imgdir>
As for the ones that dont work. They lack that certain part of the script. I tried copy and pasting the code up there changing the values to the map i would like to go and putting a reasonable x and y value but no luck. I dont know what to do. Someone help me out. Not looking for any leeching or anything but a tip or something can help me enough to fix all my maps please help.
The map im trying to fix lacks
PHP Code:
<imgdir name="1">
<string name="pn" value="in00" />
<int name="pt" value="2" />
<int name="x" value="-100" />
<int name="y" value="43" />
<int name="tm" value="610040100" />
<string name="tn" value="out00" />
<int name="horizontalImpact" value="0" />
<string name="script" value="" />
<int name="hideTooltip" value="0" />
<int name="onlyOnce" value="0" />
<int name="delay" value="0" />
</imgdir>
So I added it and edited the
Quote:
value = "610040100
and put the and I warped myself to the next map got the x y coordinates of the nearest npc to the wall on the left and put those values in. I know sounds extremely nooby but hey im trying at least. Please somone help...
Re: [Help] Understanding Map scripts!
First, whats wrong with the maps? Any bat errors please post them. 2nd, what you are editing is the physical layout, or whoever you want to call it, of the maps and they shouldn't be a problem unless you have fucked up XMLS, or you tried editing them and something went wrong O-o.
Re: [Help] Understanding Map scripts!
Quote:
Unhandled script : dubl2Tuto0, type : onUserEnter - MAPID 103050900
Unhandled portal script dubl2TutoPT on map 103050900
Unhandled portal script dubl2TutoPT on map 103050900
Havnt tried editing anything.
Re: [Help] Understanding Map scripts!
Those are portals or On(First)UserEnter scripts.
You're right about On(First)UserEnter being a mapscript, but dubl2TutoPT is a portal.
You can find most likely find them at the bottom of the file, but that's no longer needed since you already have the scriptnames.
To fix a portal, you will have to code it.
An example of a portalcode is:
PHP Code:
function enter(pi) {
pi.warp(910000000, 0);
return;
}
This script warps you to the Free Market Entrance. MapScripts load their methods directly from AbstractPlayerInteraction.
Example: pi.(methodfromfile).
Mapscripts work a little different. I don't know them by heart, but you should try looking up some other pre-made scripts.
Re: [Help] Understanding Map scripts!
Ok I want to fix that portal. So are you saying if I make a new Java file renamed it to which is the map before the one im trying to get too and put this code
PHP Code:
function enter(pi) {
pi.warp(103050910, 0);
return;
}
its going to work? I just tried it doesnt work. Idk what to do because im looking through other map scripts and they have this for example
PHP Code:
<imgdir name="3">
<string name="pn" value="north00" />
<int name="pt" value="2" />
<int name="x" value="-1214" />
<int name="y" value="762" />
<int name="tm" value="101030100" />
<string name="tn" value="south00" />
<string name="script" value="" />
<int name="hideTooltip" value="0" />
<int name="onlyOnce" value="0" />
<int name="delay" value="0" />
</imgdir>
which indicates to me the next or previous map. As for the one im trying to fix it lacks that part of the code and I dont what to put in case I want it to work...
Re: [Help] Understanding Map scripts!
No, you make a file named "dubl2TutoPT" in your scripts/portals folder with the basic structure I gave you.
Re: [Help] Understanding Map scripts!
Omg!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Are you kidding it me! It could not have been that freaking simple.! Thank you soooooooooooo much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Re: [Help] Understanding Map scripts!