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
Script Help Teleporting-Naked-Guy Help
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#1
Teleporting-Naked-Guy Help

So I wanted my script to run a function that will activate and launch a corpse out of a cabinet once the player gets killed by a patrolling grunt. Once I die and enter my script area infront of the cabinet nothing happens.

/////////////////////////////////////////////////////////////////////////////////////////

// On map start //
void OnStart()
{
    AddUseItemCallback("", "Storage_Room_Key", "Storage_Room_Door", "Open_Storage_Room", true);
    // Storage Room Key //
    AddEntityCollideCallback("Player", "poofer_spawn_01", "poofer_spawn_script_01", true, 1);
}

void poofer_spawn_script_01(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("*C1", "*C1_spawn", "*FunctionToCall*", "DeathHints", "Hide");

   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_1", 0.001, "");
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_2", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_3", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_4", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_5", 0.001, "");
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_6", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_7", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_8", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_9", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_10", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_11", 0.001, "");    
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_12", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_13", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_14", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_15", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_16", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_17", 0.001, "");  
   AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_18", 1.000, "");
   SetEntityActive("poofer_grunt_01", true);
}

void FunctionToCall(string &in asName, int alCount)
{
AddEntityCollideCallback("Player", "Teleport_Script", "Nail_That_Sucker01", true, 1);
}

void Open_Storage_Room(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("Storage_Room_Door", false, true);
    PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
    RemoveItem("Storage_Room_Key");
}

void Nail_That_Sucker01(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("Naked_Guy01", true);
    AddPropForce("Naked_Guy01", -10000, 0, 0, "world");
    PlaySoundAtEntity("", "24_iron_maiden.snt", "Naked_Guy01", 0, false);
}

// On Entering map //
void OnEnter()
{

}
// On Leaving map //
void OnLeave()
{

}

[Image: 15420.png]
07-05-2014, 12:04 AM
Find
Gilligan's Hell Offline
Posting Freak

Posts: 851
Threads: 17
Joined: Feb 2012
Reputation: 36
#2
RE: Teleporting-Naked-Guy Help

...


RETHINK YOUR LIFE'S DECISION.

The International Narcotics Traffic
07-05-2014, 12:25 AM
Find
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#3
RE: Teleporting-Naked-Guy Help

Okk? Fuck you too then, I thought this was a forum for help not a "Lets all crucify the guy on his first map" forum

[Image: 15420.png]
07-05-2014, 12:30 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Teleporting-Naked-Guy Help

Oh, come on people, while I agree that it's a very cheap and bad jumpscare, let this guy do whatever he wants, it's his CS...

I think it will be fixed with this:


/////////////////////////////////////////////////////////////////////////////////////////

// On map start //
void OnStart()
{
AddUseItemCallback("", "Storage_Room_Key", "Storage_Room_Door", "Open_Storage_Room", true);
// Storage Room Key //
AddEntityCollideCallback("Player", "poofer_spawn_01", "poofer_spawn_script_01", true, 1);
}

void poofer_spawn_script_01(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("C1", "C1_spawn", "FunctionToCall*", "DeathHints", "Hide");

AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_1", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_3", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_5", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_6", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_7", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_8", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_9", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_10", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_11", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_12", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_13", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_14", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_15", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_16", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_17", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_18", 1.000, "");
SetEntityActive("poofer_grunt_01", true);
}

void FunctionToCall(string &in asName, int alCount)
{
AddEntityCollideCallback("Player", "Teleport_Script", "Nail_That_Sucker01", true, 1);
}

void Open_Storage_Room(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Storage_Room_Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("Storage_Room_Key");
}

void Nail_That_Sucker01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Naked_Guy01", true);
AddPropForce("Naked_Guy01", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Naked_Guy01", 0, false);
}

// On Entering map //
void OnEnter()
{

}
// On Leaving map //
void OnLeave()
{

}


THIS IS THE SCRIPT, IGNORE THE PREVIOUS

/////////////////////////////////////////////////////////////////////////////////////////

