Frictional Games Forum (read-only)

Full Version: following statues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey there

again i need help at my cs.
I dont know if its possible, to make a script or something to make a statue following you. So what I mean is that every time I turn arround there is a statue behind me.
I cant just make it with script areas and active entity, the statue should "follow" you all over.

I think its not possible, but maybe one of you knows more.

Thx for reading,
Knusper.
Didn't you make a thread about this a couple of days ago?

I believe you'd have to create a new monster for this to happen. You would have to make a model for the statue and script it to only following you and not attack you. I'm not sure how good you are at scripting, but I would guess it will be very hard.
It really would be hard. Because i want the statue to not move.
It just all the time stands behind you.

Im really a beginner...
maybe someone has an idea, but i know that it maybe isnt possible.
Well, I would say the easiest way is to - just like you mentioned - place ScriptAreas and 'SetEntityActive'. You could also add a sound if you want the player to hear a noise. That could add some effect. This would be most effective in a corridor though.

I believe this would work:

Code:
void Onstart()
{
void AddEntityCollideCallback("player", "ScriptArea", "Func1", true or false, 1);
}


void Func1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Statue_1", true);
}

Just add as many that you want and match it up with the areas in the level editor.
yes, i made that at some part before that room.
But if you walk into the area from the other side, the statue will appear before you..
maybe its possible with if.
and then the script checks out, if the playber is in the right direction.
But thats really a lot of scripting and not that what i want to have.
It's definitely possible.
Check out the function 'SetEntityPlayerLookAtCallback' in the engine script page http://wiki.frictionalgames.com/hpl2/amn...s#entities

That gives you a way of checking if the player is looking in the right direction, so that you don't move the statue while they are looking at it.

Then it's just a case of setting up a lot of script areas and disabled statues, so that you can activate the right ones at the right time.
name the areas area_0, area_1,...
in each collide callback, save the area number ( thats the one you are currently in). lets say : string lastArea

now check: if areanumber > lastArea, make the statue appear at area lastArea

if areanumber < lastArea ( meaning you are walking back, depends on how you place the areas), make the statue appear at area areanumber+1

something like

Code:
string lastArea ="";

void Func1(string &in asParent, string &in asChild, int alState)
{
string areanumber = StringSub(asChild, 5, 1);
if areanumber > lastArea) SetEntityActive("statue at area lastArea",true)
if (areanumber < lastArea) SetEntityActive("statue at area areanumber+1",true)

lastArea = areanumber;
}
if areanumber > lastArea) SetEntityActive("statue at area lastArea",true)

but there i cant give a name to "statue at area lastArea".
If I go from area 0 to 1, I can let appear the statue at area 0.
But if i go 4 to 5, I have to let appear the statue at area 4...

so, do I didnt understand it???

I think there is a way to do it...
at "statue at area lastarea" I maybe can make a calculation like:
"statue_0 + lastArea"

But im a noob and i think thats not possible.
still a problem:
The active statues should disappear if a new one appears...
But that not that important
you could just name the statues the same as the areas
statue_0 is in area_0, statue_1 is in area_1 , and so on
I dont really get it Sad
there are some things they dont work in my eyes...
It would be really cool if someone makes an example map.
I know its much work, if one of you would make that with like 16 areas (or maybe 9), it could help me really much.
That would really be awesome.
But only if someone has the time...


still a problem:
The active statues should disappear if a new one appears...
But that not that important
Pages: 1 2