? <attr name="grid_fill">Snow</attr> ?

How can this be written as a script?


You want to set a room's grid_fill attribute to the string Snow?

Simple:

name of room.grid_fill = "Snow"

Yes, or any other colour, midgame.
They are already set to Snow in the tabs page for drawing grid, because I had wanted to change them from white, to see what grid_fill was called in code view.


If you're changing the grid properties of a room once it's already been drawn on the map, you might need to force a redraw of the map as well.


I don't even know how (I guess I can clear the grid and rerun the script that opens all rooms on the map, because I have them all previsible) but I think I just need a script that works for colour string, as name. Attribute = red is not doing anything.
If I delete the map and reopen the entire map, will Quest then recognize all my newly set colour attributions?
It may take me a while to figure out how to even try it, though.


Unfortunately, I was right. Even when the map is not drawn until the script has been called, the game engine doesn't know what the string "Red" is, an unknown object or variable.
There was no error, this time, but no colour.


With redrawing the room (assuming it's been drawn) I think you would want:

name of room.grid_fill = "Snow"
Grid_DrawRoom (name of room, true, game.pov)

(if the player is in the room, use DrawPlayerInRoom too. So to automatically select the right function, you would do:

name of room.grid_fill = "Snow"
if (name of room.render) {
  Grid_DrawRoom (name of room, true, game.pov)
  if (Contains (name of room, game.pov)) {
    Grid_DrawPlayerInRoom (name of room)
  }
}

name. Attribute = red is not doing anything.

Do you mean roomname.grid_fill = "red"? That should work as far as I can tell. Although there doesn't seem to be a list of color names anywhere that I can check.

Could you try using a color like "#ee0000"? Does that work any better?


It works!!! Thank you.
I mean it.
However, I ran out of memory, really quickly, just randomly colouring nine rooms, with seven colours, and I had wanted to make a mini-game for part of a more story-based game. If I used two colours, it would probably still be too many for that.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums