Sazureth
Junior Member
Posts: 20
Threads: 8
Joined: Jan 2012
Reputation:
0
|
List of Amnesia variables
Is there a list/a way to use some of the Amnesia's varibles?
While scripting, I find myself in situations where having an access to a variable like when a monster sees the player or not would come in really handy. So is it possible to use variables like the ones the monster AI uses, for example?
|
|
01-04-2012, 03:30 AM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
|
01-04-2012, 03:32 AM |
|
Sazureth
Junior Member
Posts: 20
Threads: 8
Joined: Jan 2012
Reputation:
0
|
RE: List of Amnesia variables
To say it briefly, I need to know when the monster can see the player so I can use it in the script, how can I do that?
(Something like using GetInt, but I need to know what's the name of the variable (in this case for the monster seeing the player), and I'm asking if there is a list of those variables the game engine uses, like there is a list of all the functions)
|
|
01-04-2012, 03:46 AM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: List of Amnesia variables
(01-04-2012, 03:46 AM)Sazureth Wrote: To say it briefly, I need to know when the monster can see the player so I can use it in the script, how can I do that?
(Something like using GetInt, but I need to know what's the name of the variable (in this case for the monster seeing the player), and I'm asking if there is a list of those variables the game engine uses, like there is a list of all the functions) I don't know if it's possible... BUT you can try. You have to create an "integer" so to speak... for example, at the top of the script, put something like "SetLocalVarInt("Monsternotice", 0);"
Then find a way to activate a script to check if the player has an enemy notice you. (perhaps a better scripter than I can figure out if that is possible) and have this in the function:
"AddLocalVarInt("Monsternotice", 1);"
And later put a script to check if the interger has been added to. Perhaps have it on a looping timer. Something like:
int GetLocalVarInt(SYNTAX TO FOLLOW FUNCTION)
{
if(GetLocalVarInt("Monsternotice") == 1)
{
//Function to call if he has noticed you
}
if(GetLocalVarInt("Monsternotice") == 0)
{
//Leave empty if the monster has not noticed.. Won't call any functions unless functions are put here.
}
}
(This post was last modified: 01-04-2012, 04:01 AM by Statyk.)
|
|
01-04-2012, 04:00 AM |
|
Sazureth
Junior Member
Posts: 20
Threads: 8
Joined: Jan 2012
Reputation:
0
|
RE: List of Amnesia variables
Thanks for the help, but I know how to do that.
The problem is only with HOW I check if the monster has noticed me, and I feel like the easiest way would be getting the integer the monster AI uses.
Checking the value is easy, but I need to know what to check =P
Maybe I'll download something like CheatEngine and see if it can list the engine integers form me? (And try if they actually work on the script)
|
|
01-04-2012, 04:12 AM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: List of Amnesia variables
That sounds handy. My guess would be something along the line of "hunt" or "enabled"...
|
|
01-04-2012, 04:16 AM |
|
Sazureth
Junior Member
Posts: 20
Threads: 8
Joined: Jan 2012
Reputation:
0
|
RE: List of Amnesia variables
Aaaand now while we're at it;
Could you tell me why my for-loop doesn't work in the void Patrol()?
It works if put inside void OnStart but not in Patrol. Calling the Patrol works fine, I'm sure of that (because the same area trigger a function that works)
void OnStart ()
{
AddEntityCollideCallback("Player", "test1", "Patrol", true, 1);
}
void Patrol()
{
SetEntityActive("servant_grunt", true);
for (int i = 1; i < 7; i++)
{
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_"+i, 0, "");
}
}
|
|
01-04-2012, 04:29 AM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: List of Amnesia variables
(01-04-2012, 04:29 AM)Sazureth Wrote: Aaaand now while we're at it;
Could you tell me why my for-loop doesn't work in the void Patrol()?
It works if put inside void OnStart but not in Patrol. Calling the Patrol works fine, I'm sure of that (because the same area trigger a function that works)
void OnStart ()
{
AddEntityCollideCallback("Player", "test1", "Patrol", true, 1);
}
void Patrol()
{
SetEntityActive("servant_grunt", true);
for (int i = 1; i < 7; i++)
{
AddEnemyPatrolNode("servant_grunt", "PathNodeArea_"+i, 0, "");
}
}
For one, You need a syntax after "void Patrol". Seeing as its an area collide, use this:
void Patrol(string &in asParent, string &in asChild, int alState)
|
|
01-04-2012, 04:34 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: List of Amnesia variables
As far as i know, the game doesn't expose that kind of information to scripts (though it can be clearly seen in game with certain info turned on). I tried working around the issue by attaching an object to the monster and detecting for collision, but that wasn't allowed either.
|
|
01-04-2012, 07:14 PM |
|
MrBigzy
Senior Member
Posts: 616
Threads: 18
Joined: Mar 2011
Reputation:
8
|
RE: List of Amnesia variables
Yea, you can change them, but only in the model editor.
Although, it might be possible. Jens explained before how to access internals of model scenes:
Quote:am not sure about the lantern as it is a bit special, but normally you can change stuff like lights in entities by NameOfEntity_NameOfBodyWithLightAttached_NameOfLight if that was not what you already tried to do.
|
|
01-04-2012, 07:33 PM |
|
|