Descriptions

Once again, pardon my inexperience and simple mindedness but...

If I want player strength to change their description based on player.strength attribute, how would I go about it?

->look me
You look average.
{if player.strength>=1:You are not very strong.}
{if player.strength>=5:You are strong.}
{if player.strength>=10: SO STRONG.}
{if player.strength>=15: MEGA STRONG.}
as an example.

How would I set this up so that descriptions only show up for the relevant strength, when I have strength able to go up in decimals? Currently, if the player has 20 strength, then it shows all of the above. How do I prevent this in Quest?


if (player.strength = 1) {
  msg ("You are not very strong.")
}
if (player.strength = 2) {
  msg ("You are strong.")
}

and so on...


The problem, as you probably realise, is that is strength is 20, then all the conditions are true. The if text processor directive is limited in what it can do, but either can cope with complicated expressions.

You look average.
{either player.strength>=1 and player.strength<5:You are not very strong.}
{either player.strength>=5 and player.strength<10:You are strong.}
{either player.strength>=10 and player.strength<15: SO STRONG.}
{either player.strength>=15: MEGA STRONG.}
as an example.

Sweet!


Log in to post a reply.

Support

Forums