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 / Run on Waypoints

Author
Message
Eggie
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 6th Apr 2012 07:41
Ok this is a really noobish queation, but how to have a character run on waypoints? I know there's no command, but I wrote animate=40 to use the guard run animation and set the speed higher, but it for some reason only uses the aimed move slow animation. Any help is appreciated
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 6th Apr 2012 14:44 Edited at: 6th Apr 2012 14:47
look in the scriptbank/people folder there is a follow.fpi
so the character follow the waypoints

if a character should do more, use the pace.fpi and use one of the shoot.fpi scripts
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 6th Apr 2012 19:44
run-animation of stockchars should be 5, not 40.

Eggie
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 7th Apr 2012 04:50
40 is still running, just in a different way and it doesn't work for either animations. My script is pretty simple.

I really don't see why it is not working right
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Apr 2012 05:55
It must be hard-coded to just walk the waypoints. I also think it is hard-coded for the npc to go to animation 0 wait waypointstop. I tried a variety of animations and they all make the npc just walk. I even indicated the various animations for the npc at waypoint stop. Even the walk animation will not work at the end. I thought perhaps he would still be in the walk animation but standing still. He just returns to animation 0.

So, the short of it. I don't think you will be able to make the npc run along the waypoints unless you modify the code itself.

Eggie
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 7th Apr 2012 06:58 Edited at: 7th Apr 2012 07:33
I'm pretty sure it's possible. I was messing around with scripting just a few days ago and my npcs were doing any animation I wanted them to do. I just can't remember how I got them to do that.

If there is another way to have a npc move from one point to the other using any animation please let me know. I know there's aiaddpoint, but it doesn't seem to work very well.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Apr 2012 15:08 Edited at: 7th Apr 2012 18:00
It is not possible to run on waypoints. If it were then it would work. I cannot get it to work. However, you can run to targets. You were only asking about waypoints. Here is the code to set and run to a target.



The etimer is used in this test so that the npc hesitates as the game starts so you can then watch the npc run to the target without missing some of it. BTW, I used the thug in the test and 5 is the running animation for the thug; 40 is not.

Addendum:

The target needs to be dynamic but it can be invisible.

Addendum #2:

If you want the npc to run from one target to another and then another you will have to time the npc to see how long it takes him to get to the target. Then you have to use a timer so that it delays that amount of time for the npc to get to the target before you have him/her run to the next target. See code.



Download contains a zipped folder of an fpm and the script for it. Place the map anywhere you want and the script in the scriptbank folder.

Attachments

Login to view attachments
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 7th Apr 2012 18:02

Attachments

Login to view attachments
Eggie
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location:
Posted: 8th Apr 2012 02:17
Thank you so much. This is exactly what i need
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 8th Apr 2012 02:20
Your welcome. I hope it works for you.

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 9th Apr 2012 04:07 Edited at: 9th Apr 2012 04:08
of course you can run the waypoints, you just have to alter the follow.fpi with animate 5/40 (think logic: exchange animate and waypoint-actions in the upper script. animation has to be declared before waypointaction is started, not afterwards. )

:waypointstate=0:animate=40,waypointstart
:waypointstate=3:animate=40,waypointnext
:waypointstate=5:animate=1,waypointstop

you can also edit runspeed, using movefore/runfore=x right before animate=x.

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 9th Apr 2012 04:48
Out of curiosity, did you try it yourself?

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 9th Apr 2012 05:55 Edited at: 9th Apr 2012 05:56
runs in my newest level on a boss. its a custom script, but set waypoints edited out of follow.fpi directly into the new script and change to animate=5. i will look into it if i had done anything special, but i dont think so (except maybe because i set runanim also directly in the appearscript, worth a try?).

but you ARE right, waypointstates dont allow exactly what normal states do. not all actions and command-combinations work with it.
ched80 and 2beastmode4u tried some scripts in pausing waypoints randomly to simulate a lazy guard, but they cant get it to work propperly for me... yet^^ i trust these 2 guys to get it done.

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 9th Apr 2012 11:08
I used the follow.fpi and changed the animat= to 5. Doesn't work. He still walks. Are you sure runanim is a command? I looked it up in the code and it returns that the text is not found.

I set the entity speed in the appear script:

:state=0:cullrange=500,setalphafade=100,setentityspeed=200,runfpidefault=1

Here is the revised follow script I used:



I delayed it so that I can catch the npc doing his thing.

Here is the map:




He walks fast but doesn't use the run animation which is #5 for the thug.

You're going to have to tell me exactly what script you used and show me the map before I believe you have it working correctly.

maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 11th Apr 2012 17:05 Edited at: 11th Apr 2012 17:09
hey flatlander, you were right. waypointstate dont allow to change animation, it uses the last called walk/run-anim declared (out of the appearscript in my described case).

but its easy to do, just put the animate=x into a normal state and add this state to the waypointstates:



didnt check any other animations like strafe or something, but should work,too.

have fun, gz & sorry for wrong info before.

maho

Jeannot74
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: France
Posted: 20th Apr 2012 19:46
Hi,

Waypoints works with an ennemy, but if I add one stair, he passes through.

How can I make my ennemy climb up ?

My OS is w7 pro 64
I run FPSC v1.19

Any help is welcome,

Best regards

Jean

Noob french
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 20th Apr 2012 22:38
characters follow waypoints, so if you want to make a stair usable, you have to set a waypoint up/down. Look into the manual in your docs-folder and sample-map in mapfolder. its described and shown there.

Jeannot74
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: France
Posted: 21st Apr 2012 11:13
Hi Maho76

Many thanks for your quick reply.
But I set waypoint up before posting as showing into he manual.

It works with a "normal" character but not with a DAI character. In this second case the character climbs the first 2 stairs, seems hesitate and then he passes through.

I did tests with many differents stairs, but I allways got the same results. Perhaps is a "bug" with DAI and waypoints ?

Someone has succeed to make DAI (ally or ennemy climb up) ?

Many thanks for your help,

Best regards,

Jean

PS : Maho76, your project is very impressive and it looks very professional. Bravo !!!

Noob french
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 21st Apr 2012 18:44
I'd like to see the script that is being used.

Jeannot74
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: France
Posted: 22nd Apr 2012 14:46
Hi flatlander,

in attachment the script (is quite simply)!!

Many thanks for your reply,

I use FPS V1.19 WITHOUT mod

Best regards

Jean

PS : Later I post a link for the simply test map that doesn't work

Thanks in advance,

Noob french

Attachments

Login to view attachments
Jeannot74
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: France
Posted: 22nd Apr 2012 16:08
Hi flatlander,

Here attach, the simple map if you want do tests,

Best regards,

Jean

Noob french

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 23:51:11
Your offset time is: 2024-11-23 23:51:11