Is is possible to change the color of the text of these things?

So I recently thought it would be cool to change the colors of the texts of different monsters. Like, green means zombie, blue means ghoul, and so on. Is it possible?

Code I was hoping to change:

obj.critdesc = "A well-placed blow by #attacker# sends you reeling (#hits# hits)."
obj.attackdesc = "#Attacker# has hit you (#hits# hits)."
obj.missdesc = "#Attacker# misses you."
obj.look = ProcessText("A " + obj.alias + ", {random:covered in maggots:missing an arm:one eye hanging out}.")

Just put the text processor stuff in there, like this:

obj.critdesc = "{colour:blue:A well-placed blow by #attacker# sends you reeling (#hits# hits).}"

How would that work for the ProcessText function?


Should be fine. Try it on a couple and see what happens.


Alright. The code you put just isn't working. It does nothing.

The game is here. Maybe it just does that because my text is already fuchsia. (Pink...)
http://textadventures.co.uk/games/view/fo9bej7z0kqiy_wxal2tcq/fing-game


You've only added the {colour: to the attackdesc/critdesc/missdesc attributes of the monsters.

Those strings are only used if the monster doesn't have a weapon, which is never true in your game.

The strings that get used are the ones for the monster's attacks, so those are the ones you need to add the colour to.


K.V.

As mrangel says, and you could change obj.look to this:

obj.look = "{colour:blue:" + CapFirst(GetDisplayName(obj)) + ", {random:covered in maggots:missing an arm:one eye hanging out}.}"

Quest will run a look string through the text processor automatically.


Alright! I got the attacks at least!
http://textadventures.co.uk/games/view/fo9bej7z0kqiy_wxal2tcq/fing-game


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

Support

Forums