ta script: add get coords commands
Forum rules
This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.
Its current use is for the continued development of the server and game it has always served: TMW Classic.
ta script: add get coords commands
I noticed that there is no way to get a player's map coordinates. It should be easy to expose a get coord command for scripting. What about a set player coords, can this be done, along with the appropriate client update?
For npcs, would it be possible to get/set their coords?
I would really want to be able to get/set mob coords. I know there is currently no way to interact with mobs through scripting. If we can get the mob's id when it is created and store it, then it would be possible to interact with it through specialized commands? Maybe have a special spawnOne command that spawns one mob and returns its id.
For npcs, would it be possible to get/set their coords?
I would really want to be able to get/set mob coords. I know there is currently no way to interact with mobs through scripting. If we can get the mob's id when it is created and store it, then it would be possible to interact with it through specialized commands? Maybe have a special spawnOne command that spawns one mob and returns its id.
-
- Newly Registered User
- Posts: 2
- Joined: 28 Mar 2011, 17:17
Re: ta script: add get coords commands
Im totally New to TMW, im from the eAthena forum and worked for years with eAthena.
I dont know how eAthena works with the TMW client, i suspect ur eAthena(TMW) no longer corresponds to the original eAthena but usually ... erm take a look:
I hope I could help you with this. My english isn't very good. sorry xD
I dont know how eAthena works with the TMW client, i suspect ur eAthena(TMW) no longer corresponds to the original eAthena but usually ... erm take a look:
Code: Select all
*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})
This function will locate a character object, NPC object or pet's coordinates
and place their coordinates into the variables specified when calling it. It
will return 0 if the search was successful, and -1 if the parameters given were
not variables or the search was not successful.
Type is the type of object to search for:
0 - Character object
1 - NPC object
2 - Pet object
3 - Monster object.
While 3 is meant to look for a monster object, no searching will be done if you
specify type 3, and the function will always return -1.
The search string is optional. If it is not specified, the location of the
invoking character will always be returned for types 0 and 2, the location of
the NPC running this function for type 1.
If a search string is specified, for types 0 and 1, the character or NPC with
the specified name will be located. If type is 3, the search will locate the
current pet of the character who's name is given in the search string, it will
NOT locate a pet by name.
What a mess. Example, a working and tested one now:
prontera.gat,164,301,3| |script| |Meh| |730,{
mes "My name is Meh. I'm here so that Nyah can find me.";
close;
}
prontera.gat,164,299,3| |script| |Nyah| |730,{
mes "My name is Nyah.";
mes "I will now search for Meh all across the world!";
if (getmapxy(@mapname$,@mapx,@mapy,1,"Meh")!=0) goto Notfound;
mes "And I found him on map "+@mapname$+" at X:"+@mapx+" Y:"+@mapy+" !";
close;
Notfound:
mes "I can't seem to find Meh anywhere!";
close;
}
Notice that NPC objects disabled with 'disablenpc' will still be located.
I hope I could help you with this. My english isn't very good. sorry xD
Re: ta script: add get coords commands
Your knowledge of eAthena scripting is very helpful, especially for fakenpcname. Unfortunately tmwAthena is lacking several commands. getmapxy is one of them. In the manual I was referencing it said getmapxy did not work properly for mobs, I guess they fixed it since the manual version I was looking at.
The commands I am most bummed about not having are:
int buildin_commandname (struct script_state *st);
here is the link (be patient if it doesnt load right away, it is a large file):
http://gitorious.org/tmw-eathena/mainli ... p/script.c
The commands I am most bummed about not having are:
- setcell/setwall
- areamobuseskill
- for (no built in loops!)
- if, with multiple statements
- anything that acesses a spawned mobs info (you can get the mob db info but not current hp or location)
- a command that lets you do something to all pcs in an area/map.
- clone (not crucial but it would have been fun)
int buildin_commandname (struct script_state *st);
here is the link (be patient if it doesnt load right away, it is a large file):
http://gitorious.org/tmw-eathena/mainli ... p/script.c
Re: ta script: add get coords commands
The manaplus client is able to show map co-ordinates, is that client side?
- Freeyorp101
- Archivist Prime
- Posts: 765
- Joined: 04 Nov 2008, 09:17
- Location: New Zealand
Re: ta script: add get coords commands
This is regarding tmwAthena scripting and has absolutely nothing to do with what the client displays.
---Freeyorp
---Freeyorp
(09:58:17) < tux9th> Freeyorp: your sig on the forums is kind of outdated
Re: ta script: add get coords commands
The normal client also displays map coordinates in the F10 window. We have this feature for ages. It's funny how many features are attributed to the ManaPlus patch although they have been core features of the unmodified client for ages. But, as Freeyorp pointed out, this is off topic.
- former Manasource Programmer
- former TMW Pixel artist
- NOT a game master
Please do not send me any inquiries regarding player accounts on TMW.
You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Re: ta script: add get coords commands
Ohh. Thanks for that. I use .29 1.0 and manaplus almost everyday sometimes things jump out more on one client than the others.
So the client does the calculating of that from data files I am guessing. Does the server see players when monsters with aggro come into view?
So the client does the calculating of that from data files I am guessing. Does the server see players when monsters with aggro come into view?
- Freeyorp101
- Archivist Prime
- Posts: 765
- Joined: 04 Nov 2008, 09:17
- Location: New Zealand
Re: ta script: add get coords commands
The server has the complete state of the game world at any time.
---Freeyorp
---Freeyorp
(09:58:17) < tux9th> Freeyorp: your sig on the forums is kind of outdated