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
Custom Story Editor Crowbar Puzzle
Author Message
Mad Aztec Offline
Junior Member

Posts: 6
Joined: Jun 2011
Reputation: 0
Post: #1
Custom Story Editor Crowbar Puzzle

Hi, I would want to know how to make the same crowbar puzzle as in TDD in Daniel's Room. I checked another thread where they said that look at the map from TDD but I don't understand anything. Could you please help me? Me and my friend got a great idea for a custom story.
06-21-2011 04:19 PM
Find all posts by this user Quote this message in a reply
Streetboat Online
Posting Freak

Posts: 1,004
Joined: Mar 2011
Reputation: 52
Post: #2
RE: Custom Story Editor Crowbar Puzzle

How much scripting knowledge do you have? You need to do some trickery involving switching out several crowbar entities, placing areas in such a way to detect the crowbar 'joint' so it properly plays the effects. It's a fairly simple puzzle to script, fortunately. All it does is unlock the door and give it a push, play some dust effects, and voila.

[Image: signature-2.png]
06-21-2011 06:52 PM
Find all posts by this user Quote this message in a reply
Nye Offline
Member

Posts: 249
Joined: Jan 2011
Reputation: 2
Post: #3
RE: Custom Story Editor Crowbar Puzzle

Do a search; I remember following a very detailed thread that told me everything I needed to know.

(This post was last modified: 06-21-2011 06:57 PM by Nye.)
06-21-2011 06:57 PM
Find all posts by this user Quote this message in a reply
rojkish Offline
Junior Member

Posts: 45
Joined: Jun 2011
Reputation: 0
Post: #4
RE: Custom Story Editor Crowbar Puzzle

You should make an area where to put the crowbar firstly;

AddEntityCollideCallback("Crowbar_1", "AreaPutCrowbar", "crowbar", true, 1);
AddEntityCollideCallback("Crowbar_1", "Door or whatever", "crowbar", true, 1);

Then make an area so that it happens a function when the crowbar_joint touches the area;

AddEntityCollideCallback("crowbar_joint", "AreaBreakDoor", "break", true, 1);

Spoiler below!

void crowbar(string &in asParent, string &in asChild, int alState)
{
RemoveItem("crowbar_1"); //If you want to remove it
SetEntityActive("crowbar_joint", true); //I think it's name is crowbar_joint, if it's not, tell
}

void break(string &in asParent, string &in asChild, int alState)
{
*Do you function here, either if you wanna unlock a door or break some planks.
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
}


So now you have three areas to put out, one for the place where to put the crowbar(AreaPutCrowbar), one which the joint touches(break), and one which the breakeffect happens(BreakEffect)

Don't forget to put the crowbar_joint whereever you want it and put the active box to not true
06-21-2011 06:58 PM
Find all posts by this user Quote this message in a reply
Mad Aztec Offline
Junior Member

Posts: 6
Joined: Jun 2011
Reputation: 0
Post: #5
RE: Custom Story Editor Crowbar Puzzle

Oh god guys...should have told you, absolutely NO scripting education.Confused
I know nothing of scripting, I should have known custom story making wasn't THAT easy. Could you like make some scripts for me or something?
That would be very helpful.Big Grin
06-21-2011 07:15 PM
Find all posts by this user Quote this message in a reply
rojkish Offline
Junior Member

Posts: 45
Joined: Jun 2011
Reputation: 0
Post: #6
RE: Custom Story Editor Crowbar Puzzle

Alright, so first create three script areas, one which name is AreaPutCrowbar, one which name is break, one which name is BreakEffect. When this is done adjust the size of the three of them to your liking, AreaPutCrowbar should be pretty big since this is where you're supposed to put the crowbar there, break is where the entity crowbar_joint should "hit" (crowbar_joint is a item which can be dragged), so when it is dragged to a certain area (break) a function happens, BreakEffect can be small however, since it's only to create a particle system.

After that use this script;

Spoiler below!


AddEntityCollideCallback("Crowbar_1", "AreaPutCrowbar", "CrowbarAppear", true, 1);
AddEntityCollideCallback("Crowbar_1", "YOUR DOOR NAME", "CrowbarAppear", true, 1);

AddEntityCollideCallback("Crowbar_joint", "break", "BreakDoor", true, 1);

void CrowbarAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Crowbar_joint", true);
RemoveItem("Crowbar_1");
}

void BreakDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("YOUR DOOR NAME", false, false);'
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
PlaySoundAtEntity("", "break_wood", "BreakEffect", 0.0, false);
SetEntityActive("Crowbar_joint", false);
SetEntityActive("crowbar", true); //THIS SHOULD BE A CROWBAR ENTITY ONLY (NOT ITEM, NOT JOINT (name it crowbar)
}



Be sure to rename "YOUR DOOR NAME" to whatever your door is named, also add a entity called crowbar_joint (also name it crowbar_joint) and set in to inactive and make sure it can reach the break area. You can make this even better if you add a crowbar entity (no item or joint) and make a Prop impulse to the door so it looks like you've broken the lock
(This post was last modified: 06-21-2011 09:13 PM by rojkish.)
06-21-2011 08:55 PM
Find all posts by this user Quote this message in a reply
WatzUpzPeepz Offline
Member

Posts: 106
Joined: May 2011
Reputation: 0
Post: #7
RE: Custom Story Editor Crowbar Puzzle

Yup,that was prob my thread I was quite annoyed when people replied like that but after looking at the game files I found it. Confused
Spoiler below!
void OnStart()
{AddUseItemCallback("", "key2", "door2", "KeyOnCellarDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("crowbarondoor", "crowbar_1", "mansion_1","UseCrowbarOnDoor", true);
}

void UseCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer(asEntity, 0.2, "TimerSwitchShovel");
PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);

//Remove callback incase player never touched door
SetEntityPlayerInteractCallback("mansion_1", "", true);
SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true);

RemoveItem(asItem);
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("attachshovel","puzzle_place_jar.snt", asTimer, 0, false);

SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoostSmall();

PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);

SetSwingDoorLocked("mansion_1", false, false);
SetSwingDoorDisableAutoClose("mansion_1", true);
SetSwingDoorClosed("mansion_1", false,false);

PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);
AddPropImpulse("mansion_1", -3, 0, 0, "world");

SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);

AddTimer("pushdoor", 0.1, "TimerPushDoor");

AddDebugMessage("Break door!", false);
}
void TimerPushDoor(string &in asTimer)
{
AddPropImpulse("mansion_1", -1, 2, -4, "world");
AddTimer("doorclose", 1.1, "TimerDoorCanClose");
}

void TimerDoorCanClose(string &in asTimer)
{
SetSwingDoorDisableAutoClose("mansion_1", false);
}


After that just copy the areas and their names,and make sure the areas are in the right position or it wont break the door.

06-21-2011 09:17 PM
Find all posts by this user Quote this message in a reply
Mad Aztec Offline
Junior Member

Posts: 6
Joined: Jun 2011
Reputation: 0
Post: #8
RE: Custom Story Editor Crowbar Puzzle

Something wonderful has happened, I kinda figured it out! Big Grin
The only problem is I can't like pull in the crowbar so that the door pops open, I can only use the crowbar on the door and then it opens. So, I guess i figured out how to open doors with keys too Tongue
Thx for your help guys.
(This post was last modified: 06-22-2011 07:26 AM by Mad Aztec.)
06-22-2011 07:26 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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