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 / waypointstart + followplr

Author
Message
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 5th Jul 2010 11:36 Edited at: 5th Jul 2010 11:41
I am working on a script for melee enemies.

Since attacking the player is always done with rotatetoplr,movefore=x they tend to get stuck at doorframes or other obstacles as the enemy AI appearantly has no pathfinding.

I tried to work around with this with followplr but it works very unreliable. And if it works, it seems the enemies are at walk speed only. I know of ifplrtrail but have no idea when the engine decides that the player left a trail.

I also tried to call waypointstart when plrcannotbeseen=1 to *unstuck* enemies, but it doesn't work at all:
Sometimes they run against the wall obviously trying to get to the waypoint on the other side if it is the nearest and if they actually reach a wapoint, then they stop right there - it seems they don't start to use waypointstate again, once waypointstop is called, even if waypointstart is called again

So my questions are:
a)
Can anybody shed some light onto the followplr command regarding how the engine decides, that there is a trail,and in which way that trail resembles the actual player movement?
b)
Is there a way to get an enemy, who's script called the waypointstop command to check for waypointstate again, and start to walk waypoints again within the same script?

In case you find my grammar and spelling weird ---> native German speaker ^^
Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 5th Jul 2010 11:55
a)
Quote: "Can anybody shed some light onto the followplr command regarding how the engine decides, that there is a trail,and in which way that trail resembles the actual player movement?"


U can set entitydebug on in setup.ini. And u will see ur trail.
Enemy will simply folow that.

b)
Hmm, not sure what u mean, but there is a openfpi...command.

The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 5th Jul 2010 12:56
Thanks for the tip with the entitydebug @RedEye!

Quote: "Hmm, not sure what u mean, but there is a openfpi...command."

I guess you mean runfpi, yeah I thought about that too.

Maybe it's possible to have the waypointmode in the MAIN fpi, and call the SHOOT fpi, once the playercanbeseen or shotdamage condition is true. And within the SHOOT fpi I could insert runfpi=main, once certain conditions are true - this should bring the entity into *waypoint mode* again.

I can't test it right now but so far it seems my best bet.

In case you find my grammar and spelling weird ---> native German speaker ^^
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Jul 2010 01:06
You'd be better off with rundefaultfpi (Or something like that) to have it run the Main AI. That way you won't have to hard-script (lol) the name of your main script into your shoot script.


The one and only,


The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 6th Jul 2010 03:26
Good thinking Plystire - thanks!

In case you find my grammar and spelling weird ---> native German speaker ^^
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 6th Jul 2010 11:52 Edited at: 6th Jul 2010 11:54
To sum it up:

SHOOTPLR -> runs the internal FPI script SHOOT specified in character properties

RUNFPIDEFAULT=X -> run a default FPI script by value X (0-init,1-main,2-end)

Examples:

From pace10.fpi :

Quote: "
:state=2:waypointstop,rotatetoplr,state=3,shootplr
:state=3:animate=1,state=1"


From shoot10.fpi :

Quote: "
:state=0,plrcanbeseen:state=1,settarget
:losetarget=10:runfpidefault=1
:state=0:runfpidefault=1"


This could also be handy if you want to do very complex things with a civil npc and put stuff into the shoot script which you don't want to have in the main script to keep the code more clear...
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 6th Jul 2010 11:57
Hey, I didn't think about loosetarget so far

Thanks a lot!

In case you find my grammar and spelling weird ---> native German speaker ^^

Login to post a reply

Server time is: 2024-11-24 21:21:07
Your offset time is: 2024-11-24 21:21:07