Jump to content
Sign in to follow this  
DBR_ONIX

Multiple Guns on Ground Vehicles

Recommended Posts

Quote[/b] ]Well all I have to say is that everything allways seems sound untill you actualy test it, and thats where the problems start to emerge.

Well fortunately Game Logics are here to save the day, in the pitch and bank department that is. Most of their idiosyncrasies where unearthed with MCar. Just got to figure out the best way of using them with Autocentre now.

But yeah, par for the course with OFP. Multiply the complexity of the initial idea by 10, and your getting close to the final solution smile_o.gif

Share this post


Link to post
Share on other sites

data:

tank plus mg

problem:

same ground contact points dont give good results becouse setPos spoils everything

solution:

dont use setPos

idea:

after appearing tank and Mg on map read with high frequency velocity of a tank and set it to MG, dont use setPos.

with proper mass and ground contact points, this theoreticaly schould work.

assume anomaly every 10 seconds, so track positions of both object, in case of visible difference, use setPos.

Share this post


Link to post
Share on other sites

The problem lies within the fact that a vehicle driven by the player acts differently to one placed using SetPos or SetVelocity. With SetVelocity you still have to call SetDir, that is as bad if not worse than SetPos.

I knocked up a script to test two identical vehicles, side by side. One driven by the player, the other Setpos'ed along side.

[<Players Vehicle>,<AI Vehicle>] Exec "Script.sqs"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle=_This Select 0

_Vehicle1=_This Select 1

_Dir=GetDir _Vehicle

_Pos=GetPos _Vehicle

_Vel=Velocity _Vehicle

_XPos=_Pos Select 0

_YPos=_Pos Select 1

_ZPos=_Pos Select 2

_Dir1=_Dir+90

If (_Dir1>360) Then {_Dir1=_Dir1-360}

_XPos1=_XPos+((Sin _Dir1)*3)

_YPos1=_YPos+((Cos _Dir1)*3)

_Vehicle1 SetPos [_XPos1,_YPos1]

#L

_Dir=GetDir _Vehicle

_Pos=GetPos _Vehicle

_Vel=Velocity _Vehicle

_XPos=_Pos Select 0

_YPos=_Pos Select 1

_ZPos=_Pos Select 2

_Dir1=_Dir+90

If (_Dir1>360) Then {_Dir1=_Dir1-360}

_XPos1=_XPos+((Sin _Dir1)*3)

_YPos1=_YPos+((Cos _Dir1)*3)

_Vehicle1 SetDir _Dir

;_Vehicle1 SetVelocity _Vel

;_Vehicle1 SetPos [_XPos1,_YPos1]

~0.001

goto "L"

Just uncomment either SetVelocity or SetPos and compare how each command responds to changes in the terrain.

Share this post


Link to post
Share on other sites

I seem to remember suggesting this same method a while ago in this exact forum... I'd dig up the thread, but then again, I don't really care goodnight.gif.

Share this post


Link to post
Share on other sites

Another idea, use the setRelcamPos thingy, by getting positoin of gamelogic in cargo positon where the gun should be?

Quote[/b] ]data:

tank plus mg

problem:

same ground contact points dont give good results becouse setPos spoils everything

solution:

dont use setPos

idea:

after appearing tank and Mg on map read with high frequency velocity of a tank and set it to MG, dont use setPos.

with proper mass and ground contact points, this theoreticaly schould work.

assume anomaly every 10 seconds, so track positions of both object, in case of visible difference, use setPos.

Didn't I point that out already? icon_rolleyes.gif

Anyway..

Possible ways :

Setpos - Nope, can't be used fast enough

Setvelocity - Almost, but it doesn't take into account the rotation

Setdir - Similar to setpos

setCamRelPos (on gamelogic) : This seems possible, but only for pitch? That seems odd..

A (tiny bit) of topic. Using config defined anims, it's possible to rotate polygons, by making selections of points and moving them around an axis. What happens if you animate the points where the missile come out of a plane?, or is it the same as not being able to animate proxys? (Which can be done it seems, the SCUD animates the missile proxy, no?)

- Ben

Share this post


Link to post
Share on other sites

Just thought i would make an official post that UNN and I have started work consisting of the majority of the suggestions. UNN has done an excellent job, and would like to thank him on making it work soo well. However it isnt finished and in early early beta, with bugs like Bridges and other annoying barriers.

(Well i say UNN and i, but untill now UNN has done all the work)

I would post some shots however i need to consult UNN on the scripts atm and will possibly post some-thing soon...

*Watch This Space*

Currently Addon makers to thank for inspiring work that has got us this far :-

The guy that made the demo mission with the BIS MG setpos'ed in the back of a truck. (Perhaps it's going over board crediting some nameless guy)

