You are visitor #501. | There is currently 1 viewer online.

Displaying QV With No Decimals

Author: pftq

Date: June 17 2000

Game: AOM, AOT

Type: Triggers, QV

Url: Original AOMH Topic

Description:

Displaying QVs


     To display QVs in trigger effects.. for example Send Chat... simply use this code:
"+trQuestVarGet("QVNAME")+"


     Technical: What this does is break the trigger string and allow you to insert commands from other triggers.  Correct - other trigger commands work as well! Just open up your typetest file (game folder/trigger(2)) and you have a whole new set of codes to play with. :)



Removing Decimal


     Now here comes the problem... QVs are what are called "float" variables.  That means they are never ending decimal numbers.  How do we get rid of those zeroes ??? Some have come up with very fancy ways to deal with this problem.  Some claim it's impossible.

     Me? I say just modify the code a bit use this:
"+(1*trQuestVarGet("QVNAME"))+"


     "So lame :P " - Paperfriend

     Technical: Yes! It is kind of lame.  Sorry to those who've spent so much time dealing with this. :P
     Why does this work? An operation will return the final value in the form of the first item.  The first item is 1, an integer with no decimal.  Therefore it converts the final value to an integer as well.  That's all. :P

Back to Index