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 some more help with my custom story!
Zaapeer Offline
Junior Member

Posts: 32
Threads: 9
Joined: Dec 2011
Reputation: 0
#1
Need some more help with my custom story!

Okay, so I've come to a part in my custom story where the player is supposed to cross like a big hole in the ground. In order to do so he needs to but a plank over it to be able to walk over. Now here's my problem: How do you make it so that when the plank touches a special area it automatically changes into a static object and places itself over the hole? I appreciate all the help I can can get, thanks! Smile
10-21-2012, 09:03 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Need some more help with my custom story!

You mean that when the entity collides with an area despawns and automatically spawns the static_object or that the entity moves by itself and then it despawns and spawns the static object?

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-21-2012, 09:11 PM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#3
RE: Need some more help with my custom story!

Well this is one way.

First put this script in your hps. Put it in Void OnEnter for example.

void OnEnter()
{
AddEntityCollideCallback("ENTITYNAME", "AREANAME", "SCRIPT", false, 1);
}

Make an script area over to your "hole". And the board you want to be as a bridge. Make that board non active and check the "StaticPhysics" box.

Next we need the script to continue like this.

void SCRIPT(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ENTITYNAME", false);
SetEntityActive("your_static_board", true);
}

Now thats simply it. So here is the whole script spiced with a little puzzlemusic and sanity gain. You can of course leave them out of your script if you wan't. Smile Hopefully I was any help for you.

void OnEnter()
{
AddEntityCollideCallback("ENTITYNAME", "AREANAME", "SCRIPT", false, 1);
}

void SCRIPT(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ENTITYNAME", false);
SetEntityActive("your_static_board", true);
PlayMusic("12_puzzle_cavein.ogg", false, 1.0, 0, 1, true);
GiveSanityBoost();
}

(This post was last modified: 10-21-2012, 11:09 PM by TeamSD.)
10-21-2012, 11:08 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#4
RE: Need some more help with my custom story!

Way too complicated, just place a sticky area, put the name of the plank into AttachableBodyName and uncheck CanDetach. You may want to play around with the values and add AttachSounds or whatever you want.

Done.

[Image: 18694.png]
10-21-2012, 11:48 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: Need some more help with my custom story!

(10-21-2012, 11:48 PM)Ongka Wrote: Way too complicated, just place a sticky area, put the name of the plank into AttachableBodyName and uncheck CanDetach. You may want to play around with the values and add AttachSounds or whatever you want.

Done.
I wanted to say this with method 2.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-22-2012, 06:41 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#6
RE: Need some more help with my custom story!

(10-22-2012, 06:41 AM)The chaser Wrote:
(10-21-2012, 11:48 PM)Ongka Wrote: Way too complicated, just place a sticky area, put the name of the plank into AttachableBodyName and uncheck CanDetach. You may want to play around with the values and add AttachSounds or whatever you want.

Done.
I wanted to say this with method 2.
Your post was lacking an explanation how to do it and when entities collide with a sticky area and CanDetach is deactivated, they don't despawn and spawn a static object, it simply disables the interaction for the specific entity.

[Image: 18694.png]
10-22-2012, 09:19 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Need some more help with my custom story!

I know, but it's how I usually do it. Everyone has it's ways.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-22-2012, 09:28 AM
Find
Dutton Offline
Member

Posts: 121
Threads: 3
Joined: Apr 2012
Reputation: 2
#8
RE: Need some more help with my custom story!

Relevent for my current project! thank you Smile

[Image: 15isy6C]
10-22-2012, 09:59 AM
Find
Zaapeer Offline
Junior Member

Posts: 32
Threads: 9
Joined: Dec 2011
Reputation: 0
#9
RE: Need some more help with my custom story!

Thank you guys for all the help! Smile
10-24-2012, 12:48 AM
Find




Users browsing this thread: 6 Guest(s)