The MCar Project (For the game logic side, includes UNN)

Col.Klink

Phil Commando

DBR Onix!

any way i will leave you in suspense with what happens next

Share this post


Link to post
Share on other sites

Just thought I'd point out this. Sorry if everyone already knows about it, but it's a tank with 2 seperate turrets, so it might help answer the questions back on the other page.

http://psyproductions.proboards21.com/index.c....1899977

Also, the Lib41 mod had both a turret and a corse machine gun on their tanks, making a total of 2, with 2 gunners.

Share this post


Link to post
Share on other sites

just out curiosity, since your making two vehicles that are attached to one another, would that mean if the comander wanted to use this machine gun would he have to disembark from the tank than enter the M2? or could there be a script that would allow you to switch positions, like the turn in/ turn out feature or like how you could move from commander to gunner to driver? also, another question, the commander when turned out is able to rotate 360 and is able to look up and down somewhere around 60 to 70 degrees when you switch into 3rd person. why isn't just a simple matter of attaching the weapon on that part of the model? of course i know this isn't the solution because it would have obviously be done already. i just wana know why. but if it were possible than it would most likely mean you would have to switch into 3rd person mode to be able to use the gun since your unable to rotate around in 1st.

Share this post


Link to post
Share on other sites

Hi,

Quote[/b] ]Just thought I'd point out this. Sorry if everyone already knows about it

Yeah, that was some of the earlier experiments I was involved with, not sure how far Sa8geko progressed with it though. I'm in the process of catching up smile_o.gif

The lib Mod coarse mg (turret\2nd vehicle) does not conform to the terrain. But it does not need to really, as the turret is invisible and the gun does not move.

Quote[/b] ]could there be a script that would allow you to switch positions, like the turn in/ turn out feature or like how you could move from commander to gunner to driver?

Yeah, thats easy enough.

Quote[/b] ]the commander when turned out is able to rotate 360 and is able to look up and down somewhere around 60 to 70 degrees when you switch into 3rd person.

I don't think he can fire his own weapon, as all his commands go to the gunner and driver of the tank.

I doubt there is a perfect solution for OFP, it's just a matter of removing as many glitches as possible...Oh and keeping your fingers crossed for the possibility in Armed Assault smile_o.gif

Share this post


Link to post
Share on other sites
Currently Addon makers to thank for inspiring work that has got us this far :-

The guy that made the demo mission with the BIS MG setpos'ed in the back of a truck.

The MCar Project

Col.Klink

Phil Commando

you forgot one tiny person: the guy that took your vehicles apart and posted his progress: DBR Onix! icon_rolleyes.gif

why credit somebody noone knows, right? what a laugh! rofl.gif

EDIT: and he even created this topic! how ironic that you could've missed him! wink_o.gif

Share this post


Link to post
Share on other sites

excellent constructive post there tounge2.gif - On that basis, they forgot me for making the landrovers, and deliltmon for making the originals.

didnt see that he was initially using our landies... i dont remember getting an email asking permission biggrin_o.gif

nice work lads smile_o.gif - Seen the video of it in action, and also have it on my HD - looks very promising if the small bugs get ironed out smile_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]excellent constructive post there

tounge2.gif

Anyway, DBR_Onix somehow always gets forgotten biggrin_o.gif

When he started the thread that later evolved into producing the Kegetys' FWatch and the similar thing by vektorboson it was like page 2 DBR_Onix was forgotten already rofl.gif

Tough luck, buddy tounge2.gif

Share this post


Link to post
Share on other sites
excellent constructive post there tounge2.gif - On that basis, they forgot me for making the landrovers, and deliltmon for making the originals.

didnt see that he was initially using our landies... i dont remember getting an email asking permission biggrin_o.gif

nice work lads smile_o.gif - Seen the video of it in action, and also have it on my HD - looks very promising if the small bugs get ironed out smile_o.gif

I asked for permission on the thread they were released wink_o.gif

And this time I was only forgotten on the 3rd page, getting better I suppose... tounge2.gif

Uh? Theres a video..? I seem to have missed that.. Do I transmit transparency or something? tounge2.gif

- Ben

Share this post


Link to post
Share on other sites
Just thought i would make an official post that UNN and I have started work consisting of the majority of the suggestions. UNN has done an excellent job, and would like to thank him on making it work soo well. However it isnt finished and in early early beta, with bugs like Bridges and other annoying barriers.

(Well i say UNN and i, but untill now UNN has done all the work)

I would post some shots however i need to consult UNN on the scripts atm and will possibly post some-thing soon...

*Watch This Space*

Currently Addon makers to thank for inspiring work that has got us this far :-

