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
Hungerzz Offline
Junior Member

Posts: 10
Threads: 2
Joined: Mar 2014
Reputation: 0
#1
Custom Story Error

Hello guys,can you show me how to fix this problem? Here is the script
--------------------------------------------------------------------
19 void AddEntityCollideCallback("PlayerStop", "", "SetPlayerActive", "", 1);
20
21 void SetPlayerActive(false);
22 {
23 StartPlayerLookAt("Grunt", 5.0f, 5.0f, "AddTimer");
24 AddTimer("", 5.0f, "StartWalk");
25 }
26 void StartWalk(string &in asTimer)
27 {
28 SetPlayerActive(true);
29 StopPlayerLookAt();
30 }
------------------------------------------------------------------
And then this error shows up when i start the map :

main(22,1) ERR: Unexpected token '{'

-------------------------------------------------------
I'm trying to make player stop and look at monster for 5 seconds,and then walk again after 5 seconds.
03-23-2014, 10:45 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#2
RE: Custom Story Error

19 void AddEntityCollideCallback("PlayerStop", "", "SetPlayerActive", "", 1);
20

There are no braces here first of all.

03-23-2014, 10:50 AM
Find
Romulator Offline
Not Tech Support ;-)

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

Actually; hold on, you have a few errors...

Try This!
PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""PlayerStop""SetPlayerActive"true1);
}

void SetPlayerActive(string &in asParentstring &in asChildint alState)
{
SetPlayerActive(false);
StartPlayerLookAt("Grunt"5.0f5.0f"");
AddTimer(""5.0f"StartWalk");
}

void StartWalk(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();


See if it works after that Smile (But if you already have an OnStart(), make sure to put the AddEntityCollideCallback inside of it)

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 03-23-2014, 10:57 AM by Romulator.)
03-23-2014, 10:50 AM
Find
Hungerzz Offline
Junior Member

Posts: 10
Threads: 2
Joined: Mar 2014
Reputation: 0
#4
RE: Custom Story Error

Romulator i did as you showed but it still shows me the same error.
(This post was last modified: 03-23-2014, 10:56 AM by Hungerzz.)
03-23-2014, 10:54 AM
Find
Romulator Offline
Not Tech Support ;-)

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

Updated! Sorry about that.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
03-23-2014, 10:57 AM
Find
Hungerzz Offline
Junior Member

Posts: 10
Threads: 2
Joined: Mar 2014
Reputation: 0
#6
RE: Custom Story Error

Thanks so much Romulator! It started looking everything works fine! But there is still one problem.Player doesn't follow Grunt as it moves.What do i do?
03-23-2014, 11:07 AM
Find
Romulator Offline
Not Tech Support ;-)

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

That one isn't tough, but can be a bit tedious to code. I'll take a look at Case Statements and get back to you on that in a sec Smile When finished, I will pm you Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 03-23-2014, 11:11 AM by Romulator.)
03-23-2014, 11:10 AM
Find
Hungerzz Offline
Junior Member

Posts: 10
Threads: 2
Joined: Mar 2014
Reputation: 0
#8
RE: Custom Story Error

Thanks !
How do i +rep you? Big Grin
03-23-2014, 11:11 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#9
RE: Custom Story Error

Leftmost + sign on the bottom left of his post

03-23-2014, 11:21 AM
Find
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"true1);
    
SetLocalVarInt("Time_number"1);
}

void WalkandFollow(string &in asParentstring &in asChildint 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.0f10.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.0f10.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




Users browsing this thread: 4 Guest(s)