FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
[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.
But certain lines are not triggering, such as "SetPlayerActive(false);".
This is a part of my script where the debug message is clearly calling:
if(asTimer == "FindMonster") { AddDebugMessage("WHYDOESN'TTHISWORK?", false); BattlePreparation(); SetPlayerActive(false); PlayMusic("MonsterMusic_1.ogg", true, 7, 1, 10, false); FadePlayerFOVMulTo(1.5, 2); FadeImageTrailTo(15, 3); FadePlayerRollTo(90, 10, 10); FadeOut(2); AddTimer("PrepareVision", 2, "FindMonsterTimer"); }
Lines that a not calling are:
SetPlayerActive(false); PlayMusic("MonsterMusic_1.ogg", true, 7, 1, 10, false);
FadePlayerFOVMulTo(1.5, 2); FadeImageTrailTo(15, 3);
FadePlayerRollTo(90, 10, 10); 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.
|
|
12-02-2014, 05:10 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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:
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:
int Floor(float &in x) { return int(x); }
float PercentageXY(int &in x, int &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.
|
|
12-02-2014, 05:19 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
RE: [SOLVED]Script lines stopped triggering.
Alrighty then. Carry on with your sweet scripts!
|
|
12-02-2014, 07:51 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: [SOLVED]Script lines stopped triggering.
(12-02-2014, 07:51 PM)Mudbill Wrote: Alrighty then. Carry on with your sweet scripts!
Will do
On a sidenote: Have you ever played with particle systems?
Trying is the first step to success.
|
|
12-02-2014, 08:23 PM |
|
Mudbill
Muderator
Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation:
179
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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.
|
|
12-02-2014, 10:40 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
|