// On map start //
void OnStart()
{
AddUseItemCallback("", "Storage_Room_Key", "Storage_Room_Door", "Open_Storage_Room", true);
// Storage Room Key //
AddEntityCollideCallback("Player", "poofer_spawn_01", "poofer_spawn_script_01", true, 1);
}

void poofer_spawn_script_01(string &in asParent, string &in asChild, int alState)
{
CheckPoint ("C1", "C1_spawn", "FunctionToCall", "DeathHints", "Hide");

AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_1", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_2", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_3", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_4", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_5", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_6", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_7", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_8", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_9", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_10", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_11", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_12", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_13", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_14", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_15", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_16", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_17", 0.001, "");
AddEnemyPatrolNode("poofer_grunt_01", "PathNodeArea_18", 1.000, "");
SetEntityActive("poofer_grunt_01", true);
}

void FunctionToCall(string &in asName, int alCount)
{
AddEntityCollideCallback("Player", "Teleport_Script", "Nail_That_Sucker01", true, 1);
}

void Open_Storage_Room(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Storage_Room_Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("Storage_Room_Key");
}

void Nail_That_Sucker01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Naked_Guy01", true);
AddPropForce("Naked_Guy01", -10000, 0, 0, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "Naked_Guy01", 0, false);
}

// On Entering map //
void OnEnter()
{

}
// On Leaving map //
void OnLeave()
{

}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 07-05-2014, 12:40 AM by The chaser.)
07-05-2014, 12:33 AM
Find
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#5
RE: Teleporting-Naked-Guy Help

Nope, that doesnt work either

ok, im trying the second one.

Still doesnt work.

[Image: 15420.png]
(This post was last modified: 07-05-2014, 12:53 AM by CQBgamer.)
07-05-2014, 12:49 AM
Find
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#6
RE: Teleporting-Naked-Guy Help

We all start somewhere, and even if you have original ideas you start by learning the tech.

My first ever map was for Duke Nukem 3D and was just a big room full of strippers and tripwire bombs. That was cheap. The Trapdoor has a naked corpse in a closet. The reason: it was my first Amnesia mod/CS and I'd only ever played highly rated mods previously - I wasn't aware of the clichés. Although, he doesn't actually fly out.

CQB, my advice is to make your flying naked guy and your poofers. Enjoy it, use it as a learning experience and then take what you've learned and use the knowledge to create original set pieces.

07-05-2014, 12:55 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Teleporting-Naked-Guy Help

I'm in my mobile so sorry if theres any typo:

By what i see, the script doesnt crash, its just that the corpse doesnt spawn. Does the sound play?

If it doesnt, check names: its very easy to make mistakes or typos. (Remain to save everytime, i once were 2 hours wondering why my code didnt work and I hadnt saved it)

Well said, Behemoth Smile

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 07-05-2014, 01:00 AM by The chaser.)
07-05-2014, 12:59 AM
Find
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#8
RE: Teleporting-Naked-Guy Help

Nope the sound doesnt play, Im thinking it might just be an issue with it triggering as from the checkpoint's function callback. Im making another map ATM and just coding the jumpscare using the same code (Just the jumpscare codes, nothing else) To see if that works.

[Image: 15420.png]
07-05-2014, 01:05 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#9
RE: Teleporting-Naked-Guy Help

Yeah, if the sound doesnt play it must be the callback. Remain to remove any .map_cache if there is.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
07-05-2014, 01:13 AM
Find
CQBgamer Offline
Junior Member

Posts: 40
Threads: 8
Joined: Jul 2014
Reputation: 0
#10
RE: Teleporting-Naked-Guy Help

Wrote a new code on a different map
void OnStart ()
{
    AddEntityCollideCallback("Player", "TeleportScript", "NailThatSucker", true, 1);
}

void NailThatSucker(string &in asParent, string &in asChild, int alStates)
{
    SetEntityActive("Naked_Guy", true);
    AddPropForce("Naked_Guy", -10000, 0, 0, "world");
    PlaySoundAtEntity("", "24_iron_maiden.snt", "Naked_Guy", 0, false)
}

Still doesnt work.

[Image: 15420.png]
07-05-2014, 01:35 AM
Find




Users browsing this thread: 3 Guest(s)