Scripts / Vehicle Gunner problem

Author
Message
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 24th May 2020 00:15
Hello! I am using the vehicle gunner script to do a quad in first person, but the problem is that it goes through all the objects and does not collide with anybody except the NPCs, but only where the character is .. this is the script. Thank you

PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 24th May 2020 02:35
In the FPE file see if there is " fixnewy= " listed. if not add it to the FPE file

Add different values to the fixnewy = like 90 or, 180.

That hopefully might straighten out the four wheeler.
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 24th May 2020 02:55
I had to change the fixnewy= in the FPE file for this snowmobile to fixnewy=180. originally it was riding backwards.

Once you get it straight then you can fine tune it in the smallg vehicle gunner script.

PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 24th May 2020 03:15
Thanks for the response! that will fix some problems but the quad entity does not collide with the buildings instead of colliding it pierces them
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 24th May 2020 11:40
Unfortunately that is true with the script.

Hopefully the script will be updated with GGmax to see buildings, tree's etc...
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th May 2020 14:22
That's because the script is moving the entity around explicitly using the SetPosition command so it is not under the control of the physics engine.

So you have to add your own collision detection, the simplest way of doing this is to add ray casting commands firing in the direction of travel to detect any objects that might be present.

Btw that is a very old script by the look of it, it is using the old ai states so it wouldn't work with the new ai modules. (plus it is really ugly )
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th May 2020 17:15 Edited at: 24th May 2020 17:16
Attached is a rewritten version of your script, much prettier.

See how this one works for you.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 24th May 2020 22:13
thank you Amenmoses for the respones, now the entity is crazy LOL
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th May 2020 00:34 Edited at: 25th May 2020 00:39
That's because the player capsule is fighting with the entity, both are trying to occupy the same space.

In the script raise the y = 60 value in the pos_mod list until it stops doing that.

You may find that the player sits too high on the vehicle when you do that, no simple cure for that apart from either turning off physics on the object (in which case it will penetrate buildings and stuff) or have two entities, one which you attach the script to and is a small flat invisible object with physics on for the player to stand on and a second to be the vehicle body which is visible but has physics off.
The second, body, object simply needs to be positioned every frame at the same location and orientation as the first.
Been there, done that, got all the T-Shirts!
PM
bluemeenie195
6
Years of Service
User Offline
Joined: 28th Oct 2018
Location:
Posted: 25th May 2020 00:49
Thanks AmenMoses for the updated script. works great.

I've always liked this smallg script. A lot of setting options to work with all types of vehicles.

Putting raycasting in is way above my skill level. That would be awesome though.







PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th May 2020 01:44
It's not rocket science, basically just work out which way the entity is pointing and cast rays in the direction of travel, if there is anything there simply set speed to zero so it stops moving.
Been there, done that, got all the T-Shirts!
PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 25th May 2020 02:22
Damn, i was change the script Y until 400 and continues doing that
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th May 2020 13:26
What collision mode does your model use and what are your parameter settings for it?

Make sure issimobile=no.
Been there, done that, got all the T-Shirts!
PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 25th May 2020 17:58
Is using polygonal and yes is non static and innmobile off always active, whats the problem? did u tested that script?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th May 2020 20:07
Yes, worked fine with a stock entity, think I used a flat slab from the fixtures
Been there, done that, got all the T-Shirts!
PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 25th May 2020 20:15
could you help me with a working model please?
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 26th May 2020 04:30
I thought collision worked back after the September 19 build? At least I'm certain
that I had something using GG collision (with MoveForward) then. I was amazed to
see functioning collision- no doubt!

On a completely different note-- since you shouldn't even need it.........
oldx-newx
oldz-newz
That is the ancient nomads secret to computing the "direction of travel"
But like AmenMoses will tell us-- that is ugly red neck method!
PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 26th May 2020 17:37
so whats the solution?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th May 2020 19:43
Solution to what?

Been there, done that, got all the T-Shirts!
PM
miltonmdq
4
Years of Service
User Offline
Joined: 9th Apr 2020
Location:
Posted: 26th May 2020 20:00
to make collision on the vehicle gunner script with no actin crazy entity
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th May 2020 20:47
I already told you, use a stock entity like a slab from the fixtures folder and add the script to that (with physics on) then write a script to attach to your quad which will make it follow the slab entity around (i.e. just position it at the same place) and have physics off on the quad.

Is the quad scaled btw? GG can't handle physics properly on scaled entities so you have to make sure they are scaled properly before importing them.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-22 03:17:41
Your offset time is: 2024-12-22 03:17:41