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 following statues
Knusper. Offline
Member

Posts: 58
Threads: 7
Joined: Feb 2013
Reputation: 2
#1
following statues

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.

No one knows, how "I" goes.
02-28-2013, 05:14 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#2
RE: following statues

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.
02-28-2013, 06:01 PM
Find
Knusper. Offline
Member

Posts: 58
Threads: 7
Joined: Feb 2013
Reputation: 2
#3
RE: following statues

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.

No one knows, how "I" goes.
02-28-2013, 06:09 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#4
RE: following statues

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:

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.
(This post was last modified: 02-28-2013, 06:21 PM by Tiger.)
02-28-2013, 06:13 PM
Find
Knusper. Offline
Member

Posts: 58
Threads: 7
Joined: Feb 2013
Reputation: 2
#5
RE: following statues

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.

No one knows, how "I" goes.
(This post was last modified: 02-28-2013, 08:12 PM by Knusper..)
02-28-2013, 08:12 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#6
RE: following statues

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.

03-01-2013, 01:59 AM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#7
RE: following statues

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

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;
}
(This post was last modified: 03-01-2013, 11:53 AM by darksky.)
03-01-2013, 11:48 AM
Find
Knusper. Offline
Member

Posts: 58
Threads: 7
Joined: Feb 2013
Reputation: 2
#8
RE: following statues

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

No one knows, how "I" goes.
(This post was last modified: 03-01-2013, 03:18 PM by Knusper..)
03-01-2013, 03:08 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#9
RE: following statues

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
03-01-2013, 03:17 PM
Find
Knusper. Offline
Member

Posts: 58
Threads: 7
Joined: Feb 2013
Reputation: 2
#10
RE: following statues

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

No one knows, how "I" goes.
03-01-2013, 03:35 PM
Find




Users browsing this thread: 1 Guest(s)