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
Custom Story Error
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#10
RE: Custom Story Error

Sent a PM. Done using a looping timer and localvars instead of case. Would make it a bit more complicated.

My final code came out like this, however in more my favour than Hungerzz. Feel free to use it if you understand how it works!
PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player", "ScriptArea_1", "WalkandFollow", true, 1);
    
SetLocalVarInt("Time_number", 1);
}

void WalkandFollow(string &in asParent, string &in asChild, int alState)
{
    
SetPlayerActive(false);
    
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0.001f, "");
    
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.001f, "");
    
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0.001f, "");
    
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.001f, "");
    
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0.001f, "");
    
StartPlayerLookAt("servant_grunt_1", 10.0f, 10.0f, "");
    
AddTimer("look", 0.1f, "timer_look");
}
    
void timer_look(string &in asTimer)
{
    if(
GetLocalVarInt("Time_number") == 11)
    {
    
SetPlayerActive(true);
    
StopPlayerLookAt();
    
RemoveTimer("look");
    }
    else
    {
    
StartPlayerLookAt("servant_grunt_1", 10.0f, 10.0f, "");
    
AddTimer("look", 0.5f, "timer_look");
    
AddLocalVarInt("Time_number", 1);
    }
} 

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 03-23-2014, 12:01 PM by Romulator.)
03-23-2014, 12:01 PM
Find


Messages In This Thread
Custom Story Error - by Hungerzz - 03-23-2014, 10:45 AM
RE: Custom Story Error - by 7heDubz - 03-23-2014, 10:50 AM
RE: Custom Story Error - by Romulator - 03-23-2014, 10:50 AM
RE: Custom Story Error - by Hungerzz - 03-23-2014, 10:54 AM
RE: Custom Story Error - by Romulator - 03-23-2014, 10:57 AM
RE: Custom Story Error - by Hungerzz - 03-23-2014, 11:07 AM
RE: Custom Story Error - by Romulator - 03-23-2014, 11:10 AM
RE: Custom Story Error - by Hungerzz - 03-23-2014, 11:11 AM
RE: Custom Story Error - by 7heDubz - 03-23-2014, 11:21 AM
RE: Custom Story Error - by Romulator - 03-23-2014, 12:01 PM
RE: Custom Story Error - by Hungerzz - 03-23-2014, 03:17 PM
RE: Custom Story Error - by Straxedix - 03-23-2014, 08:27 PM
RE: Custom Story Error - by Romulator - 03-23-2014, 08:57 PM
RE: Custom Story Error - by 7heDubz - 03-24-2014, 04:00 AM
RE: Custom Story Error - by Hungerzz - 03-25-2014, 04:31 PM



Users browsing this thread: 1 Guest(s)