Can anyone PLEASE give me a simple instruction on a simple monster code

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Cybog

New Member
May 9, 2006
17
0
0
I've made classes and characters and triggers and scripts and I am about to go crazy.

I am doing a Single Player style map and I want my monsters to do one simple thing:

Stand still in an idle pose (or patrol a small area) and when I get close, attack me.

Is this so hard? Yes. I have had running questions on 4 or 5 forums for weeks now and nobody seems to be able to figure it out. Everyone has an "idea" how to do it, but nobody seems to be able to give me specific instructions to make this work. It seems that everyone who has made a successful Single Player map is either A) Doing it wrong or B) Isn't telling.

The problems:

1. Monster can sense me from half a map away, no matter what is between me and the monster. No matter what I change on his sight, hearing, alertness...etc. I have adjusted every known setting I can think of and yet he STILL attacks me.

2. I can script a monster and set his alertness to "Leave script for combat" and yet this does nothing. The monster either completely ignores me or does JUST the script movements and walks back and forth...back and forth....

What I want:

I am fairly new to the scripting and coding game, but if anyone can give me specific instructions on how to make a working mindless monster who DOESN'T smell blood from 4 maps away, I am all ears. Up to this point all I have are monsters who can see me though walls, objects, trees, and come straight for me no matter what.

Anyone...? Thank you for any help I can get!
 

Gibberstein

Killing Floor Code Monkey
Apr 29, 2006
17
0
0
killingfloor.freedomsnet.net
I'm afraid that this is quite a hard task. There isn't an easy fix, and as a beginning coder you are diving in at the deep end. I suspect you haven't had much luck getting help on this because it isn't a casual section of the game to modify

However, I can offer some starting points. Look at MonsterController.uc, and create your own subclass of it for your monsters. You'll need to define your own FindNewEnemy() that only finds enemies that the monster can see (this will stop the monster hunting the player down from the other side of the map). The other function worth looking at as a starting point is ExecuteWhatToDoNext() - this function is the main descision-making point in the AI code. From here (or one of the functions called from here) you can set what the monster does when it sees the player, and what it does when it can't find the player.

You might need to rope in a more experienced coder on this one if the above isn't making sense. Do you know any programmers that owe you a favour?
 

techbinge

New Member
Jan 16, 2006
26
0
0
San Diego
Don,

When I get my code a little more wrapped up this week I will take at a look at what you have and help you out. Let me know if you find a resolution any sooner.

-t