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 What if player leaves level without lantern?
jamistara Offline
Junior Member

Posts: 21
Threads: 7
Joined: Nov 2012
Reputation: 0
#1
What if player leaves level without lantern?

Hi! I started creating custom story called : Unconscious : Prelude .
I have a problem, that when the game starts, there is lantern in front of player. What if player doesnt take lantern and goes trough level door??! Thats my problem. Would someone send me complete script, because i tried to script it but i just doesnt work! Help guys, please!!!
11-12-2012, 04:41 PM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#2
RE: What if player leaves level without lantern?

Make an area at some point (just befor the door or something) and and put the leveldoor or swingdoor at locked and so when the player touches the area you activate (unlock with swingdoor) the unactive leveldoor that does teleport you to the next map. if you know what I mean. use this script you do have to fill in some names though but I'll highlighted them.
Spoiler below!

OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "haslantern", true, 1);
}
void haslantern(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Lantern"))
{
SetEntityActive("THEOPENABLEDOORNAME", true);
SetEntityActive("THENOTWORKINGDOOR", false);
}
}

all you have to do further is to put a message on the not opanable door that says something like"I think I should take the lantern with me" if you have any questions be sure to ask Big Grin

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
11-12-2012, 04:54 PM
Find
jamistara Offline
Junior Member

Posts: 21
Threads: 7
Joined: Nov 2012
Reputation: 0
#3
RE: What if player leaves level without lantern?

(11-12-2012, 04:54 PM)Steve Wrote: Make an area at some point (just befor the door or something) and and put the leveldoor or swingdoor at locked and so when the player touches the area you activate (unlock with swingdoor) the unactive leveldoor that does teleport you to the next map. if you know what I mean. use this script you do have to fill in some names though but I'll highlighted them.
Spoiler below!

OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "haslantern", true, 1);
}
void haslantern(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Lantern"))
{
SetEntityActive("THEOPENABLEDOORNAME", true);
SetEntityActive("THENOTWORKINGDOOR", false);
}
}

all you have to do further is to put a message on the not opanable door that says something like"I think I should take the lantern with me" if you have any questions be sure to ask Big Grin
Its fine, but if i try the door before taking lantern, i will not open Thats Good!!! But when i take lantern after that, the door will not open anymore. My english is not good, but hope you understand, tell me if you not Big Grin

(11-12-2012, 05:35 PM)jamistara Wrote:
(11-12-2012, 04:54 PM)Steve Wrote: Make an area at some point (just befor the door or something) and and put the leveldoor or swingdoor at locked and so when the player touches the area you activate (unlock with swingdoor) the unactive leveldoor that does teleport you to the next map. if you know what I mean. use this script you do have to fill in some names though but I'll highlighted them.
Spoiler below!

OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "haslantern", true, 1);
}
void haslantern(string &in asParent, string &in asChild, int alState)
{
if(HasItem("Lantern"))
{
SetEntityActive("THEOPENABLEDOORNAME", true);
SetEntityActive("THENOTWORKINGDOOR", false);
}
}

all you have to do further is to put a message on the not opanable door that says something like"I think I should take the lantern with me" if you have any questions be sure to ask Big Grin
Its fine, but if i try the door before taking lantern, i will not open Thats Good!!! But when i take lantern after that, the door will not open anymore. My english is not good, but hope you understand, tell me if you not Big Grin
I meant IT will not open Big Grin
(This post was last modified: 11-12-2012, 05:36 PM by jamistara.)
11-12-2012, 05:35 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: What if player leaves level without lantern?

You should have the level door start off as locked, and have the locked message inform the player that the lantern is needed to progress. Then use an interaction callback on the lantern to unlock the door when the player picks up the lantern.

Tutorials: From Noob to Pro
11-12-2012, 05:51 PM
Website Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#5
RE: What if player leaves level without lantern?

(11-12-2012, 05:51 PM)Your Computer Wrote: You should have the level door start off as locked, and have the locked message inform the player that the lantern is needed to progress. Then use an interaction callback on the lantern to unlock the door when the player picks up the lantern.

Damn that's way easier. I think I was just thinking to complicated at the moment.

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 11-12-2012, 06:25 PM by Steve.)
11-12-2012, 06:17 PM
Find
jamistara Offline
Junior Member

Posts: 21
Threads: 7
Joined: Nov 2012
Reputation: 0
#6
RE: What if player leaves level without lantern?

(11-12-2012, 06:17 PM)Steve Wrote:
(11-12-2012, 05:51 PM)Your Computer Wrote: You should have the level door start off as locked, and have the locked message inform the player that the lantern is needed to progress. Then use an interaction callback on the lantern to unlock the door when the player picks up the lantern.
Hey thanks to you all! It works now, and i can continue my custom story ! You are awesome Big Grin Big Grin
Damn that's way easier. I think I was just thinking to complicated at the moment.
11-12-2012, 06:36 PM
Find




Users browsing this thread: 1 Guest(s)