The guy that made the demo mission with the BIS MG setpos'ed in the back of a truck. (Perhaps it's going over board crediting some nameless guy)

The MCar Project (For the game logic side, includes UNN)

Col.Klink

Phil Commando

DBR Onix!

any way i will leave you in suspense with what happens next

Ive recorded a video

Share this post


Link to post
Share on other sites

Ah, this?... wait, no icon_rolleyes.gif (Wheres that blushing emoticon gone tounge2.gif)

The video been released?

Anyway, good luck with it smile_o.gif

goodnight.gif

- Ben

Share this post


Link to post
Share on other sites

no... private viewing of the video - seeing as i have an older working example in pbo form, i dont have to watch it smile_o.gif

Share this post


Link to post
Share on other sites
no... private viewing of the video - seeing as i have an older working example in pbo form, i dont have to watch it  smile_o.gif

Lets put it this way.... UNN is making a nice script for the WMIK, and it is working very nice atm. I would release a video but i would have to kill you........

Im sorry if i didnt quote a few people that needs credit but obviously i only quoted the names that we have been using previous scripts from, and inspiration. I.E The 50.cal set pos script, the Col. Klink Pboat, The M1 and M2 gun script etc etc, and MCAR

No offence for leaving you out DBR_ONIX sorry mate....

Only small problem is going over bridges with the GIMPY (GPMG) on the front.... I was thinking of a script like :-

_Height (getheight _vehicle)

maybe that would help??? I would put _posy = (getpos _vehicle select 1)

but it seems that setpos would mess around with the Proxy position and send arse over tit

good job UNN... screen shots will be released soon

Share this post


Link to post
Share on other sites

to be brutally honest, at the end of the day if the only bug that remains is going over the bridge, then i reckon 99% of the community could cope... i sure could smile_o.gif

Share this post


Link to post
Share on other sites

Yeh, bridges aren't a big problem, theres not that many, and if they need to be used, you can use two triggers to teleport any vehicles across the bridges, not the best but it solves a lot of problems.

Things like trailer scripts have this problem too, but really it's a small problem.

Anyway, excelent work xmas_o.gif

*Ticks of line on engine limiation, which doesn't acctualy exist as far as I know.. icon_rolleyes.gif *

- Ben

Share this post


Link to post
Share on other sites

how about if you where like some VCB idiots and drive off a ledge on CATshits afgan island.... LOL cough Bam cough

Share this post


Link to post
Share on other sites

managed to flip the last pbo you sent me swift, and that didnt have a great affect on the setpos weapon tounge2.gif

Share this post


Link to post
Share on other sites

Hi,

Quote[/b] ]managed to flip the last pbo you sent me swift, and that didnt have a great affect on the setpos weapon

Lol

It would be possible to test for some of these events, any extreme changes in pitch or bank or someone hurling themselves of a cliff smile_o.gif You could then shut the turret scripts down. But thats more stuff running in the background?

No better news with bridges either sad_o.gif ATM. I still want to test somethings out, to get a better idea of the problem.

Share this post


Link to post
Share on other sites

Not sure of this would helps, but based on my own previous researches:-

1. Bridges are objects setpos above island formatted water.

2. Tanks and other vehicles have problem moving on top of objects

3. M113 class based vehicles are the only vehicle tested that

moves over bridges/objects above water.

4. Some human class objects do not cross unofficial bridges even with pathlod unless you place another object on the other side and give a domove command.

Solution:-

1. Create an invisible roadway addon in 64m size. with the correct 'pb' memory points.

2. Set the vertices 'above ground' in vertex properties

3. pack this addon together with your multiple gun vehicle, so that mission planners can place such roadway addon on bridges.

4. or convert your vehicle to M113 class vehicle.

-------------- A crazy thought---------------------

The above is meant for bridge crossing but you may encounter a problem of the attach object droping to sea level once it manages to cross the bridge.

'There are 2 'heights' it seems in ofp - Absolute and relative height. While crossing the bridge over water, the main object uses relative height of the bridge surface level which is 0 but the attached object's height (z axis) uses absolute height -sea level. What would be the mathematical formula to reconcile both heights to maintain an equalibirum?' Is there a way to lock the attached object's z axis to the main object's height?

# loop

_attachObject this select 2 = (_mainObject this select 2)+K  

goto loop

where k = formula of calculating absolute height between an object on land against sea level in ofp

would it work?

---------------------A crazy thought--------------------------

Edit:- It may seem troublesome, complex and a lot of trials and errors, but once the limitations are broken, it will be easy to do the next addons. I'll bet Zwarda faced the same problem trying to get the first addon into ofp 4years ago. It was only a chair! But it led the way to spectacular addons of the likes we once thought impossible in ofp!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×