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 / Combining two scripts

Author
Message
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 9th Jun 2010 18:43 Edited at: 9th Jun 2010 18:46
Hello everyone, it's been a while since i've used FPS Creator, and i was never a good scripter, so i've run into a problem. I've attempted to combine two scripts, but as usual, it didn't work. I need "Hag", from model pack 23, to chase the player, but keep her/it's default animations. I tried setting "chase.fpi" to the main AI in the properties, but that doesn't work. Like i said, i need her to use her default move/attack etc. animations, but keep going after the player no matter how far away they are, even if they're in another room. So, i tried combining the default main script with the chase.fpi, then the hag didn't even appear when i stepped into her trigger zone. I checked the properties for both the trigger zone and her, and all the settings are right, so i don't know why she didn't appear. I know it's possible to make her chase the player, because when the chase.fpi is applied to a generic character with a gun, they follow and follow the player until they die, even opening doors when you shut them in their face. The only things that have me stumped here are the animations for walking and attacking. Below are all the scripts involved in what i'm trying to do. Can someone please help me out here? Maybe tell me what i did wrong?


The default main script for hag


The default chase.fpi


My combination script
(Please forgive me if this script is crap and nowhere near correct, as i'm still a beginner at scripting, and i've only had success with ridiculously simple scripts.)


Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 10th Jun 2010 06:20
Bump...

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 10th Jun 2010 06:31
Try this:




