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


Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script problem
KillerFlo Offline
Junior Member

Posts: 1
Threads: 1
Joined: Jun 2012
Reputation: 0
#1
Script problem

Whats wrong with this Script ? Sad


// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("ITEM", "OnPickup");
}
void UsedKeyOnDoor(string &in asitem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key-tomb_1");


void OnPickup(string &in asEntity, string &in type)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
PlaySoundAtEntity("", "00_faint.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt_1", true);
}


// Run when entering map

void OnEnter()
{

}
////////////////////////////

// Run when leaving map

void OnLeave()

{
06-16-2012, 04:27 PM
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#2
RE: Script problem

  • I don't see any pathnodes for the grunt.

Hi.
06-16-2012, 05:29 PM
Website Find
Nice Offline
Posting Freak

Posts: 3,812
Threads: 37
Joined: Jan 2012
Reputation: 153
#3
RE: Script problem

(06-16-2012, 04:27 PM)KillerFlo Wrote: Whats wrong with this Script ? Sad


// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("ITEM", "OnPickup");
}
void UsedKeyOnDoor(string &in asitem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key-tomb_1");


void OnPickup(string &in asEntity, string &in type)
{
after the RemoveItem line you forgot to close it with bracket...

so it should look like

void UsedKeyOnDoor(string &in asitem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key-tomb_1");
}


Sorry but we cannot change your avatar as the new avatar you specified is too big. The maximum dimensions are 80x80 (width x height)
06-16-2012, 05:49 PM
Find




Users browsing this thread: 1 Guest(s)