go to nearest scriptpont in case can not reach the player

Topics regarding Scripting with Reality Factory
Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

go to nearest scriptpont in case can not reach the player

Post by Veleran »

iI dont rember for sure whether there re commands for that-since using generic monster script as it is i get monsters stuck because they re running straight towards the player to attack.

Is there something i can add so whenever cant run in direction of player and avoidance is nt enough to check which scripoint i s nearest to the player and the monster and go there first
I mean which commands can compare distance between monster-player and script points.
-or just go to the nearest script point just to get un stuck-which might not work well-im not sure yet,unless i add many scriptpoints which i would try to avoid.
I dont know yet which is good number of scriptpoints in a level-might depend on cpu..
Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: go to nearest scriptpont in case can not reach the playe

Post by Allanon »

A pawn has a variable named self.player_range which contains the current distance the pawn is from the player. Also there is the low level command NearestPoint(float MinDistance, float MaxDistance) which will search for the nearest visible ScriptPoint within the range MinDistance - MaxDistance and if one is found, make it the current ScriptPoint.

I guess you can check the range to the player and the pawn's position and if the pawn is not getting closer to the player or not moving because it is stuck then call the NearestPoint() command to change to the closest ScriptPoint.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: go to nearest scriptpont in case can not reach the playe

Post by megatop »

well this can also be set in the SetFOV(###);
Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: go to nearest scriptpont in case can not reach the playe

Post by Allanon »

megatop wrote:well this can also be set in the SetFOV(###);
SetFOV() only sets the angle at which the pawn can see, it doesn't detect if the pawn is stuck or can't reach the player. It also has nothing to do with ScriptPoints.

Why do you keep responding to peoples questions just for the sake of responding? You keep giving out incorrect information and you are flooding this message board with useless posts. Please only respond to a post with a question if you are sure of the answer, I know you are new to RF but you shouldn't give out information useless you are pretty sure it is correct. Looking up SetFOV() in the manual would have told you that is has nothing to do with his question.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: go to nearest scriptpont in case can not reach the playe

Post by megatop »

im sorry :(
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: go to nearest scriptpont in case can not reach the playe

Post by paradoxnj »

He apparently doesn't want to read. every question he's asked can be resolved by the manual or ebook or even searching the forums. Every time I mention ebook or manual, he ignores me. I even gave him an exact page to one of his problems.
Many Bothans died to bring you this signature....
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: go to nearest scriptpont in case can not reach the playe

Post by megatop »

sorry paradoxnj. I couldnt read the ebook cause my PDF complete wasnt working. Also i did get alot things done from the manual like the mp40 shell [Mp40] sorry paradoxnj
initial = 1
low = 0
high = 1
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: go to nearest scriptpont in case can not reach the playe

Post by bernie »

Give the lad a break Anthony he's only 10 years old. He can obviously read, which is a lot more than a lot of kids that graduate from school can do these days :lol:

@Megatop: Keep experimenting with stuff, sometimes it will work somtimes it won't, but you learn a hell of a lot from the mistakes you make. Search the forums and you will find answers to most or even all of your queries. A lot of people here have made demos of stuff they are working on, take a look at those and see if you can work out how they have done things. Again you will have to look through back posts to find where to get the demo's.
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: go to nearest scriptpont in case can not reach the playe

Post by paradoxnj »

I never said he couldn't read. I said he doesn't want to. ;) 10 years old...he should know better!! :) I am trying to show him the proper way to learn. There is a difference between help and wanting someone to do it for you. If I didn't point out a page with the exact answer to his problem, I wouldn't be so harsh. To spoon feed someone is not helping them, it's hurting them. They become accustomed to the direct help and keep asking for it. Then when you stop giving it to them, they give up. If he learns how to find it himself, he will forever attain knowledge.
Many Bothans died to bring you this signature....
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: go to nearest scriptpont in case can not reach the playe

Post by megatop »

thanks guys I got out of school and i guess im looseing some knowlage cause im looseing math skills. lol. thanks guys and this has taught me many things and one lesson :lol: thanks :D
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: go to nearest scriptpont in case can not reach the playe

Post by bernie »

I never said he couldn't read
I wasn't suggesting you had. I was being cynical about modern education ( He can read at 10 years old a lot of kids are leaving school at 16 and can't read or write, but it keeps my wife in work teaching illiterates. :lol: )
The schools at this side of the pond teach kids by rote and answering their questions up to the age of about 11 or 12 then they progress to learning by reading from that age onwards when they start secondary school. I don't know where megatop is from but if that's the way he is being taught at the moment we shouldn't be too hard on him just yet.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: go to nearest scriptpont in case can not reach the playe

Post by megatop »

thamks bernie its ok if you go a little hard in a situation. thanks :)
User avatar
paradoxnj
RF2 Dev Team
Posts: 1328
Joined: Wed Mar 01, 2006 7:37 pm
Location: Brick, NJ
Contact:

Re: go to nearest scriptpont in case can not reach the playe

Post by paradoxnj »

Give the lad a break Anthony he's only 10 years old. He can obviously read, which is a lot more than a lot of kids that graduate from school can do these days
To me, it looked like you implied that I said he could not read. It's fine.

I commend him for trying at his age. He's got a lot to learn. He's going to need to learn 3D math which most kids in the US don't learn until they are in high school. Logic is another biggie.

In the US, we are taught that learning is about researching and obtaining the knowledge with guidance. The most the teacher will do is go over the lesson quickly in class then you are responsible to learn anything else you need to learn about the subject matter. The kids ask questions as well, but if it is something they have already gone over or is documented, they refer them to the book or the lesson notes. If they have read it and still don't understand, then they will sit with the child and explain further. In this case, he has not even read the proverbial book(s). I'm sure if he did, it would answer at least 80% of his questions. After all, that is what people spent hours upon hours writing them for. ;)
Many Bothans died to bring you this signature....
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: go to nearest scriptpont in case can not reach the playe

Post by bernie »

In the US, we are taught that learning is about researching and obtaining the knowledge with guidance.
That is something that doesn't happen over here (or didn't until after my kids graduated) until 3rd level education ie university. It comes as quite a shock when you get there and takes some getting used to.
3d maths is something we never covered at all, even at 3rd level (I did Electronics Principles and Telephony which did include Maths but that was in the 1950s). My kids have never covered that either and they are in their mid 30's. My eldest son Dan who is an accountant, studied pure maths at 3rd level in the first year before changing his subjects to accountancy and economics, has never covered that either.
We live in different worlds. The language we speak also appears to be different, at least the nuances are, which leads to misunderstanding.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: go to nearest scriptpont in case can not reach the playe

Post by megatop »

your right. luckly I am trying to learn. I have tread the manual muitiple times. At my yong age its hard to understand some of the things in the manual. But I am doing good with coding (sorta) lol.Im basicly teaching myself everything. My schools out and they dont know how to teach 3d coding and math.
Post Reply