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.

Author
Message
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 8th Feb 2016 03:16 Edited at: 8th Feb 2016 03:18
Hi! I am making a game were you go through a house and hide from enemies. what I do is I use waypoints for the enemy to walk around, but if the player does not hide and he comes from a certain distance he will attack. Is there even a way to do this? I am using Freaks and abomination characters btw
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 9th Feb 2016 00:15
Hi frenchpapa, this is more of a scripting question than product chat.
To answer your question, yes very easy to do. Are you familiar with
the FPI scripting any? There are some commands you can use such as
"plrcanbeseen, plrcannotbeseen and noiseheard" these would be
some I would look into using?
Also take a look at this thread..http://forumfiles.thegamecreators.com/thread/207349
Might be of help ? You'll notice in the script it uses the "plrcanbeseen" command.
You can include "noiseheard" with this if needed for more player stealth.
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 9th Feb 2016 01:29
It worked thanks again
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 9th Feb 2016 01:33
Is there a way to edit a default script to attack if player noises are heard?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Feb 2016 00:27
frenchpapa
Why yes, which script is it ?
My games never have bugs. They just develop random features..
Lots and lots of random features...
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 10th Feb 2016 01:22
It is the axe brute script in freaks and abominations
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 10th Feb 2016 02:53
frenchpapa
I'm sorry but I don't have that script. It must be meant for a custom character.
When you said "default script" I thought you meant a stock script. if you could
please post the code and I'll look at it. I'm sure it's a basic script used on a lot
of characters.
My games never have bugs. They just develop random features..
Lots and lots of random features...
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 10th Feb 2016 03:12
Here is the Script



;Triggers

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

;DETECT PLAYER
:state=0,plrdistwithin=300,plrcanbeseen:waypointstop,state=9,rotatetoplr,setframe=96,sound=audiobank\bond1\chaingrowl.wav
:state=0,shotdamage=1:waypointstop,state=9,rotatetoplr,setframe=96

;INTRO ANIMATION
:state=9:waypointstop,incframe=96
:state=9,frameatend=96:state=5

;CHOOSE MELEE ATTACK & RUN OR WALK
:state=5,random=2:state=1
:state=5,random=2:state=6


;MELEE ATTACK 1
:state=1,plrdistfurther=50:waypointstop,rotatetoplr,movefore=2,animate=92
:state=1,plrdistwithin=50:waypointstop,rotatetoplr,setframe=93,state=7

:state=7,framebeyond=93 60,plrdistwithin=60:plraddhealth=-10,sound=audiobank\misc\melee.wav,state=8
:state=7:incframe=93,rotatetoplr
:state=7,frameatend=93:state=6
:state=8:incframe=93
:state=8,frameatend=93:state=6

;MELEE ATTACK 2
:state=6,plrdistfurther=50:waypointstop,rotatetoplr,runfore=2,animate=94
:state=6,plrdistwithin=50:waypointstop,rotatetoplr,setframe=95,state=2

:state=2,framebeyond=95 60,plrdistwithin=60:plraddhealth=-10,sound=audiobank\misc\melee.wav,state=3
:state=2:incframe=95,rotatetoplr
:state=2,frameatend=95:state=1
:state=3:incframe=95
:state=3,frameatend=95:state=1
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Feb 2016 01:30
frenchpapa
Yep, as I thought, it's a basic script. very easy to change.
Look at the "state=0" line and you'll see ",plrdistwithin=300,plrcanbeseen".
Change those commands to "noiseheard=x" ( where x= distance to player in segments
where noiseheard=100 is 1 segment distance , noiseheard=300 is 3 segments..ect )
Something like this..

So with this the player CAN be seen, but unless you make a noise LESS than 3 segments away the enemy wont attack.
If you want both the player not to be seen AND not heard use both together like this..

The whole script should look like this...

Try these out and see how it works for you
best
My games never have bugs. They just develop random features..
Lots and lots of random features...
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 11th Feb 2016 03:02
So when he comes near and I make no noise he still attacks, is this suppose to happen?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 11th Feb 2016 10:53
frenchpapa
Open your script then and look for this line...see if it's there.

Delete the whole line, that's the line that if the player is within 3 segments and can be seen. (Make backup copies with changes)

KEEP this line in your script...

Have a feeling you have both lines in your script. Now he'll only attack if your within 3 segments and make noise.
Also one note, after making script changes one has to run the dbo & bin cleaner.
My games never have bugs. They just develop random features..
Lots and lots of random features...
frenchpapa
9
Years of Service
User Offline
Joined: 14th Aug 2014
Location: No Clue
Posted: 11th Feb 2016 23:26
It works thank you so much I also learned a lot as well

Login to post a reply

Server time is: 2024-04-19 21:44:18
Your offset time is: 2024-04-19 21:44:18