Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Why is the AI kinda afraid to shoot player?

Author
Message
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing:
Posted: 13th Jul 2020 15:14
Ok so i'm making a cool level, and the enemies with cover10.fpi as their shoot script literally turn me into swiss cheese when player pops out of a wall, but then there's the enemies with chase10.fpi which barely shoot me, and they mostly strafe left or right. what's going on??
I'm using pace10.fpi as their main script and chase10.fpi as their shoot script. How do i make them shoot more and walk less?
hi, i'm a random guy who's making random games with random game engines for random reasons
Ghost_LOL
5
Years of Service
User Offline
Joined: 20th Jan 2019
Location:
Posted: 14th Jul 2020 16:41 Edited at: 14th Jul 2020 16:46
you don't need 2 scripts per enemy, unless u really know what u doing Put chase10 in main and leave shootscript blank, there should be some difference, pace, pace10 and pacedelayed is for following waypoints; Sometimes when enemy got 2 scripts instead of one they can break each other
Ghost_LOL
5
Years of Service
User Offline
Joined: 20th Jan 2019
Location:
Posted: 14th Jul 2020 16:44 Edited at: 14th Jul 2020 16:58
also try to play with rate of fire in properities - it got funky name, but it's just normal variable that can be adjusted, and weird thing I discovered is - in some scripts higher rate of fire = more enemy shooting; but in some other scripts its the other way around, it depends how the script is constructed (and in some scripts it doesn't make a difference at all, you must check where script got command "rateoffire" to see how it's used, it also works for melee attacks)
Scripting manuals says:
Quote: "RATEOFFIRE
Description: Is true if an entity’s “Rate of fire” parameter is ≥ 100, or is
randomly true if the following formula equals 0: RandomValue x (100-
RateOfFire), where the RandomValue can be any fraction between 0 and 1.
Example: :rateoffire:state=1
"

So its kinda complicated ;p
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing:
Posted: 16th Jul 2020 12:38
Thanks a lot, that worked!
hi, i'm a random guy who's making random games with random game engines for random reasons
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing:
Posted: 16th Jul 2020 13:34 Edited at: 16th Jul 2020 14:07
However, i got a new problem. There are some bugs that happen with chase10.fpi as main script, the first one being that some enemies sometimes appear in different parts of the map, like the very beginning of the level where there are supposed to be no enemies but when i start test game they are already shooting at the player. Also once when i started the test game a floating enemy gun appears, that drops to the ground after 1 second passed, very weird. The second bug is that some enemies just stand until they are shot at, then they begin to attack me.
EDIT: I fixed the first bug by making the enemies not spawn at start of level and by setting them to spawn when player enters a specific part of the map
hi, i'm a random guy who's making random games with random game engines for random reasons
Ghost_LOL
5
Years of Service
User Offline
Joined: 20th Jan 2019
Location:
Posted: 16th Jul 2020 16:12 Edited at: 16th Jul 2020 16:23
Quote: " The second bug is that some enemies just stand until they are shot at, then they begin to attack me"

The question is - It happens always or on big map with many enemies and objects?
FpsC even with BIM is very sensitive to dynamic objects with scripts, and from what I've seen - your maps are quite big and got a lot of dynamic objects with physic on. That's a lot of stress on the engine, and sometimes it just cant run everything at the same time, that's why some enemies react very slow. When you got powerful pc, you might not be noticing slowdowns, but try to make your map lighter, and you should see some difference.

Another thing that might be helpful is modifying the script. Open it, and you can easily adjust some values, so enemy would see, and react to player from further distances. I modified chase10 by adjusting plrdistfurther and plrdistwithin to higher values, so enemies react from far far away, but that's working bug-free only when engine isn't very stressed.
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing:
Posted: 16th Jul 2020 18:11 Edited at: 16th Jul 2020 18:11
I made a small map and put some enemies with chase10.fpi as their main script, and some enemies just stood still until i walk up to them.
hi, i'm a random guy who's making random games with random game engines for random reasons
Ghost_LOL
5
Years of Service
User Offline
Joined: 20th Jan 2019
Location:
Posted: 16th Jul 2020 19:12
hmm how many enemies you setting up at once in the room?
they got always active= yes?
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing:
Posted: 16th Jul 2020 19:18
i put 2 enemies in the rooms, and they have always active = yes.
hi, i'm a random guy who's making random games with random game engines for random reasons
Ghost_LOL
5
Years of Service
User Offline
Joined: 20th Jan 2019
Location:
Posted: 16th Jul 2020 19:32
well that's hard to tell, I can put 4 or 5 enemies at once in a room, all got main chase10 and they all attacking like there is no tomorrow ;p maybe you can try to change View Cone Angle to something around 85, it's very low in stock characters, last thing I'm always changing is "Physic on?=No" - It changes nothing in character behavior but I guess the less physic the better for optimization Other than that I really can only guess what causes your problem
ScooT9
7
Years of Service
User Offline
Joined: 29th Mar 2017
Playing:
Posted: 16th Jul 2020 19:54
Well changing the View cone angle to 85 actually worked! Thanks!
hi, i'm a random guy who's making random games with random game engines for random reasons

Login to post a reply

Server time is: 2024-04-25 17:16:17
Your offset time is: 2024-04-25 17:16:17