Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help [SOLVED]Script problem
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Script lines stopped triggering.

Oh!
I fixed it. God damn me.

The script lines that I had just created were causing the trouble. For some reason they broke down the whole script!

They look like this:
PHP Code: (Select All)
SetGlobalVarInt("EnemyCurPercHealth"Floor((PercentageXY(GetGlobalVarInt("EnemyMonsterHealth"), GetGlobalVarInt("EnemyMaxHealth")))/10));
AddDebugMessage("Enemy HP % = "+GetGlobalVarInt("EnemyCurPercHealth")*10+"%"false);

and

SetGlobalVarInt("FriendlyCurPercHealth"Floor((PercentageXY(GetGlobalVarInt("FriendlyMonsterHealth"), GetGlobalVarInt("FriendlyMaxHealth")))/10));
AddDebugMessage("Friendly HP % = "+GetGlobalVarInt("FriendlyCurPercHealth")*10+"%"false); 

Don't know why they break it down though...

This is Floor and PercentageXY:

PHP Code: (Select All)
int Floor(float &in x)
{
    return 
int(x);
}

float PercentageXY(int &in xint &in y)
{
    return 
float((float(x)/float(y))*100);


EDIT:
It is fixed now. The problem was that I somewhere in the script had both LocalVarInts and GlobalVarInts of the same name. This caused trouble. Be careful with that.

Trying is the first step to success.
(This post was last modified: 12-02-2014, 06:09 PM by FlawlessHappiness.)
12-02-2014, 05:19 PM
Find


Messages In This Thread
[SOLVED]Script problem - by FlawlessHappiness - 12-02-2014, 05:10 PM
RE: Script lines stopped triggering. - by Mudbill - 12-02-2014, 05:16 PM
RE: Script lines stopped triggering. - by FlawlessHappiness - 12-02-2014, 05:19 PM



Users browsing this thread: 1 Guest(s)