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

jmnevil54
09 Apr 2018, 18:27

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}.")

The Pixie
09 Apr 2018, 18:44

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).}"

jmnevil54
10 Apr 2018, 09:08

How would that work for the ProcessText function?


The Pixie
10 Apr 2018, 09:49

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


jmnevil54
10 Apr 2018, 19:28

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


mrangel
10 Apr 2018, 23:58

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.
11 Apr 2018, 00:31

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.


jmnevil54
23 Apr 2018, 23:06

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