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
Beginner help :o
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#1
Beginner help :o

PHP Code: (Select All)
// This runs when the map is started

     
void OnStart()
    {
    
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);

     
     if(
ScriptDebugOn())
          {
               
GiveItemFromFile("lantern""lantern.ent");
               
SetPlayerLampOil(100.0f);
 
               for(
int i 0;10;i++)
               {
                    
GiveItemFromFile("tinderbox""tinderbox.ent");
               }
          }
     }
    
    
void OpenCabinet(stringasNamefloat afState)
    {
    
SetMoveObjectState("cabinet_nice_1"1);
    }
    
     
//===========================================
     // This runs when the player enters the map
     
void OnEnter()
     {
     }
 
     
//===========================================
     // This runs when the player leaves the map
     
void OnLeave()
     {
     
     } 


So, I have this script that should open the cabinet (cabinet_nice_1) when I enter the area (Script_Area1).
When I try to launch the map, i get a "FATAL ERROR" window saying:
" main (5,2) : ERR : No matching signatures to 'AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)' "
Any help would be appreciated.
Thanks!
(This post was last modified: 01-30-2012, 01:42 PM by FinBanana.)
01-26-2012, 04:50 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#2
RE: Beginner help :o

incorrect syntax, use this insted

// This runs when the map is started

void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);


if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

for(int i = 0;i < 10;i++)
{
GiveItemFromFile("tinderbox", "tinderbox.ent");
}
}
}

void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{

}



Not sure it will fix the main issue, but surely solves a future issue

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
01-26-2012, 04:54 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#3
RE: Beginner help :o

I still get the same error message when trying to launch. : o
01-26-2012, 04:59 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: Beginner help :o

It's because it's missing a }

Use this

void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}

void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{

}

(This post was last modified: 01-26-2012, 05:02 PM by SilentStriker.)
01-26-2012, 05:01 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#5
RE: Beginner help :o

(01-26-2012, 05:01 PM)SilentStriker Wrote: It's because it's missing a }

Use this

void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}

void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{

}



Erm, not sure that'll work either...

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
01-26-2012, 05:03 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: Beginner help :o

If it says that it doesnt reconize AddEntityCollideCallback it either means you torrented the game and it doesnt have all the files or you need to space out the "" and the , Like this:

AddEntityCollideCallBack("Player", "Script_Area1", "OpenCabinet", true, 1);

(01-26-2012, 05:01 PM)SilentStriker Wrote: It's because it's missing a }

Use this

void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}

void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{

}

He's not. There is already a closing bracket. It's something to do with the callback itself.


(This post was last modified: 01-26-2012, 05:06 PM by flamez3.)
01-26-2012, 05:05 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#7
RE: Beginner help :o

ok, im seeing a few errors here. I'll try one more time...

void OnStart()
{
AddEntityCollideCallBack("Player", "Script_Area1", "OpenCabinet", true, 1);
}


void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}



Try removing anything you dont really need for testing, just put a temporary lantern down and you should automatically start off with full oil, if not.


SetPlayerLampOil(100.0f)
(01-26-2012, 05:05 PM)flamez3 Wrote: If it says that it doesnt reconize AddEntityCollideCallback it either means you torrented the game and it doesnt have all the files or you need to space out the "" and the , Like this:

AddEntityCollideCallBack("Player", "Script_Area1", "OpenCabinet", true, 1);

(01-26-2012, 05:01 PM)SilentStriker Wrote: It's because it's missing a }

Use this

void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}

void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{

}

He's not. There is already a closing bracket. It's something to do with the callback itself.
and this shouldnt matter, he should still be able to run this function if it is used thousands of times in the normal game

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-26-2012, 05:09 PM by Tripication.)
01-26-2012, 05:08 PM
Find
FinBanana Offline
Junior Member

Posts: 29
Threads: 4
Joined: Jan 2012
Reputation: 0
#8
RE: Beginner help :o

Yeah, I tried it with

{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

and it told me about "unexpected token 'if'.


I do have all the needed files because i bought the game at frictionalgames.com
I tried it with and without the spaces between the " and , but still I get the same error. :/
EDIT: and yeah, I removed the part giving the lantern and still the same error.
Thanks anyway and thanks in advance.


(This post was last modified: 01-26-2012, 05:21 PM by FinBanana.)
01-26-2012, 05:19 PM
Find
Tripication Offline
Member

Posts: 172
Threads: 19
Joined: Dec 2011
Reputation: 6
#9
RE: Beginner help :o

(01-26-2012, 05:19 PM)FinBanana Wrote: Yeah, I tried it with

{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

and it told me about "unexpected token 'if'.


I do have all the needed files because i bought the game at frictionalgames.com
I tried it with and without the spaces between the " and , but still I get the same error. :/
Thanks anyway and thanks in advance.
do exactly that, with nothing else. So remove this


if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}



and have only this in your ENTIRE script for now.


void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}



void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}



That should work perfectly assuming all the names of the entities and areas are correct

[Image: speedart__2___yoshimitsu_by_kamofudge-d4yo6kk.png]
(This post was last modified: 01-26-2012, 05:23 PM by Tripication.)
01-26-2012, 05:22 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#10
RE: Beginner help :o

(01-26-2012, 05:08 PM)Tripication Wrote: ok, im seeing a few errors here. I'll try one more time...

void OnStart()
{
AddEntityCollideCallBack("Player", "Script_Area1", "OpenCabinet", true, 1);
}


void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}



Try removing anything you dont really need for testing, just put a temporary lantern down and you should automatically start off with full oil, if not.


SetPlayerLampOil(100.0f)
(01-26-2012, 05:05 PM)flamez3 Wrote: If it says that it doesnt reconize AddEntityCollideCallback it either means you torrented the game and it doesnt have all the files or you need to space out the "" and the , Like this:

AddEntityCollideCallBack("Player", "Script_Area1", "OpenCabinet", true, 1);

(01-26-2012, 05:01 PM)SilentStriker Wrote: It's because it's missing a }

Use this

void OnStart()
{
AddEntityCollideCallBack("Player","Script_Area1","OpenCabinet",true,1);
}

if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}

void OpenCabinet(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectState("cabinet_nice_1", 1);
}

//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{

}

He's not. There is already a closing bracket. It's something to do with the callback itself.
and this shouldnt matter, he should still be able to run this function if it is used thousands of times in the normal game

No matching signatures to 'AddEntityCollideCallBack(string@&, string@&, string@&, const bool, const uint)' means that his callback is not the correct callback, regardless if he used another one before.


01-26-2012, 05:24 PM
Find




Users browsing this thread: 1 Guest(s)