Frictional Games Forum (read-only)
Making an enemy chase you on level start? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Making an enemy chase you on level start? (/thread-6045.html)



Making an enemy chase you on level start? - Robby - 01-04-2011

I've encountered something that I can't seem to know here:
I want to know how can I make an enemy run on a full sprint to the player. To be more understandable, when I make an enemy with the editor, it just stands there. I want to make it run towards me on full speed (like the Chase scene in the Sewer level). But I just don't know how to do it.

Anyone can help?


RE: Making an enemy chase you on level start? - Oscar House - 01-04-2011

ShowEnemyPlayerPosition("GRUNT_NAME");


RE: Making an enemy chase you on level start? - Robby - 01-04-2011

Ok, where should I put it? I'm new and I may sound like a n00b. I just started working with this.


RE: Making an enemy chase you on level start? - Som1Lse - 01-04-2011

Then add it to the OnStart event.
If you don't have a OnStart event then read this.


RE: Making an enemy chase you on level start? - Robby - 01-04-2011

Now this made a big problem. I've added it, read in HPL2 Documentation for two hours. And I've set up what I needed to, but when I set up the development environment, (which means it will launch my map directly) the .hps file (script) is giving me an error.

My enemy is a servant grunt named "Junk" I've set it up so that when the map starts the grunt would start to run at me on full speed. But I keep getting an error which says it can't run the file itself and gives this error:
"main (12, 29) : ERR : "Junk" is not declared"

Now what does that mean?! (Removing the script line from void OnStart() makes the game launch the map with no problems.)

Now my script file consists only of the "ShowEnemyPlayerPosition" line, but it won't work with that line present. Any help?

EDIT: NVM. Fixed it. Some spaces have caused a problem and the game gave in. Now it works perfectly. I'm starting to do a small mod. But I barely have at least 1% knowledge in modding. But now I'm working on a mod known as "Floating Midway". You'll find out more about it on one of the threads in Showcase.


RE: Making an enemy chase you on level start? - Frontcannon - 01-04-2011

(01-04-2011, 06:16 PM)Nemet Robert Wrote: "main (12, 29) : ERR : "Junk" is not declared"

It looks like you forgot to put Junk in quotes, it usually says that when it finds a string it doesn't know like Junk.


RE: Making an enemy chase you on level start? - Robby - 01-04-2011

(01-04-2011, 06:41 PM)Frontcannon Wrote:
(01-04-2011, 06:16 PM)Nemet Robert Wrote: "main (12, 29) : ERR : "Junk" is not declared"

It looks like you forgot to put Junk in quotes, it usually says that when it finds a string it doesn't know like Junk.

I DID put the "Junk" into quotes. But never mind. Already fixed it. Some spaces in the } and { ruined everything. But now I'm working on a mod with the knowledge I gained.