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 / activate entity waypoint mooving with script

Author
Message
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 4th Aug 2006 11:00
hi!
i searched on the forum but i don't found a solution to my pbs, so i write this post.

i have an entity. i would like when i press enter (on a swith), my entity start to start to move to waypoint and stop to other waypoint. i thinked to use the benjamin script for discussion, and replace command, but i'm sorry i don't understand to modify this script: this the script of benjamin, i tried to modify but it doesn't work. can you help me please?

;Original created by Benjamin Aeilkema
;modified by trotter

;Header

desc = game conversation

;Walk up to an character and...nothing happens. You have to use the "action" button to make him speak.
;When the user presses enter once more, the last message will display.
;Sounds come after pressing enter.

;Triggers

:state=0:hudreset,hudx=50,hudy=50,hudimagefine=H:\Program Files\The Game Creators\FPS Creator Demo\Files\texturebank\user\heouimerdier.png,hudname=talk1,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=H:\Program Files\The Game Creators\FPS Creator Demo\Files\texturebank\user\jevoispas.png,hudname=talk2,hudhide=1,hudmake=display
:state=0:hudreset,hudx=50,hudy=50,hudimagefine=H:\Program Files\The Game Creators\FPS Creator Demo\Files\texturebank\user\toddetbill.png,hudname=talk3,hudhide=1,hudmake=display,state=10

:state=10,plrdistwithin=160:rotatetoplr
:state=10,,plrusingaction=1:rotatetoplr,hudshow=talk1,timerstart,state=12
:state=12,timergreater=500:hudfadeout=talk1,state=14
:state=14,ALWAYS:timerstart,state=15,sound=[path to a sound]
:state=15,timergreater=500:state=20

:state=20,plrdistwithin=160:rotatetoplr
:state=20,,plrusingaction=1:rotatetoplr,hudshow=talk2,timerstart,state=22
:state=22,timergreater=500:hudfadeout=talk2,state=24
:state=24,ALWAYS:timerstart,state=25,sound=[path to a sound]
:state=25,timergreater=500:state=30

:state=30,plrdistwithin=160:rotatetoplr
:state=30,,plrusingaction=1:rotatetoplr,hudshow=talk3,timerstart,state=32
:state=32,timergreater=500:hudfadeout=talk3,state=34
:state=34,ALWAYS:timerstart,state=35,sound=[path to a sound]
:state=35,timergreater=500:state=10

:state=2,plrdistfurther=60:state=10

;End of Script

thank you very much for help
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 5th Aug 2006 18:13
ok so i think my pbs is not clear!
so, i would like to animate a character. i have two waypoint.
start and end
when i use the script "follow", my caracter moove automaticaly at start point to end point and reverse . i would like to find a solution when i press enter key, my caracter moove at the start point to the end point, and i want it stop automatically to end point.

please if someone have a solution it will very cool, because i don't understand the script! i tried but it doesn't work.
i post the follow script, and if someone can give me the solution how to modify this script, it's very cool.
___________________________________________________________________
;Artificial Intelligence Script

;Header

desc = Follow Waypoints

;Triggers

:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse

;End of Script
__________________________________________________________________
thank you very much.
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 5th Aug 2006 19:07
Quote: "
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse"


change the bottom line to

:waypoint state=5:animate=1,freeze

"It's often better to keep your mouth shut and let people think you're an idiot, than to open it and confirm their suspisions" - Noel Coward
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 5th Aug 2006 19:49
thank you very much butter finger for your help. i'ts very nice

i have an other question, can you help me with this?
it si possible to include line, when i press enter key, i would like my entity start to move. is it possible?
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 5th Aug 2006 20:05
yeah make this your code.

[/code]

:state=0,plrusingaction=1:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:animate=2,waypointreverse
[code]

Glad to be of help. Seriously tho, I taught myself all the scripting I know from just reading the manual, and watching the behaviour of the scripts. It's not that hard, just play with stuff, and like maths, try and keep things as simple as possible.

Peace

Butters

"It's often better to keep your mouth shut and let people think you're an idiot, than to open it and confirm their suspisions" - Noel Coward
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 5th Aug 2006 20:20
thanks butter finger. i's very cool

i try now.

