Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script fail
Author Message
Dizturbed Offline
Member

Posts: 160
Joined: Jun 2011
Reputation: 0
Post: #1
Script fail

My code wont work Confused

void OnStart()
{
AddEntityCollideCallback("Player", "HitDoor", "Creepy", true, 0);
}
void Creepy(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_hit_wood", "HitArea", false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "HitArea_1", false);
PlayGuiSound("hit_wood1.ogg", 7.0f);
PlayGuiSound("hit_wood1.ogg", 7.0f);
PlaySoundAtEntity("", "21_scream9", "Creep", 0, false);
StartPlayerLookAt("cellar_wood01_slow_1", 10.0f, 10.0f, "");
AddTimer("Timer", 1.0f, "NoLook");
}
void NoLook(string &in asTimer)
{
StopPlayerLookAt();
}
Help a scripter out? =)

-Dizturbed

08-01-2011 09:05 PM
Find all posts by this user Quote this message in a reply
Rapture Offline
Posting Freak

Posts: 986
Joined: May 2011
Reputation: 28
Post: #2
RE: Script fail

AddEntityCollideCallback("Player", "HitDoor", "Creepy", true, 0);

change the 0 to 1.
(This post was last modified: 08-01-2011 09:11 PM by Rapture.)
08-01-2011 09:11 PM
Find all posts by this user Quote this message in a reply
Dizturbed Offline
Member

Posts: 160
Joined: Jun 2011
Reputation: 0
Post: #3
RE: Script fail

Nope.. Did not work : /

08-01-2011 09:17 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #4
RE: Script fail

Define "did not work."

Tutorials: From Noob to Pro
08-01-2011 09:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Dizturbed Offline
Member

Posts: 160
Joined: Jun 2011
Reputation: 0
Post: #5
RE: Script fail

It wont do anything, no errors, nothing, it just plays on like I haven't scripted at all.

08-01-2011 09:25 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #6
RE: Script fail

Is HitDoor an Area of type Script?

Tutorials: From Noob to Pro
08-01-2011 09:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Dizturbed Offline
Member

Posts: 160
Joined: Jun 2011
Reputation: 0
Post: #7
RE: Script fail

It's an Area

08-01-2011 09:30 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,475
Joined: Jul 2011
Reputation: 234
Post: #8
RE: Script fail

(08-01-2011 09:30 PM)Dizturbed Wrote:  It's an Area

... of type Script?

Tutorials: From Noob to Pro
08-01-2011 09:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Rapture Offline
Posting Freak

Posts: 986
Joined: May 2011
Reputation: 28
Post: #9
RE: Script fail

Check the name of the Area and make sure it matches up with your script or just copy the entire thing and paste it into the script to be 100% sure.
08-01-2011 09:36 PM
Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 482
Joined: Apr 2011
Reputation: 49
Post: #10
RE: Script fail

Try the following to debug your code. You want to look at the debug messages to see what is happening to the code. E.g if all 3 are showing up, then the error is in the function calls in the callback. If 2 are showing up somwhere in the callback an exception is being produced. If only 1 shows up then your collision callback isn't being triggered. If none show up, the hps file is not being loaded.
void OnStart()
{
AddEntityCollideCallback("Player", "HitDoor", "Creepy", true, 0);
AddDebugMessage("OnStart Finished",false);
}
void Creepy(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Callback Triggered",false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "HitArea", false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "HitArea_1", false);
PlayGuiSound("hit_wood1.ogg", 7.0f);
PlayGuiSound("hit_wood1.ogg", 7.0f);
PlaySoundAtEntity("", "21_scream9", "Creep", 0, false);
StartPlayerLookAt("cellar_wood01_slow_1", 10.0f, 10.0f, "");
AddTimer("Timer", 1.0f, "NoLook");
AddDebugMessage("Callback Finished",false);
}
void NoLook(string &in asTimer)
{
StopPlayerLookAt();
}

Remember, everything is case sensitive Wink.

(This post was last modified: 08-01-2011 10:53 PM by Apjjm.)
08-01-2011 09:48 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)