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 / Follow waypoint, no clip kill player on touch.

Author
Message
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 12th Nov 2008 05:01 Edited at: 12th Nov 2008 05:03
Wow that's a big title, I have a character that will follow waypoints, many characters will follow the waypoints and can bump into each other, I don't want that, so I thought Id have them have no collision, the trouble is that with no collision they fall through the floor.

This is the script I tried.




I also want them to kill the player on contact, havnt looked at that yet, Im still on the no clip/collision for enemies, I want my marching enemies like ghosts, they can walk through each other. what can I do here.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Nov 2008 06:35
That's a toughy...

Well, if that script is your main AI script, then you shouldn't need to use "runfpidefault=1".

I think what you can do to keep them from falling through the floor is turn their gravity off, and since they are following waypoints the entire time, that'll keep them from floating away.


To kill player on contact, you can check the player's distance from the entities and if the player is close enough, just use "plraddhealth" with a big negative number to kill them right away.




The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 12th Nov 2008 07:10 Edited at: 12th Nov 2008 07:25
Ill have a look into that gravity right now.

Also what I'm trying to do is have the enemy walk around a maze, this would be easy in engines with path finding, but fpsc doesn't have it, so we need waypoints, now I have waypoints in the centre of every square, (don't ask, its something experimental) the walls can come between way points, and the enemy will want to walk through a wall to another waypoint, it needs to check if walking to another way point has a segment obstacle, if so go to another waypoint, you could perhaps have it shoot an invisible gun that does no damage, then if the gun hits a target, (non player), it would have to do a test on how long it took to hit the wall, if it takes a short time, them a wall is in front, so it goes to a different waypoint, either that or it does a test to see how far something is, like it tests radius of a segment mesh, my game uses the same mesh throughout for the walls, then it could check how far that mesh is away, so if its less that 100 units away, it wont go in that direction.

Its an interesting problem, any ideas on this one, its all be it unorthodox I know.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Nov 2008 07:57
Well, I suppose you could try the following line to have your character turn around if it's about to hit a wall:


That'll basically say:
If I'm on my way to a waypoint and somethings in front of me that's 10 to 40 units away, turn around and go another way.





The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 12th Nov 2008 10:56 Edited at: 12th Nov 2008 11:18
This is the code I tried to have the ememy walk through other enemies, not sure if I did it right, result is the player is halfway through the floor walking on the spot.



There must be a way to have character walk through other stuff.

Gamer X
16
Years of Service
User Offline
Joined: 1st Feb 2008
Location: Planet X
Posted: 12th Nov 2008 13:04
When I did Ply's ghost entity challenge I used "floatrate=x". This had the enemy float up and down, but the entity did follow waypoints.


fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 12th Nov 2008 14:36 Edited at: 12th Nov 2008 14:40
I found your code below. I copied whats below in a script.


It worked , the character followed the waypoints, bobed up and down, and walked through the player. Fantastic, your a star, does the character do something with fading in and out, in the code is stuff for an alpha fade.

Ill have to try what Plystire said on it avoiding walls with this.

Ill copy it into the very bottom of your script and see what happens.

fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 12th Nov 2008 20:12
I put Plystires code into Gamer Xs code



Didnt work, it messed it up, I think it will be the position of it perhaps, or even that its the wrong waypoint number. Ive only just looked at .fpi and not gone though the tutorials enough, been too busy with graphics stuff.
It looks like it needs to be under waypoint=3 and written as waypointstate=4, instead of being listed as =2
then Id have to change the bottom two from
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
to
:waypointstate=5:animate=2,waypointrandom
:waypointstate=6:animate=2,waypointreverse
Is this correct?

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 13th Nov 2008 08:07
Well, it could also mean that the "reverse" won't take effect until they hit a waypoint.

If that's the case, then you have another option... IF the waypoint they just came from is always going to be the closest one to them when they run into a wall, you could try:

waypointstop,waypointstart

That would stop it in it's tracks and then have it restart by finding the "closest" waypoint.


But then again, FPSC has been known to confuse "Closest" with "Not so much closest".


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.

Login to post a reply

Server time is: 2024-11-24 16:43:52
Your offset time is: 2024-11-24 16:43:52