thanks
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 5th Aug 2006 23:03
butter i have a pbs with the script, my caracter dont move, i dont know why, can you help me?
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 6th Aug 2006 11:43
hi butter finger!
i use your script, and it's cool, when i press enter key my entity moove but i dont want reverse at the end of waypoint, so i replaced the last line of the script by
state=1,waypointstate=5:animate=1,freeze

but my entity don't moove

i tried too the commands waypointstop but it's the same thing my entity don't moove.

can you help me to stop my entity at the end of waypoint?
___________________________________________________________________
this is the script: my entity is the scientist
whis this script it doesnt moove

:state=0,plrusingaction=1:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
state=1,waypointstate=5:animate=1,freeze

___________________________________________________________________
with this script my entity moove, but reverse at the end of waypoint

:state=0,plrusingaction=1:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:animate=2,waypointreverse

how change the last line to stop my entity at the end of waypoint?

thank you very much for help
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 6th Aug 2006 12:59
:state=0,plrusingaction=1:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:state=2
:state=2:animate=1,freeze.

Im not sure if that will work. I don't know why it didn't work before, but hey, hopefully that will be ok now!

"It's often better to keep your mouth shut and let people think you're an idiot, than to open it and confirm their suspisions" - Noel Coward
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 6th Aug 2006 14:28
one more time thank you very much for your help, it's very very nice.
bye
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 6th Aug 2006 18:16
thank you for your help butter but i still have pbs with this script.

i tried to modify your script butter to try various things!
i found this :

desc = Follow stop

;Triggers

:state=0,plrusingaction=1:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:state=2
:state=2,waypointstate=5:animate=2


this script work for when you press enter key the entity start to move : its ok
but it stop at the first waypoint and not at the end of the waypoint. i don't understand

IF SOMEONE PLEASE CAN HELP ME WITH THIS SCRIPT BECAUSE IT's VERY IRRITATING.

thank you very much
uman
Retired Moderator
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 7th Aug 2006 20:16
David Thomas,

Nice to see someone having a go in depth and not giving up.

You really need a more complex script than that if you want characters to do precisley what you want, when you want them to.

I would suggest that you study every script in the scriptbank folder that utilises paths for characters to follow and see how they are set up.

Try getting one thing to work first and not get too complicated.

So get your first action right : that is the start along the path.

Done that - yes - now try and stop and think logically how you achieve the next objcetive in script.

Keep a backup copy of your script at differing stages so when you get the first part done - make a copy of it so you can always go back to it after making a cpy of course. Then add the next bit of script - test it if it works save it and make a back up and so on.

One thing at a time is the way to get there and you will if you keep at it.

Heres a tip :

You really need to have a main body part to the script as most default scripts will have.

So once you have your character moving along the path - you need to use the actions/commands you can see in the manual or default character scripts to tell the character to go to the next waypoint.

For example :

:state=yourstate2,plrdistfurther=900,timergreater=100:settarget,animate=2,waypointstart,waypointnext,rotatetotarget,movetotarget,state=yourstate3
:state=yourstate3,plrdistwithin=500:settarget,animate=1,waypointstop,rotatetoplr,resthead,sound=audiobank\user\people\yoursound2.ogg,state=yourstate40

Something like that anyway

This is just an example of how a script might be set up to control a character that moves along a path from A to B and stops at B and if the player gets near he will also speak to the player.

Its not complete just an example showing commands and actions that can be used to achieve your objective.

Play around with making up a script using these and other available commands and you will get there.

Dont forget to susbtitute your own states and ref to any sound files as have just placed markers and you may not need or want the dist refs.

If you study this script snippet and other scripts around the forum and the default FPSC ones you can see that the relative commands and actions are fairly simple to understand so for instance : movetotarget being a common english term is self explanitory - stringing commands/actions together should mean a character will follow them and carry out the commands one after another so you can make them do what you want - yes. Well, yes but with some practice and a lot of trial and error sometimes.

Theres a scripting tutorial in the relevant forum by Bullshock I believe which is a great starting point. Everyone should read it.

I did - not that I can remember any longer what it says.



"I am and forever will be your friend"
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 7th Aug 2006 22:13
whaooo! uman really, i want to thank you very very much to take a time to write this explain for me. it's realy very nice of your part. thank you very much.

i will take a time to study your explain.
i'm french and sometimes it's difficult for me but i will take a time and i tell you.

have a nice day

bye uman
uman
Retired Moderator
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 8th Aug 2006 00:09 Edited at: 8th Aug 2006 00:11
Youre very welcome.


