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
Fadein help
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#1
Fadein help

Solved

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-13-2012, 03:36 AM by eagledude4.)
01-02-2012, 06:03 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Timer help

(01-02-2012, 06:03 PM)eagledude4 Wrote:
if (GetTimerTimeLeft(FadeTimer) == 0));
        FadeIn(5);
        SetPlayerActive(true);
    }

How do I make that work?
I'm not the best with if functions to be honest, but I have an IDEA:

if (GetTimerTimeLeft("FadeTimer") == 0);{
FadeIn(5);
SetPlayerActive(true);
}

01-02-2012, 06:16 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Timer help

For starters, you might want to get rid of the semicolon at the end of the if statement. Secondly, timer callbacks get called when they reach 0 time left anyway, so why check for 0 time?

Tutorials: From Noob to Pro
(This post was last modified: 01-02-2012, 08:39 PM by Your Computer.)
01-02-2012, 08:38 PM
Website Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#4
RE: Timer help

(01-02-2012, 08:38 PM)Your Computer Wrote: For starters, you might want to get rid of the semicolon at the end of the if statement. Secondly, timer callbacks get called when they reach 0 time left anyway, so why check for 0 time?

I fixed the semicolon after I pasted the code. I didn't realize the timer launched the function automatically.
Problem is still persisting.

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-03-2012, 03:55 AM by eagledude4.)
01-02-2012, 11:09 PM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#5
RE: Timer help

Help please?

Its hard to see the truth when you've been blinded by lies.
01-03-2012, 12:39 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#6
RE: Timer help

Did you check my example for testing?
01-03-2012, 02:08 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Timer help

(01-03-2012, 12:39 AM)eagledude4 Wrote: Help please?

With what? Isn't the code example inside a callback, specifically a timer callback that loops?

Tutorials: From Noob to Pro
01-03-2012, 02:37 AM
Website Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#8
RE: Timer help

(01-03-2012, 02:08 AM)Statyk Wrote: Did you check my example for testing?

Yes I did, it didn't work. I ended up fixing what you pasted, and have:
void StartGame() {
    if (GetTimerTimeLeft("FadeTimer") == 0)) {
        FadeIn(5);
        SetPlayerActive(true);
    }
}

That code gives me two errors though, on these lines:
PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
if (GetTimerTimeLeft("FadeTimer") == 0)) {


(01-03-2012, 02:37 AM)Your Computer Wrote:
(01-03-2012, 12:39 AM)eagledude4 Wrote: Help please?

With what? Isn't the code example inside a callback, specifically a timer callback that loops?
Help with my timer not calling my function. I don't know what you mean, exactly.


Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-03-2012, 04:03 AM by eagledude4.)
01-03-2012, 03:55 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#9
RE: Timer help

Can I see your whole .hps so I can see your callbacks?
01-03-2012, 04:01 AM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#10
RE: Timer help

(01-03-2012, 04:01 AM)Statyk Wrote: Can I see your whole .hps so I can see your callbacks?

bool TriggeredEnemy;

void OnStart() {
    if (ScriptDebugOn()) {
        GiveItemFromFile("lantern", "lantern.ent");
        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
        /*SetEntityActive("invisWall", false);
        SetEntityActive("blockArea", false);*/
    }
    SetPlayerActive(false);
    AddNote("First", "");
    AddTimer("FadeTimer", 5, "StartGame");
    AddEntityCollideCallback("Player", "EnemyTriggerArea", "EnteredEnemyTriggerArea", true, 1);
    AddEntityCollideCallback("Player", "BlockArea", "EnteredBlockArea", true, 1);
    SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true);
    SetEntityCallbackFunc("key_1", "OnPickup");
    PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
    SetDeathHint("Death", "StairScare");
}

void OnEnter() {
}

void OnLeave() {
}

/*void StartGame() {
    if (GetTimerTimeLeft("FadeTimer") == 0)) {
        FadeIn(5);
        SetPlayerActive(true);
    }
}*/
    
void EnteredEnemyTriggerArea(string &in asParent, string &in asChild, int alState) {
    SetEntityActive("servant_grunt_1", true);
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
    if(GetEntitiesCollide("Player", "SonRoomArea") == true) {
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 5, "");
    } else if(GetEntitiesCollide("Player", "DadRoomArea") == true) {
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 5, "");
    }
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
}

void EnteredBlockArea(string &in asParent, string &in asChild, int alState) {
    if (HasItem("key_1") == false) {
        SetMessage("PersonalMessages", "Barrier", 6);
    }
}

void OnPickup(string &in asEntity, string &in type) {
    SetEntityActive("invisWall", false);
    SetEntityActive("blockArea", false);
}

void TriggerSpider(string &in asEntity) {
    SetEntityActive("spider_1", true);
}

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-03-2012, 04:05 AM by eagledude4.)
01-03-2012, 04:04 AM
Find




Users browsing this thread: 3 Guest(s)