You are not logged in.

1

Thursday, March 2nd 2017, 8:46am

Range Indicator

Is there any way to create a circle, just a line, with a specific radius, centered on the character? Like the hitbox circles, just a lot larger...for indicating range to target.
Rovie wd/w/s/
Fiddydamage c/r/wl/p/m
Corruption
Artemis
https://www.youtube.com/channel/UCvw3IXqDgHoaK0lHJnyqBJQ vids of stuff

2

Friday, March 10th 2017, 11:43pm

GC_SetBloodBarDistance() (and GC_GetBloodBarDistance() if you want a number) can provide a visual approximation of distance.

GetPlayerWorldMapPos() (and (GetCurrentWorldMapID()) if you have two people and are willing to do some scaling math based on the map.

UnitDistance() always returns 0 for me

GetPlayerPosition() returns nil and has a note on the wiki that this specifically was disabled.

That's all I could find.
Illagong - 98 Warden, 98 Scout, 98 Warrior, 70 Druid, 55 Mage
Mithras - Corruption
Reni - Chiroptera's Call

3

Saturday, March 11th 2017, 7:32pm

Forgot about blood bar display distance. I might be able to learn how to do use it for my needs, but am still hoping someone knows how to display a model / effect with given radius...
Rovie wd/w/s/
Fiddydamage c/r/wl/p/m
Corruption
Artemis
https://www.youtube.com/channel/UCvw3IXqDgHoaK0lHJnyqBJQ vids of stuff

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

4

Friday, April 28th 2017, 3:03pm

Been quite a while since I popped in around here, and yes I know this is a little late but hey...

Anyhoo, many moons ago I played around with some functions that could do something along these lines. It is a bit of a hack but actually worked. Unfortunately, I can't find the code I put together so the following is all from memory.

First, look into all the Novice_* and NoviceTeaching* functions. They aren't defined on the RoMWiki but you can see the functions if you extract the default stuff from the game. Normally these functions are for the novice training quests in the starter area but they allow you to add a 3D object to the world (only viewable by you). These are the functions that place the flags on the ground when teaching players how to move from A to B.

Unfortunately, they require world coordinates in order to place things but there may be a workaround for that too. IIRC, the transport book can record your position. See the TB_* functions though again not much is described on the RoMWiki. You might also want to peruse my old TransportMap addon since it used the transport book, but the code is rather messy in there. I think the coordinates returned by the TB_GetTeleportInfo function is in world coordinates.

Anyway, hope you are feeling up to some serious R&D...
Peryl
2013... The year from hell....

5

Friday, April 28th 2017, 4:35pm

Thanks for the reply, better late than never!

I'll look into this novice flag thing, sounds like it might be helpful....

One way to do what i want is to just create an aoe indicator (like when you cast thunderstorm, you see the large circle indicating the area of effect)...If you knew how to create one of those centered around the character, with a given radius, that would be good too...
Rovie wd/w/s/
Fiddydamage c/r/wl/p/m
Corruption
Artemis
https://www.youtube.com/channel/UCvw3IXqDgHoaK0lHJnyqBJQ vids of stuff

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

6

Friday, April 28th 2017, 5:23pm

Well now. I haven't found the original code I was fooling around with, but I did find some old notes on interesting functions I had found and wanted to investigate back in the day.

Try something like this (Note: this should NOT be used in the starter area as this might mess up your ability to complete the starter training quests)

Source code

1
2
3
4
5
6
7
8
9
10
-- I think this clears any current stuff in the Novice training goop
Novice_ClearAllState();

-- Get your current coordinates. You may need to provide the map ID to this function or 9999 for entire world.
local x,y = GetPlayerWorldMapPos();

-- Add an object to the world (in this case a bear). It doesn't animate but it should show up. Max of 10 objects IIRC.
Novice_AddObject("model\\character\\creature\\bear\\act_bear_cub.ros",x,0,y,0,1);

-- Use Novice_RemoveObject to remove the above bear, but I can't remember any parameters to this function. Possibly an index into the array for the Novice_* objects.


If the above works, you'll need to find a suitable model to use for your area marker. I think the parameters to Novice_AddObject are model-filename, X-coord, height-pos, Y-coord, unknown1, unknown2
The height-pos is ignored I think (I could be wrong there). Though the Novice funcs seem to use 0 soooo....
I have no idea what the last couple of parameters are but maybe play with that last one to see if it is a scale factor.

Edit:
Forgot to mention, you may need to multiply the coords returned by GetPlayerWorldMapPos by 100. At least, that is wat the MinimapFramePlayerPosition's OnUpdate function does,
2013... The year from hell....

This post has been edited 1 times, last edit by "Peryl" (Apr 28th 2017, 5:28pm)