I can see you are very keen to learn. I wish you much success with your projects.

Hopefully when FPSC gets and update AI behaviours will be a little better and easier to set up for everyone.

I have scripts that can do some or all of what you want but they contain numerous other beahaviors so would not be useable unless you edited them extensively to leave just the parts you wanted. If you dont understand well how scripts work they would just get messed up altogether.

As said just get your characetr do one thing at a time - then do the next - its much less confusing than trying to write a complete script for numerous behaviours all at once if you are new to it - or even experienced too for that matter.

Dont panic and keep a cool head - thinking logically. If you get frustrated - take a break. It sometimes helps.

Good luck.



"I am and forever will be your friend"
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 8th Aug 2006 01:34
thanks for your advices, your welcome and your help.
see you uman
uman
Retired Moderator
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 8th Aug 2006 01:50
Let us know how you get on



"I am and forever will be your friend"
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 8th Aug 2006 15:52
hi human!

i searched all the night, i tried various options of commands with manual for change the script, but i don't found the solution. if you can help me one more time it's very cool!

Thank you very much

this modification that i made but doesn't work.
;Artificial Intelligence Script

;Header

desc = Follow Waypoints

;Triggers

:state=0,plrusingaction=1:state=1
:state=1,waypointstate=0:animate=2,waypointstart
:state=1,waypointstate=3:animate=2,waypointnext
:state=1,waypointstate=4:animate=2,waypointrandom
:state=1,waypointstate=5:state=2
:state=2,timergreater=0:animate=2,waypointstart,waypointnext,state=3
:state=3,plrdistwithin=0:animate=1,waypointstop
;End of Script
uman
Retired Moderator
20
Years of Service
User Offline
Joined: 22nd Oct 2004
Location: UK
Posted: 8th Aug 2006 16:31
I may sort something relating to paths and post it for general use by all users.

It wont be for a while though as I am far too busy working and I am not definately promising it.

In the meantime I suggest if you dont get a solution then you take a break from this and work on some other part for your game.



"I am and forever will be your friend"
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 9th Aug 2006 20:18
"I am far too busy working and I am not definately promising it"

no pbs , i found the solution.
thanks
Mr noob
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location:
Posted: 9th Aug 2006 20:39
sorry, david thomas,but did you ever find out how to make the character stop, walking when he reaches the waypoint path, if so could you post the script cause i am having difficulty with it

sorry if all my post annoyed anyone, didn't know i was a hassle
David Thomas
18
Years of Service
User Offline
Joined: 26th Mar 2006
Location: FRANCE
Posted: 10th Aug 2006 13:04
ok mr noob no problem if i can help you it's cool.

i'm not a developer, so this script is a result of various trials that i made, but that work for me. this is the script

;Triggers

:state=0,plrusingaction=1:state=1,sound=audiobank\user\takeaseat.wav,timerstart

:waypointstate=0,state=1:animate=2,waypointstart

:waypointstate=2,random=20:rotateheadrandom=45

:waypointstate=3,state=1:animate=1,timerstart,resethead,state=2

:waypointstate=3,state=2,random=20:rotateheadrandom=60
:waypointstate=3,state=2,timergreater=0:animate=2,waypointnext,state=1

:waypointstate=4,state=1:animate=1,timerstart,resethead,state=3

:waypointstate=4,state=3,random=20:rotateheadrandom=60
:waypointstate=4,state=3,timergreater=0:animate=1,freeze

:waypointstate=5,state=1:animate=1,timerstart,resethead,state=4

:waypointstate=5,state=4,random=20:rotateheadrandom=60
:waypointstate=5,state=4,timergreater=0:animate=2,waypointreverse,state=6
:state=6,plrdistwithin=160:rotatetoplr
:state=7,plrusingaction=1:state=8
:state=8,timergreater=0:state=3,waypointstop

;End of Script

this script work like that for me: your caracter start to move when you press enter, and speak to you. he walk starting to waypoint A and he stop to waypoint B. and he rotate.

i hope it's help you
Mr noob
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location:
Posted: 10th Aug 2006 16:24
thx, i tweaked it a bit to fit my game but it works thanks

sorry if all my post annoyed anyone, didn't know i was a hassle

Login to post a reply

Server time is: 2024-11-22 19:25:04
Your offset time is: 2024-11-22 19:25:04