[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 10th Jun 2010 07:50
I appreciate your effort Marc Steene, but with this script, hag still just behaves normally. As she would if her default script was applied.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Jun 2010 02:25 Edited at: 11th Jun 2010 02:41
Try this


   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Jun 2010 18:25
Thanks CE, she follows me, but now when she starts to get close, sometimes she stops and just stands there doing her 'idle' animation. When she is chasing me, and i go around a corner, it takes her a second to do the same, because she's always facing in my direction. This makes her keep running into the corner until she eventually slides around it. I appreciate you trying though.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 11th Jun 2010 19:10
CE has started this script in the right direction.

Play around with using different distances in the lines with plrdistwithin and plrdistfurther. Especially the ones with longer distances. You just now need to tweak it until it fits your needs.

King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Jun 2010 19:34
I think i might be able to fix the problem with her stopping, but how do i make it so she actually rounds the corner instead of running into it until she slides around it? Standard gun firing characters with the chase.fpi set as their main AI round the corners.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 11th Jun 2010 20:06 Edited at: 11th Jun 2010 20:07
The action movetotarget=1 might have something to do with that. CE's script doesn't have that included. I am not sure exactly what the "1" means. It can also be used without the "1." I have never been able to find an explanation. The action movefore just simply moves the character forward towards the player and if it bumps into an object that's as far as it will go. However, movetotarget might make the character move around objects. I'm not completely sure because I haven't spent much time testing that action. Speaking of which, we all have to test the commands to see what they do. So, I will leave that to you unless CE wants to give you some more code.

Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Jun 2010 20:08 Edited at: 11th Jun 2010 20:14
Quote: "Thanks CE, she follows me, but now when she starts to get close, sometimes she stops and just stands there doing her 'idle' animation. When she is chasing me, and i go around a corner, it takes her a second to do the same, because she's always facing in my direction. This makes her keep running into the corner until she eventually slides around it. I appreciate you trying though."

Yeah, I forgot to add the strafe moves in, and I didn't notice it until after my post.

Quote: "I think i might be able to fix the problem with her stopping, but how do i make it so she actually rounds the corner instead of running into it until she slides around it? Standard gun firing characters with the chase.fpi set as their main AI round the corners."

I didn't have time yesterday to play with it anymore, but I got a little free time this afternoon.
I'll look at it again and try to add the strafes in too, but no promises.

Quote: "So, I will leave that to you unless CE wants to give you some more code. "

I was typing my post as you were posting Flatlander.

   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Jun 2010 20:22
Thank you CE and Flatlander, i'll also play around with the movetotarget thing and see if it helps at all.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Jun 2010 22:32 Edited at: 11th Jun 2010 22:41
Try this
.

I think you will like these results better.
I took out a lot of stuff that I thought was a bit redundant.
You will notice that I added the followplr=1 so get those corners sorted out, and this will move in increments of two instead of the slower pace of one that the Hag normally uses.
That will help her speed up the corrections, so you will not have to wait all day for her to get there.
Try running around a building until you lap her and you can watch her trail your path, but if you get too close she will turn on you.


   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 11th Jun 2010 23:16
Thank you CE, She does exactly what i need her to! I really appreciate this! I'll definately put you in the credits! And a kind thanks to you Flatlander for your helpfulness.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 12th Jun 2010 01:05 Edited at: 12th Jun 2010 01:06
Thanks KoK for the aknowledgement, but CE, of course, did all the work. He didn't even use the movetotarget command. Again what great scripting, CE.

I'm really curious about that movetotarget command since Lee does use it in "chase" fpi. I'm going to have to play around with it.

Also, I'm going to use CE's script as well. This could be used for a lot of characters. Thanks CE!

Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Jun 2010 01:21 Edited at: 12th Jun 2010 01:31
Quote: "Thank you CE, She does exactly what i need her to! I really appreciate this!"

You're welcome.
I'm glad I could help.

Quote: "He didn't even use the movetotarget command. Again what great scripting, CE."

I didn't strafe either.


And for those who want to see this script in action; go buy the Dungeon Pack (#23) to get your own Hag!

Have Fun

   Conjured Entertainment

 WARNING: Intense Madness
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 12th Jun 2010 01:58
Quote: "I didn't strafe either"


I did indeed notice that. Had to put my glasses on first though.

King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 12th Jun 2010 04:20
Wait, i noticed now that she doesn't attack me unless i'm looking at her... Would there be a way to fix this? I'm sorry to hassle you.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Jun 2010 16:12 Edited at: 12th Jun 2010 16:15
Quote: "Wait, i noticed now that she doesn't attack me unless i'm looking at her... Would there be a way to fix this? "

I'm not sure, because I am not having that problem in my test.
She attacks me even when I have my back turned to her.

It may be possible you didn't wait long enough for her to get to you, or maybe she got stuck or something.

I did notice in one of my tests that she did no damage on some of her swings when my back was turned, but she was attacking.

I also noticed that the attacks have a distance check that is redundant, because we already use the distance as a condition to go to these states.
Sure, the player may have moved back while she is swinging, but it won't hurt anything (except the player) if we do the damage anyway.

Try removing those and see if it helps.

...

;attack1
:state=5,framebeyond=94 14,plrdistwithin=60:plraddhealth=-10,sound=audiobank\dungeonpack\hag_attack.wav,state=6

...

;attack2
:state=7,framebeyond=95 14,plrdistwithin=45:plraddhealth=-10,sound=audiobank\dungeonpack\hag.wav,state=8

...

   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 12th Jun 2010 17:42
I took those parts out, but nothing changes. I don't think she's even attacking, because i don't hear her attack sound.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Jun 2010 18:20
But then you turn towards her and then she attacks once you are facing her??

Strange, because there is no condition for checking if the player is looking in the entity's direction.

As I said before, it is not happening on my end when I test it.
I did not use waypoints for my test. (maybe I messed up the waypoint controls)

Are you using waypoints for the Hag in your test?

   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 12th Jun 2010 20:21
Quote: "But then you turn towards her and then she attacks once you are facing her??"


Yes, that's exactly what happens.


Quote: "Are you using waypoints for the Hag in your test?"


No, i'm not using any waypoints. That's weird, how can it happen with me and not you? Are there any restrictions for the properties? Can i not have certain settings activated or something for this script to work?

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 12th Jun 2010 23:21
Quote: "That's weird, how can it happen with me and not you? Are there any restrictions for the properties? Can i not have certain settings activated or something for this script to work?"


All I did was place a few prefabs with ground segments, then dropped in a Hag from MP23 and then gave her this script for her AIMAIN.

Other than the script assignment, I didn't change any of her properties.

Which version of the engine are you using???

   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 13th Jun 2010 00:18
I tried doing just what you said, but she still only attacks me when im facing her. I'm using version 1.16.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Jun 2010 02:11 Edited at: 13th Jun 2010 02:16
Quote: "I'm using version 1.16."

Ahh, some people say that version is buggy, but I am not saying that this is another bug in v116.
I am saying that this is not a problem with the script on my end when using v115.

Anyway, if I could duplicate your problem on my end then I could attempt to resolve it,
However, I cannot test solutions unless I can emulate your problem, so I cannot help further.

Sorry

Is anyone else experiencing this problem when using the script?

Is doesn't sound really like a show-stopper problem though, because she still tracks them.
At some point they will turn around, and SURPRISE!

   Conjured Entertainment

 WARNING: Intense Madness
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 13th Jun 2010 02:55 Edited at: 13th Jun 2010 02:57
I have no issues. I am using RPG Mod v2.30 using FPSC v116. I wold go around this huge building until I'm behind her. She is still chasing me. When I get up close enough she turns around (has her back to me) and attacks. Here's kind of the funny thing. when she starts attacking me -- when I'm behind her -- and then I run around the corner again which is the opposite direction from how she is chasing me originally. Instead of following me in this new direction, she turns around and continues her chase from the original direction.

Now if you can understand what I had just said . . .

Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Jun 2010 03:10 Edited at: 13th Jun 2010 03:20
Quote: "Here's kind of the funny thing. when she starts attacking me -- when I'm behind her -- and then I run around the corner again which is the opposite direction from how she is chasing me originally. Instead of following me in this new direction, she turns around and continues her chase from the original direction.

Now if you can understand what I had just said . . ."

Yeah, I understand.
It is because by using the followplr=1 we set her on your trail like a hound dog.
I guess that old trail is still the closest once you move out of sight, so she goes right back to it.

I think the waypoints may be having a conflict with the followplr=1.
As you guys know, I don't mess with the source code so it is only a guess, but I think that may be the root of the "moonwalk" problem.
You could try commenting those lines out with a semicolon and see if that fixes it.

   Conjured Entertainment

 WARNING: Intense Madness
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 13th Jun 2010 03:45 Edited at: 13th Jun 2010 04:18
You know, I never even thought to take a look at the source code for followplr and movetotarget. I'm going to have to do that.

Addendum:

I looked at the source. The player actually leaves a "trail" and what followplr does is makes an entity follow that trail from the closest point and it will keep following that trail regardless. What is fun to do if you can is make the player go zig zag along his way while going around the building. If you can catch up with the entity (hag) without getting to close and follow her, you will see her do the same zig zags you did as the player. This is the same command used for the skeleton skull in the WWII characters.

Movetotarget is a little different. In that command the character will try different angles when he/she gets blocked and eventually will find a way around the blocked area.

If you just want the character to simply follow then use followplr, but, if you want the player to chase, in another words, the character will not go back to the original trail but will chase from where it finds you, then use movetotarget. One might even be able to use both in one script. I don't know.

King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 13th Jun 2010 06:38 Edited at: 13th Jun 2010 06:39
Um, i know i told you that i was using version 16, but it turns out im actually using Fenix mod. Sorry, it's been a while since i've used FPS creator and i had forgotten about most of the things i had downloaded.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 13th Jun 2010 18:54
CE, i've figured out a way to work around the problem. You're a very kind and patient person. Thank you for helping me this far and providing the script, i'm extremely grateful. I promise i won't bug you anymore.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)
Conjured Entertainment
AGK Developer
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Jun 2010 20:35
Quote: "CE, i've figured out a way to work around the problem. You're a very kind and patient person. Thank you for helping me this far and providing the script, i'm extremely grateful. I promise i won't bug you anymore."

You were not bugging me, but now I get to bug you... what was the work around? (I love work arounds)

   Conjured Entertainment

 WARNING: Intense Madness
King Of Khaos
17
Years of Service
User Offline
Joined: 25th Feb 2009
Location: Not ALL the windows were locked...
Posted: 14th Jun 2010 23:55
It's part of the storyline, so i can't say it out loud in the forums, it would kinda give away the game. I'll just say that she wants to see the players face, and when she does, she's not happy with it. I still have a long way to go before i finish the game and release it.

Cheers, Jake
------------------------------------------------------------
-The Marsundle Residence- (Coming Soon)

Login to post a reply

Server time is: 2026-07-26 17:11:23
Your offset time is: 2026-07-26 17:11:23