Any way to change the color of the dot on the map that represents the player's location?

I've been searching for a way to do this. Does anyone know if it is possible? Custom code maybe? Any help would be appreciated. Thanks.


I am not an expert but I do not think it is possible, surprisingly, since the app can pretty much do anything, except this =D

I went for

player.grid_fill="Blue"
player.grid_fill=Blue
player.grid_colour = "Blue"
JS.setCss ("#player", "grid_fill: Blue")

Basically some of the codes only works when written for a room,
which is obviously much simpler to modify map grid colour for all rooms at game.interface.

So, I am guessing the codes for the player relating to grid like the dot color had not been written yet.
And unfortunately, I do not see any new map libraries and pixie's library that might offer more customization.


You can use (I don't know if this translates well at all):
if (player is in room ()) {
//script to change grid colour / so not dot//
roomcentre.grid_fill = "AliceBlue"
Grid_DrawRoom (roomcentre, true, game.pov)
}
Except for if player is in room, which is in the tabs, I was given the code by someone who actually knows code. I was mazed by how neatly it works.
There is also this
http://paperjs.org


Wait. roomcentre was the name of a room. I just copied that. So, it looks like the word for dot, or something, I wish, but it's not. However, there really is a drawing application with the paper. The map comes from the drawing application. In fact I have seen codes for changing the shape, size, and colour of the dot, so I know it can be done. It's somewhere out there.


Yeah, I didn't think it was possible either, but I also had not thought of simply filling the room with a solid color...I'll try that.


I just tried countless of times, but it seems like I had been confused.
It is not possible to interact with the grid's color or dot's color with codes at all.
I might have succeeded on change the grid's color by changing the room's attribute directly at room.grid_fill = Blue
and thought my code worked.

All these codes does not works, sorry for the confusion.

game.pov.parent.grid_fill = "Blue"
player.grid_fill="Blue"
room.grid_fill="Blue"
JS.setCss ("#room", "grid_fill: Blue")

You'll need to change one of the core functions, so you can only do this in the desktop editor.

The default function is:

  <function name="Grid_DrawPlayerInRoom" parameters="room">
    if (room.grid_render) {
      Grid_DrawRoom (room, false, game.pov)

      player_x = Grid_GetGridCoordinateForPlayer(game.pov, room, "x") + room.grid_width/2.0
      player_y = Grid_GetGridCoordinateForPlayer(game.pov, room, "y") + room.grid_length/2.0
      player_z = Grid_GetGridCoordinateForPlayer(game.pov, room, "z")

      // Grid_DrawPlayer(x, y, z, radius, border, borderWidth, fill)
      JS.Grid_DrawPlayer(player_x, player_y, player_z, 5, "black", 2, "yellow")
    }
  </function>

So basically, change that function to use different colours.

If you want to do it on the web editor, I think you could move the player after the default script has drawn it; so you could create your own copy of that function, and run it from game.roomenter (the "when player enters a room" script on the game object) to change the colour of the dot.


Thanks Vurt834, Jennifer Wren, mrangel and his impressive solution,
I have learned Overriding Functions at
https://github.com/ThePix/quest/wiki/Overriding-Functions

For those who is unable to use the function, create a function named "Grid_DrawPlayerInRoom",
then add in parameter "room"

Copy and paste the following into the code view of the function.

if (room.grid_render) {
  Grid_DrawRoom (room, false, game.pov)
  player_x = Grid_GetGridCoordinateForPlayer(game.pov, room, "x") + room.grid_width/2.0
  player_y = Grid_GetGridCoordinateForPlayer(game.pov, room, "y") + room.grid_length/2.0
  player_z = Grid_GetGridCoordinateForPlayer(game.pov, room, "z")
  // Grid_DrawPlayer(x, y, z, radius, border, borderWidth, fill)
  JS.Grid_DrawPlayer (player_x, player_y, player_z, 5, "black", 2, "blue")
}

mrangel's code can also be pasted directly into the game's code view itself at the bottom,
but try to avoid pasting it before

</asl>

Which is probably some code that functions like a full stop.
Remember to change the code "yellow" into a color that you like.


Worked like a charm, thanks.


Log in to post a reply.

Support

Forums