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 / Raycasting Help

Author
Message
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 21st Oct 2005 17:37
Ok, as far as I know, the raycast commands check to see if something is in the way. So I made this script:


I isn't done, obviously, but when he gets hit i don't want him walking around into walls. So, I tried the code under "Got Hit". It rotates him away from the wall after he is shot, then when he can move he starts moving. Good. Now for the not good. He keeps moving until he gets to another wall, if you shoot him, he turns again. The problem is I want him to turn without you having to shoot him! Can anybody help me out?

Work Hard. Do Your Best. Share The Glory. Do It Again.
Merranvo
19
Years of Service
User Offline
Joined: 24th May 2005
Location: That ^ is a Orange
Posted: 22nd Oct 2005 00:18
Note: All Redundant Lines Are Removed... This includes animations and comments, it is just easier to check it without them

plrcanbeseen and plringunsight are complements, use one, not both.
plrcanbeseen has no value. =46 is redundant
settarget during shooting, or constantly
rotateheadrandom should not be greater then 45... can you turn your head all the way around?

noiseheard is a field, like distance, 1 means 1 cm, 100 mean 1 m.
noraycastup means that there is no object ABOVE the enemy.

now, if you look at this, your problem becomes immediatly appearent.
You only told the enemy to move WHEN he WAS shot. AND he is stuck on state 5, meaning that he will stay there forever.

::settarget
:state=0,plrcanbeseen:state=1
:state=0,noiseheard=500:state=3
:state=0,shotdamage=1:state=5

:state=1:rotatetoplr
:state=1,ifweapon=1,plrcanbeseen,rateoffire:useweapon
:state=1,ifweapon=0:state=2,setframe=6
:state=2:incframe=6
:state=2,frameatend=6:state=1,reloadweapon,sound=audiobank\guns\reload.wav

:state=3,random=20:rotateheadrandom=70
:state=3,plrcanbeseen:state=1
:state=3,shotdamage=1:state=5

:state=5:movefore=4
:state=5,raycast=0 100:rotatey=4

"ye oft de adopte early shalt move mountains, and be gods among men"

He who knows everything knows nothing at all.
Merranvo
19
Years of Service
User Offline
Joined: 24th May 2005
Location: That ^ is a Orange
Posted: 23rd Oct 2005 02:27
Conjured... I clearly stated his problem. And I would have thought you would have seen it too.

He never gets out of state=5.
ALSO, he never tells him to move except in state=5

so his problem is that he needs to get out of state=5 and stop limiting the AI, Let the AI choose for you, not you choose for it. (Funny Logic NOT Fuzzy) basically. Your too precise with your AI, either add more condtions, or allow the current condtions to do more.

"ye oft de adopte early shalt move mountains, and be gods among men"

He who knows everything knows nothing at all.
Merranvo
19
Years of Service
User Offline
Joined: 24th May 2005
Location: That ^ is a Orange
Posted: 23rd Oct 2005 06:35
bloody crist hell.... curses some more.

When checking source, ignore whatever the person says. Just check. The guy obviously posted an old source, or was mistaken when testing.

"ye oft de adopte early shalt move mountains, and be gods among men"

He who knows everything knows nothing at all.
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 23rd Oct 2005 23:50 Edited at: 24th Oct 2005 04:16
It's still in progress. That's all, I haven't finished it. I just want to figure out the raycast. I'll try what you did and then edit this post.

EDIT: You see, the problem isn't that he stops moving. He keeps going, he just doesn't turn when he is supposed to.

EDIT 2: The movement in the end is supposed to be finding cover, by the way. You don't just sit there after being shot. And you don't automaticly know where your attacker is.

EDIT 3: I'm working on other aspects now. If anyone can help with the raycasting, though, please tell! Meanwhile, time to expirement

Work Hard. Do Your Best. Share The Glory. Do It Again.
Merranvo
19
Years of Service
User Offline
Joined: 24th May 2005
Location: That ^ is a Orange
Posted: 25th Oct 2005 00:39
Quote of Quote: "When Checking Source"

You shouldn't be looking for 1 error, but all possible errors.


Also, there was no way to add in movement without building a lot more on his AI. Just slowly say what you want, and we can help you.

P.S. Check out AI v 2.1.3 as an Example.

"ye oft de adopte early shalt move mountains, and be gods among men"

He who knows everything knows nothing at all.
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 25th Oct 2005 04:10
I v2.1.3? That has raycasting? I'll have to look.

Keep in mind the main part is NOT finished. I still have ALOT of work, I'm just trying to figure out the raycasting, that's all.

Work Hard. Do Your Best. Share The Glory. Do It Again.
Merranvo
19
Years of Service
User Offline
Joined: 24th May 2005
Location: That ^ is a Orange
Posted: 25th Oct 2005 22:22
no raycasting, but it is a pretty good AI on it's own.

"ye oft de adopte early shalt move mountains, and be gods among men"

He who knows everything knows nothing at all.
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 26th Oct 2005 06:29
Ya, meanwhile I'm going to focus on what he does. I'll get the raycasting in later.

Oh, and I loved your AI in the EA version - haven't tried the new V1 version.

Work Hard. Do Your Best. Share The Glory. Do It Again.

Login to post a reply

Server time is: 2024-11-27 03:14:10
Your offset time is: 2024-11-27 03:14:10