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
NEED HELP!!! plz answer.
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#1
NEED HELP!!! plz answer.

I dont know what im doing wrong. This stuff is confusing.
all i want is a door to close behind me and my character to spin around and look at it. Heres the my script for it. The game keeps giving me an error when i try to start up the map.

Spoiler below!

////////////////////////////
// Run first time starting map
void OnStart()

{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "exitkey_1", "metal_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam, true, 1);
}

void Collidedoorslam(string &in asParent, string &in asChild, int alState)

{
StartPlayerLookAt("castle_2", 6, 8, "");
SetSwingDoorClosed("castle_2". true, true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("exitkey_1");
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)

{
SetEntityActive("servant_grunt_1" , true);
}


WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-11-2011, 03:43 AM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#2
RE: NEED HELP!!! plz answer.

What is the error message?

04-11-2011, 04:03 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#3
RE: NEED HELP!!! plz answer.

AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam, true, 1);

You're missing a ". This is why I made that thread about scripting errors, these errors are so common. Tongue

Also:

SetSwingDoorClosed("castle_2". true, true);

A period instead of a comma D:
(This post was last modified: 04-11-2011, 04:12 AM by MrBigzy.)
04-11-2011, 04:11 AM
Find
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#4
RE: NEED HELP!!! plz answer.

(04-11-2011, 04:11 AM)MrBigzy Wrote: AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam, true, 1);

You're missing a ". This is why I made that thread about scripting errors, these errors are so common. Tongue

Also:

SetSwingDoorClosed("castle_2". true, true);

A period instead of a comma D:

thx i got it too work. But i want the character to gasp or get scared. and also how do i make him stop staring at the door when its done.

WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-11-2011, 04:49 AM
Find
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#5
RE: NEED HELP!!! plz answer.

(04-11-2011, 04:49 AM)ZxBrad Wrote: thx i got it too work. But i want the character to gasp or get scared. and also how do i make him stop staring at the door when its done.
Your'e looking for these:
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
void AddTimer(string& asName, float afTime, string& asFunction);
void StopPlayerLookAt();
04-11-2011, 09:47 AM
Find
ZxBrad Offline
Member

Posts: 140
Threads: 29
Joined: Mar 2011
Reputation: 0
#6
RE: NEED HELP!!! plz answer.

(04-11-2011, 09:47 AM)Dalroc Wrote:
(04-11-2011, 04:49 AM)ZxBrad Wrote: thx i got it too work. But i want the character to gasp or get scared. and also how do i make him stop staring at the door when its done.
Your'e looking for these:
void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
void AddTimer(string& asName, float afTime, string& asFunction);
void StopPlayerLookAt();

Thx, but where would i put these in my script and also what would i know what to place them with?

Spoiler below!
////////////////////////////
// Run first time starting map
void OnStart()

{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "exitkey_1", "metal_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam", true, 1);
}

void Collidedoorslam(string &in asParent, string &in asChild, int alState)

{
StartPlayerLookAt("castle_2", 6, 8, "");
SetSwingDoorClosed("castle_2", true, true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("exitkey_1");
}

void MonsterFunc1(string &in asParent , string &in asChild , int alState)

{
SetEntityActive("servant_grunt_1" , true);
}


WARNING: Noob Doesn't Know How To Script.
[Image: xcn384.gif]

04-12-2011, 02:38 PM
Find




Users browsing this thread: 1 Guest(s)