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
#1
[SOLVED]Script problem

Today I wanted to test my MASSIVE script, and when I say massive I mean 1800 lines.

I had just added a health to percentage logic. All fine and doodely doo. As I wanted to test my script something weird happens.

Script lines are not triggering.

According to my debug messages, everything is working fine.

[Image: 78a0d92ff4.jpg]

But certain lines are not triggering, such as "SetPlayerActive(false);".
This is a part of my script where the debug message is clearly calling:
PHP Code: (Select All)
if(asTimer == "FindMonster")
    {
        
AddDebugMessage("WHYDOESN'TTHISWORK?"false);
        
BattlePreparation();
        
SetPlayerActive(false);
        
PlayMusic("MonsterMusic_1.ogg"true7110false);
        
        
FadePlayerFOVMulTo(1.52);
        
FadeImageTrailTo(153);
        
        
FadePlayerRollTo(901010);
        
FadeOut(2);
        
AddTimer("PrepareVision"2"FindMonsterTimer");
    } 

Lines that a not calling are:

PHP Code: (Select All)
SetPlayerActive(false);
PlayMusic("MonsterMusic_1.ogg"true7110false);

FadePlayerFOVMulTo(1.52);
FadeImageTrailTo(153);

FadePlayerRollTo(901010);
FadeOut(2);
AddTimer("PrepareVision"2"FindMonsterTimer"); 

Does anyone have any idea why this is happening? Is there a limit to how much scripting I can have? That would REALLY suck!

Keep in mind I have no errors, this used to work, then I added a couple of stuff with no relation to this part, and it stopped working.

Things I've tried:
- Delete map.cache
- Restart Amnesia
- Overwrite my .hps file to the same folder

Trying is the first step to success.
(This post was last modified: 12-03-2014, 01:46 AM by FlawlessHappiness.)
12-02-2014, 05:10 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Script lines stopped triggering.

Everything stops after BattlePreparation();
What happens in there?
What if you moved that line to the bottom of this block?

(This post was last modified: 12-02-2014, 05:16 PM by Mudbill.)
12-02-2014, 05:16 PM
Find
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
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: [SOLVED]Script lines stopped triggering.

Alrighty then. Carry on with your sweet scripts! Tongue

12-02-2014, 07:51 PM
Find
FlawlessHappiness Offline
Posting Freak

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

(12-02-2014, 07:51 PM)Mudbill Wrote: Alrighty then. Carry on with your sweet scripts! Tongue

Will do Wink
On a sidenote: Have you ever played with particle systems?

Trying is the first step to success.
12-02-2014, 08:23 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: [SOLVED]Script lines stopped triggering.

Not that much. At least if you're talking about the Particle Editor. Maybe I will with the new one, it looks pretty great.

(This post was last modified: 12-02-2014, 10:34 PM by Mudbill.)
12-02-2014, 10:34 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: [SOLVED]Script problem solved. Another question further down.

(12-02-2014, 10:34 PM)Mudbill Wrote: Not that much. At least if you're talking about the Particle Editor. Maybe I will with the new one, it looks pretty great.

I am.
Problem is when I create a particle with movement, I can't rotate it with a rotated area.
Instead I've created seperate files. One for going back. One for going forward.

Does anyone know if there's a solution to this?

Trying is the first step to success.
(This post was last modified: 12-02-2014, 10:40 PM by FlawlessHappiness.)
12-02-2014, 10:40 PM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#8
RE: [SOLVED]Script problem solved. Another question further down.

In the Particle Editor...

Open up the Particle you have, go to the "Movement" Tab... change the "Coord System" from "World" to "Local".
12-02-2014, 11:21 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: [SOLVED]Script problem solved. Another question further down.

(12-02-2014, 11:21 PM)Rapture Wrote: In the Particle Editor...

Open up the Particle you have, go to the "Movement" Tab... change the "Coord System" from "World" to "Local".

Oooooooooh! Awesome!

Thank you ^_^
This will make it all a lot easier

Trying is the first step to success.
12-03-2014, 12:14 AM
Find




Users browsing this thread: 5 Guest(s)