Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 5 Vote(s) - 3.8 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting, need urgent help!
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#97
RE: Scripting, need urgent help!

(07-27-2011, 03:54 AM)Kyle Wrote:
(07-27-2011, 03:50 AM)xiphirx Wrote: Uhm... where's your syntax?

SetEntityCollideCallback should be in a function, not out on its own.

After you declare a function header you need to open brackets ( {} ) and encapsulate your commands within it...

Excuse you smart ass, of course it should be in a function. He's going to have to replace SetEntityCallbackFunc("notethree", "Func"); with SetEntityCollideCallback("Player", "notethree", "Func", true, 1); so it should already be in a function. -_-

*sigh*


JetlinerX:

You don't have any form to your code...
}
SetEntityCollideCallback("Player", "notethree", "Func", true, 1);
void Func(string &in asEntity, string &in type)
if(type == "OnPickup")
{
PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_pant5.snt", "Player", 0, false);
StartPlayerLookAt(string& Player,3,3,"");
AddTimer("atticscare", 1, "Func2");
}

Is what you posted.

SetEntityCollideCallback("Player", "notethree", "Func", true, 1);

Should be inside of one of the predefined functions (something like OnEnter) not out on its own (global scope, which basically means its not contained within brackets)

So...
void OnEnter()
{
    SetEntityCollideCallback("Player", "notethree", "Func", true, 1);    
}

Like that.

Now, moving on...
void Func(string &in asEntity, string &in type)
if(type == "OnPickup")
{
PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_pant5.snt", "Player", 0, false);
StartPlayerLookAt(string& Player,3,3,"");
AddTimer("atticscare", 1, "Func2");
}

You're missing the brackets for the function here:
void Func(string &in asEntity, string &in type)
{
    if(type == "OnPickup")
    {
        PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0, false);
        PlaySoundAtEntity("", "react_pant5.snt", "Player", 0, false);
        StartPlayerLookAt(string& Player,3,3,"");
        AddTimer("atticscare", 1, "Func2");
    }
}

(as a side note, you always want to indent your code, it makes it easier to read)

also, you have an error in your "StartPlayerLookAt" function call...
StartPlayerLookAt(string& Player,3,3,"");

you don't need to include the type of value when you pass it as a parameter, this is why you do it in the function's declaration or prototype.

StartPlayerLookAt("Player", 3.0f, 3.0f, "");

Overall, I would REALLY suggest just getting the basics down of C++, syntax wise as it seems to be your only problem...

07-27-2011, 05:37 AM
Find


Messages In This Thread
Scripting, need urgent help! - by JetlinerX - 07-20-2011, 03:20 AM
RE: Scripting, need urgent help! - by xtron - 07-20-2011, 04:04 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-20-2011, 04:15 AM
RE: Scripting, need urgent help! - by xtron - 07-20-2011, 06:31 AM
RE: Scripting, need urgent help! - by MrCookieh - 07-20-2011, 09:58 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-20-2011, 02:58 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-20-2011, 03:11 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-20-2011, 03:22 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-21-2011, 12:08 AM
RE: Scripting, need urgent help! - by MrCookieh - 07-21-2011, 09:56 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 10:00 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 10:28 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-23-2011, 10:34 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 10:38 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 10:45 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-23-2011, 10:48 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 10:53 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 11:01 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-23-2011, 11:04 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-23-2011, 11:07 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-23-2011, 11:14 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 12:00 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 12:21 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 12:36 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 12:49 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 01:30 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 01:53 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 02:13 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 02:34 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 02:55 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 03:01 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 03:10 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 03:28 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 03:41 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 03:58 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 04:06 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 04:16 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 04:27 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 04:35 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 04:51 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 05:18 AM
RE: Scripting, need urgent help! - by DRedshot - 07-24-2011, 05:28 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 05:42 AM
RE: Scripting, need urgent help! - by MrCookieh - 07-24-2011, 09:08 AM
RE: Scripting, need urgent help! - by DRedshot - 07-24-2011, 12:19 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-24-2011, 04:01 PM
RE: Scripting, need urgent help! - by seth1466 - 07-25-2011, 06:20 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 06:21 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 06:31 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 06:34 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-25-2011, 06:40 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 06:45 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-25-2011, 06:50 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 06:52 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-25-2011, 07:03 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 07:07 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-25-2011, 07:12 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-25-2011, 07:23 PM
RE: Scripting, need urgent help! - by MrCookieh - 07-25-2011, 08:58 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 03:21 AM
RE: Scripting, need urgent help! - by Kyle - 07-27-2011, 03:31 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 03:46 AM
RE: Scripting, need urgent help! - by xiphirx - 07-27-2011, 03:50 AM
RE: Scripting, need urgent help! - by Kyle - 07-27-2011, 03:54 AM
RE: Scripting, need urgent help! - by xiphirx - 07-27-2011, 05:37 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 03:52 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 03:56 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 06:40 AM
RE: Scripting, need urgent help! - by xiphirx - 07-27-2011, 06:52 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 06:59 AM
RE: Scripting, need urgent help! - by MrCookieh - 07-27-2011, 11:15 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 04:30 PM
RE: Scripting, need urgent help! - by xiphirx - 07-27-2011, 06:24 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 06:33 PM
RE: Scripting, need urgent help! - by xiphirx - 07-27-2011, 06:41 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 06:46 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 08:57 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-27-2011, 11:15 PM
RE: Scripting, need urgent help! - by JetlinerX - 07-28-2011, 04:37 AM
RE: Scripting, need urgent help! - by seth1466 - 07-28-2011, 05:33 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-28-2011, 05:34 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-29-2011, 12:58 AM
RE: Scripting, need urgent help! - by Apjjm - 07-29-2011, 01:11 AM
RE: Scripting, need urgent help! - by DRedshot - 07-29-2011, 01:06 AM
RE: Scripting, need urgent help! - by xiphirx - 07-29-2011, 01:51 AM
RE: Scripting, need urgent help! - by Apjjm - 07-29-2011, 02:04 AM
RE: Scripting, need urgent help! - by xiphirx - 07-29-2011, 02:37 AM
RE: Scripting, need urgent help! - by Apjjm - 07-29-2011, 03:01 AM
RE: Scripting, need urgent help! - by JetlinerX - 07-29-2011, 04:16 AM
RE: Scripting, need urgent help! - by JetlinerX - 08-17-2011, 05:31 PM
RE: Scripting, need urgent help! - by darkside - 08-20-2011, 11:28 AM
RE: Scripting, need urgent help! - by Kyle - 08-20-2011, 12:59 PM
RE: Scripting, need urgent help! - by JetlinerX - 08-20-2011, 03:19 PM



Users browsing this thread: 2 Guest(s)