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 / I'm out of ideas

Author
Message
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 16th Sep 2012 02:13
I made a script that's supposed to make a character follow a waypoint if the plr is 150 units within it and stop when the plr is far from it. It's also supposed to start again when the plr comes within the certain distance again. Unfortunately, when the plr goes within 150 units, the character walks fine but then stops all of a sudden after a few seconds. What's wrong?
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 17th Sep 2012 11:57 Edited at: 17th Sep 2012 11:58
you have to declare waypointstates to get the character following waypoints, not only the commands for it.

look into people/follow.fpi and use it as basic. edit a "state=0" as first action into each line, then add

:state=0,plrdistfurther=151:waypointstop,animate=0,state=0
:state=0,plrdistwithin=150:animate=2,waypointstart

below the waypointstates. should work then (cant test).

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 17th Sep 2012 22:48 Edited at: 17th Sep 2012 22:49
Thanks for your reply but unfortunately it doesn't work.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 18th Sep 2012 11:12
then show to us, maybe we can figure it out.

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 18th Sep 2012 17:43
Show a video?
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 18th Sep 2012 17:46
your script.^^

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 19th Sep 2012 17:42
Oh.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 19th Sep 2012 17:53 Edited at: 19th Sep 2012 17:54
Quote: "edit a "state=0" as first action into each line"


":condition:action" as mentioned in the manual.

try this:

;Artificial Intelligence Script
;Header

desc = Follow Waypoints

;Triggers
:waypointstate=0:state=0,animate=2,waypointstart
:waypointstate=3:state=0,animate=2,waypointnext
:waypointstate=4:state=0,animate=2,waypointrandom

:state=0,plrdistfurther=151:waypointstop,animate=0,state=0
:state=0,plrdistwithin=150:animate=2,waypointstart

;End of Script

now the character should stand around until player comes near 150, then he should start following waypoints as long as the player is near 150. maybe animate=0 is wrong, i dont remember. then try animate=1.

hope it helps.

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 19th Sep 2012 22:46
I used the modified script but still no success. I also tried changing animate=0 to animate=1 but still no success. The character just turns around when I come within 150 units then turns around again when I am further than 150 units.

What is wrong?
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 20th Sep 2012 17:16 Edited at: 20th Sep 2012 17:18
here this maybe works! I test it but each pc is another jungle!



Public void likeFpsc{ System.out.println("I like FPSC!" ) ;}
http://forum.thegamecreators.com/?m=forum_view&t=196656&b=24
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 22nd Sep 2012 03:59
The character always stops at the next waypoint after he starts. Any ideas?
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 22nd Sep 2012 11:52
two ideas:
1. You are more than 150 meters away
2. You have 1.19, this is the buggiest version of fpsc(i think) so update to 1.2 Beta

Public void likeFpsc{ System.out.println("I like FPSC!" ) ;}
http://forum.thegamecreators.com/?m=forum_view&t=196656&b=24
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 24th Sep 2012 01:15
I have the latest beta but it still doesn't work.
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 26th Sep 2012 22:44
Any help?
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 27th Sep 2012 11:59
tested cornos script, works fine as intended. maybe the character gets stuck there (stairs, objects around?). try press ENTER before placing the character so he is set on the ground correctly.

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 27th Sep 2012 21:49 Edited at: 27th Sep 2012 22:26
Okay. I'll try again.

EDIT: Unfortunately, it still doesn't work. Video attached.

Attachments

Login to view attachments
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 30th Sep 2012 21:39
I really need some help as I need it to work for my game.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 1st Oct 2012 11:36 Edited at: 1st Oct 2012 11:37
set character to always active = yes, seems to be a culling problem. i also saw that characters get in trouble following waypoints when player is near, but only saw that on stairs and thought it is a collision prob of v119-v120b, but doesnt seem so.
i will test,too, and give a link to this into v120betathread if i see problems. will tell you.

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 5th Oct 2012 01:21 Edited at: 5th Oct 2012 01:40
EDIT: I tried again but it doesn't work anymore. Any help?
A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 8th Oct 2012 01:42
I'm sorry if I'm being annoying but I really need this to work for my game.
Corno_1
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 9th Oct 2012 15:25
my last try: update to beta4 and then test my script again! Maybe this is a collision bug which is now fixed

For me all works correct

A dude
14
Years of Service
User Offline
Joined: 15th Mar 2010
Location: The Solar System
Posted: 9th Oct 2012 22:43
I found a fix! I changed the appear scripts to appearnogravity and used Corno_1's script. It works now. Thanks everyone for your help!

Login to post a reply

Server time is: 2024-11-23 19:56:02
Your offset time is: 2024-11-23 19:56:02