JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
|
Variables?
I want to make it so when i enter an area, after I have entered a different area, something happens. I know how to make it happen when you enter an area and something happens, but what about I just said? I think this includes variables, does it not?
:Work In Progress:
Insanity
(This post was last modified: 07-21-2011, 09:00 PM by JoeBradleyUK.)
|
|
07-21-2011, 08:23 PM |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
RE: Variables?
You can activate area 2 when you enter area 1
You don't need any variables here
|
|
07-21-2011, 08:41 PM |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
RE: Variables?
It does. Here you go, edit it to fit what you're doing:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Func01", true, 1);
SetLocalVarInt("Var01", 0);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
AddLocalVarInt("Var01", 1);
Func02();
}
void Func02()
{
if (GetLocalVarInt("Var01") == 2)
{
// Do whatever you want after the player collides with both areas.
}
}
Or was I mistaken? :/
(This post was last modified: 07-21-2011, 08:42 PM by Kyle.)
|
|
07-21-2011, 08:41 PM |
|
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
|
RE: Variables?
(07-21-2011, 08:41 PM)MrCookieh Wrote: You can activate area 2 when you enter area 1
You don't need any variables here
Oh I never thought of that, thanks, so could you use an example of variables and show how it works, so I don't have to ask in the future?
Edit: what is the script function Of setting an area active? I can't find one that seems suitable!
:Work In Progress:
Insanity
(This post was last modified: 07-21-2011, 08:51 PM by JoeBradleyUK.)
|
|
07-21-2011, 08:44 PM |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
RE: Variables?
Never used variables in Amnesia.
It's quite confusing for me how Amnesia handles variables, because I got other experiences with variables.
Anyways, I think Kyle's script should work
|
|
07-21-2011, 08:51 PM |
|
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
|
RE: Variables?
(07-21-2011, 08:51 PM)MrCookieh Wrote: Never used variables in Amnesia.
It's quite confusing for me how Amnesia handles variables, because I got other experiences with variables.
Anyways, I think Kyle's script should work
Ok, but still do you know the script function of activating areas? Because areas arn't entities so I don't know.
:Work In Progress:
Insanity
|
|
07-21-2011, 08:56 PM |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
RE: Variables?
the same like entities
SetEntitiyActive("Areaname", true);
|
|
07-21-2011, 08:58 PM |
|
JoeBradleyUK
Member
Posts: 115
Threads: 20
Joined: Jul 2011
Reputation:
0
|
RE: Variables?
(07-21-2011, 08:58 PM)MrCookieh Wrote: the same like entities
SetEntitiyActive("Areaname", true);
Oh. Alright thanks for your help. And yours too Kyle
:Work In Progress:
Insanity
|
|
07-21-2011, 09:00 PM |
|
|