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
Statyk Offline
Schrödinger's Mod

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

You have no syntax after StartGame! Try this:

/*void StartGame(string &in asTimer)
{
FadeIn(5);
SetPlayerActive(true);
}*/
(This post was last modified: 01-03-2012, 04:17 AM by Statyk.)
01-03-2012, 04:16 AM
Find
eagledude4 Offline
Member

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

(01-03-2012, 04:16 AM)Statyk Wrote: You have no syntax after StartGame!

Added the syntax, and moved the FadeIn to OnStart, but the screen doesn't fade in.



Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-03-2012, 05:35 AM by eagledude4.)
01-03-2012, 05:34 AM
Find
Your Computer Offline
SCAN ME!

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

Here's a basic example on how to use a timer:

PHP Code: (Select All)
void OnStart(){
    
AddTimer("timer_name"5"TimerCallback");
}

void TimerCallback(string &in timer_name){
    
// do something...


Tutorials: From Noob to Pro
01-03-2012, 09:14 PM
Website Find
Statyk Offline
Schrödinger's Mod

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

(01-03-2012, 05:34 AM)eagledude4 Wrote:
(01-03-2012, 04:16 AM)Statyk Wrote: You have no syntax after StartGame!

Added the syntax, and moved the FadeIn to OnStart, but the screen doesn't fade in.
did you make sure to remove the " /* " and " */ "

They tell the script to ignore anything within it. If you don't take those out, the script will ignore the whole function I gave you.

void StartGame(string &in asTimer)
{
FadeIn(5);
SetPlayerActive(true);
}
01-03-2012, 09:16 PM
Find
eagledude4 Offline
Member

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

(01-03-2012, 04:16 AM)Statyk Wrote: did you make sure to remove the " /* " and " */ "

They tell the script to ignore anything within it. If you don't take those out, the script will ignore the whole function I gave you.

I'm aware of the function of the /*.

The code I pasted earlier was an earlier version when I was testing something else, and the method was giving an error. Don't worry, I'm not testing commented out functions Tongue

The new code:

void StartGame(string &in asTimer) {
    SetPlayerActive(true);
}

I have

SetPlayerActive(false);
FadeIn(5);
AddTimer("FadeTimer", 5, "StartGame");

in my OnStart, so the player is both frozen, gets the fade from black, and then starts the timer to initate the StartGame function so the player is able to move.


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

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

So it works now?
01-05-2012, 02:03 AM
Find
eagledude4 Offline
Member

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

(01-05-2012, 02:03 AM)Statyk Wrote: So it works now?

No, I was just describing what was supposed to happen.



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

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

It looks correct. Are you saving in the correct .hps?... Could you perhaps post all of your .hps? If everything seems fine, I don't understand what the issue could be.
01-05-2012, 02:21 AM
Find
eagledude4 Offline
Member

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

(01-05-2012, 02:21 AM)Statyk Wrote: It looks correct. Are you saving in the correct .hps?... Could you perhaps post all of your .hps? If everything seems fine, I don't understand what the issue could be.
I'm only using one .hps file.

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);
    FadeIn(5);
    AddTimer("FadeTimer", 5, "StartGame");
    AddNote("First", "");
    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", "big_clock_chime.snt", "clock_grandfather_1", 0, false);
    SetDeathHint("Death", "StairScare");
}

void OnEnter() {
}

void OnLeave() {
}

void StartGame(string &in asTimer) {
    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, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
    if(GetEntitiesCollide("Player", "SonRoomArea") == true) {
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
    } else if(GetEntitiesCollide("Player", "DadRoomArea") == true) {
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_25", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_26", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_28", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_29", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_30", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_29", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_28", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_26", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_25", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 8, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
        AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
    }
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
    AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_31", 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);
}

lang:
<LANGUAGE>
    <CATEGORY Name="CustomStoryMain">
        <Entry Name="Description">You are awoken by the chimes of a grandfather clock.</Entry>
    </CATEGORY>

    <CATEGORY Name="PersonalMessages">
        <Entry Name="Barrier">I should investigate my father's room before heading downstairs.</Entry>
    </CATEGORY>

    <CATEGORY Name="Death">
        <Entry Name="StairScare">Wardrobes make good hiding places.</Entry>
    </CATEGORY>
    
    <CATEGORY Name="Journal">
        <Entry Name="First">See what's up.</Entry>
    </CATEGORY>
</LANGUAGE>

I have skype, so remote assistance is a possibility if you do as well.

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-05-2012, 02:25 AM by eagledude4.)
01-05-2012, 02:25 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#20
RE: Timer help

Ok, I have not read every single reply to this thread, so I'm going to throw this out there. Delete the FadeIn(5); from the void on start and put this in:

Quote:void OnStart()
{
AddTimer("fadein", 0.1f, "fadeinTimer");
}

void fadeinTimer(string &in asTimer)
{
FadeIn(4.9f);
}

(This post was last modified: 01-05-2012, 03:44 AM by flamez3.)
01-05-2012, 03:43 AM
Find




Users browsing this thread: 1 Guest(s)