Jump to content
Sign in to follow this  
[frl]myke

Proxy: how do they work

Recommended Posts

Hi Folks,

i'm taking the first steps in addon editing and i learned already a lot. But one thing that is still a mistery to me are proxies, weapon proxies in special.

What i've already found out (by trying or reading FAQ's/Tutorials) is, that Proxies are used to determine the position of a non-vehicle-part like the Pilot or Missiles (like Sidewinder or Mavericks).

Now where i'm a little confused, although it seems that it isn't possible (at least visual correct) to have Mavericks AND Sidewinders on a Plane (only one model is shown for all Missiles) what's the point of naming them different?

I mean, on the A10 the proxy is named something with "AGM65", on the Harrier, if i remember correct, with "AIM9xSidewinder" and "GBU12".

So if i use 2 different proxies on one model (AGM65 and Sidewinders i.e.) in Buldozer it shows the correct missiles at the appropriate proxy.

But ingame, it screws up and only one missile model is shown (didn't researched on what it depends which one is shown).

So to me it seems that the model in .p3d format would generally support multiple types of Missiles but the game engine doesn't make use of it.

Can someone explain how proxies are handled, is there a place where it is defined where the missile should be drawn?

Please just give any info about proxies and how they are handled that you have.

P.S. I know Franze's F/A18 has a way to individually load missiles and i saw how he did (it is called hiddenselections if i remember correct) but this is only a (pretty impressive and genious) workaround.

I'm not trying to create something, i just try to understand the mechanics behind.

Myke out

Share this post


Link to post
Share on other sites

I'd like to second the comments above. It doesn't seem possible to have seperate loadouts for different proxy's. For example, sidewinders and mavericks.

I've desperately tried to config my addon to have both, and studied the F/A18 mod tos ee how fraze did it. I haven't figured it out how to get around the single weapon proxy limit and still have good performance in a multiplayer environment?

Any ideas?

Share this post


Link to post
Share on other sites

With just proxies, I tried many combinations but none came close to actually proving a (scriptless) solution. Always seemed so close ... but gave up.

On the Su33 I used the "hide" animation and "grab ammo & ModelToWorld" method.

By all accounts effective in MP, except for a small visual delay between when you see the ammo disappear and the actual missile re-appear.

Its a relatively simple method.

Share this post


Link to post
Share on other sites

I am lil rusty but to help you understand a bit more I can explain some.

My old Corsair was one of the first to display multiple ammo types in OFP.

Some of the limitations

In OFP you could only have either rockets OR missiles firing from 2 different points that it takes turns using.

(maybe can have both as long as they aren't using same simulation mode, I didn't need to go that far but i believe you wouldnt be able to display all the proxys)

Your addon can display one type of ammo proxy.So you want the bombs to use the proxy display by hanging your bomb proxys where you want them to display.

And use hidden selections to show some missiles (rockets) depending on how many you have left.

Obviously you can only use the rockets that you modelled with your addon however you can config different strength rockets.But your rockets will only be the ones you made within your addon (unless you did further modelling/hidden selection for few different rocket types)

Obviously you can swap different textures for different looking rockets but the shape will stay the same you modelled.

A clip of my old ammomanager script

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

_plane = _this select 0

_weapon = _this select 1

_type = _this select 2

;player sidechat format [" %1 fired %2 " , _plane ,_weapon]

? _weapon == "eca_corinit" : goto "callmanager"

? _weapon == "eca_corttim" : goto "rocketl"

? _weapon == "eca_corttim8" : goto "rocketl8"

? ! local player : exit

? _weapon == "eca_cornapalm" : _napalm = nearestobject [_plane,_weapon];goto "napalm"

_ammocnt = (_plane ammo "eca_corttim")

?  _ammocnt > 7 : _plane setobjecttexture [26,"\iegf4u\tinytim.pac"]

?  _ammocnt > 6 : _plane setobjecttexture [27,"\iegf4u\tinytim.pac"]

?  _ammocnt > 5 : _plane setobjecttexture [24,"\iegf4u\tinytim.pac"]

?  _ammocnt > 4 : _plane setobjecttexture [25,"\iegf4u\tinytim.pac"]

?  _ammocnt > 3 : _plane setobjecttexture [22,"\iegf4u\tinytim.pac"]

?  _ammocnt > 2 : _plane setobjecttexture [23,"\iegf4u\tinytim.pac"]

?  _ammocnt > 1 : _plane setobjecttexture [20,"\iegf4u\tinytim.pac"]

?  _ammocnt > 0 : _plane setobjecttexture [21,"\iegf4u\tinytim.pac"]

_ammocnt = (_plane ammo "eca_corttim8")

?  _ammocnt > 7 : _plane setobjecttexture [26,"\iegf4u\tinytim.pac"]

?  _ammocnt > 6 : _plane setobjecttexture [27,"\iegf4u\tinytim.pac"]

?  _ammocnt > 5 : _plane setobjecttexture [24,"\iegf4u\tinytim.pac"]

?  _ammocnt > 4 : _plane setobjecttexture [25,"\iegf4u\tinytim.pac"]

?  _ammocnt > 3 : _plane setobjecttexture [22,"\iegf4u\tinytim.pac"]

?  _ammocnt > 2 : _plane setobjecttexture [23,"\iegf4u\tinytim.pac"]

?  _ammocnt > 1 : _plane setobjecttexture [20,"\iegf4u\tinytim.pac"]

?  _ammocnt > 0 : _plane setobjecttexture [21,"\iegf4u\tinytim.pac"]

exit

#rocketl

_ammocnt = (_plane ammo "eca_corttim")

?  _ammocnt < 8 : _plane setobjecttexture [26,""]

?  _ammocnt < 7 : _plane setobjecttexture [27,""]

?  _ammocnt < 6 : _plane setobjecttexture [24,""]

?  _ammocnt < 5 : _plane setobjecttexture [25,""]

?  _ammocnt < 4 : _plane setobjecttexture [22,""]

?  _ammocnt < 3 : _plane setobjecttexture [23,""]

?  _ammocnt < 2 : _plane setobjecttexture [20,""]

?  _ammocnt < 1 : _plane setobjecttexture [21,""]

?  _ammocnt > 7 : _plane setobjecttexture [26,"\iegf4u\tinytim.pac"]

?  _ammocnt > 6 : _plane setobjecttexture [27,"\iegf4u\tinytim.pac"]

?  _ammocnt > 5 : _plane setobjecttexture [24,"\iegf4u\tinytim.pac"]

?  _ammocnt > 4 : _plane setobjecttexture [25,"\iegf4u\tinytim.pac"]

?  _ammocnt > 3 : _plane setobjecttexture [22,"\iegf4u\tinytim.pac"]

?  _ammocnt > 2 : _plane setobjecttexture [23,"\iegf4u\tinytim.pac"]

?  _ammocnt > 1 : _plane setobjecttexture [20,"\iegf4u\tinytim.pac"]

?  _ammocnt > 0 : _plane setobjecttexture [21,"\iegf4u\tinytim.pac"]

exit

#rocketl8

_ammocnt = (_plane ammo "eca_corttim8")

?  _ammocnt < 8 : _plane setobjecttexture [26,""]

?  _ammocnt < 7 : _plane setobjecttexture [27,""]

?  _ammocnt < 6 : _plane setobjecttexture [24,""]

?  _ammocnt < 5 : _plane setobjecttexture [25,""]

?  _ammocnt < 4 : _plane setobjecttexture [22,""]

?  _ammocnt < 3 : _plane setobjecttexture [23,""]

?  _ammocnt < 2 : _plane setobjecttexture [20,""]

?  _ammocnt < 1 : _plane setobjecttexture [21,""]

?  _ammocnt > 7 : _plane setobjecttexture [26,"\iegf4u\tinytim.pac"]

?  _ammocnt > 6 : _plane setobjecttexture [27,"\iegf4u\tinytim.pac"]

?  _ammocnt > 5 : _plane setobjecttexture [24,"\iegf4u\tinytim.pac"]

?  _ammocnt > 4 : _plane setobjecttexture [25,"\iegf4u\tinytim.pac"]

?  _ammocnt > 3 : _plane setobjecttexture [22,"\iegf4u\tinytim.pac"]

?  _ammocnt > 2 : _plane setobjecttexture [23,"\iegf4u\tinytim.pac"]

?  _ammocnt > 1 : _plane setobjecttexture [20,"\iegf4u\tinytim.pac"]

?  _ammocnt > 0 : _plane setobjecttexture [21,"\iegf4u\tinytim.pac"]

exit

And just add a "fired" eventhandler to run that script when rockets fired ( I however didn't...I had a manager that ran constantly and checked ammo levels and called that script)

You see I had two different strength rockets

The rockets will take turns using the "memory" points L and P raketa defined within your models memory points.

Missiles would use L and P Strela

Each type have different characteristics (missiles can lock-on)

Scripting would be required to display how many rockets you have left in visual ammo.Some visual obvious things that the rockets may look to move slightly when fired coming out of one of these points defined in memory.

Bombs will natural display how many left by themselves unless you only mounted one bomb proxy and have more ammo than that.Bombs will take turns using placements and you may have to change placement to realistically show order (normally you want the outer bombs drop first leaving the inner ones left)

With the proxy its only a holder for different things. A weapon proxy on a soldier only shows you placement and the soldier is able to pick up different weapons, right.

Bombs only show you the placement and are holder positions for ammo, you can loadup to whatever bombs you want.

And it will display the different bomb.The bomb could be another addon of new bombs or any available bomb ammo.

However your rockets can't this way( unless you only have rockets on your plane and didn't place proxy bombs using rocket proxys instead, your addon will show ammoleft and you would be able to change different rockets then)

On my old Corsair I went even further and the pilot was also able to use grenades when the canopy was open.These use the memory point "granatomet "  , but of course unable to display any grenades as the proxy's were already used for bombs displaying.Just a point to were the grenades dropped from

Hope this helps explain some

Share this post


Link to post
Share on other sites

Thanks guys that was an awesome explanation, unfortunately I still havent been able to crack my problem.

Well I managed to get rockets firing from the memory points, but I could not for the life of me get missiles firing from the memory points.  The problem is, I need the missile to be able to lock on... I am using Bombs and Missiles so I want to be able to have the bombs as proxy's and the missiles animated by scripting.

I tried using "missile_1" and "R Strela" etc... but with no success.  I tried establishing using: type = WeaponHardMounted; (after defining #define WeaponHardMounted 65536) in the CfgAmmo, the CfgWeapons, and even CfgMagazines.

Does anyone have a working configuration of an aircraft using memory points to dispatch missiles (that can lock on?).

Share this post


Link to post
Share on other sites

Pretty sure you won't succeed by mixing two methods ..... you will either have to stay with 1 proxy armed plane or go ALL the way and make all weapon processed by either "setobjecttexture" method or "_plane animate ["ch29_2_Hide", 1];" method.

dePBO the Su33 to see the scripts and config.

The missing model.cfg stuff consists of code like;

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

class CfgSkeletons

{

class Plane;

...........

.............

class su33BonesMR: Plane

{

isDiscrete=0;

skeletonInherit = "";

skeletonBones[]=

{

..............

.............

"fb25_1","",

"fb25_2","",

"fb25_3","",

"fb25_4","",

"ch29_1","",

"ch29_2","",

................

..................

.................

class CfgModels

{

class Plane;

.............

.............

class rktsu33_bluAG_mesh: Plane

{

sectionsInherit="";

skeletonName = "su33BonesAA";

sections[] =

{

...............

...............

"roundel",

"num1_co",

"num2_co",

"clan",

"clan_sign"

};

class Animations

{

...................

....................

class ch29_1_Hide

{

type ="hide";

selection ="ch29_1";

source="Userch29_Hide";

};

.............

............

EDIT

To your memory point question, except for the FFAR memory pionts (l raketa and p raketa) didnt worry about the other points. Everything typically appears at the 0.0.0 point and as the "fired" script grabs the missile or bomb straight away and relocates it to the "real" fired position, there  is no issue.

Beware but, make sure there is no GEO LOD mass at the 0.0.0 point (move your model to suit) otherwise the plane will "hit" the missile or bomb and you get weird speed transfer effects.

Yes, laser lock-on and such still works fine.

Share this post


Link to post
Share on other sites

The Su34 has locking missiles? I looked in the Bis A10 and Su34 models and both are using L and P Raketa memory points so maybe its Raketa that can lock

edit: further looking the Su34 has missiles and rockets and only Raketa memory points...Has proxys for both

(only has 2 types of proxys)

I haven't seen many addons using the L and P Strela memory points that I recall

Within your weapon config you need the canlock=LockYes parameter

Clip of launchers.hpp

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

class Strela: Launcher

{

scope = 2;

displayName=$STR_DN_9K32;

model = "\ca\weapons\strela_launcher";

modelSpecial = "\ca\weapons\strela_launcher_loaded";

nameSound="aalauncher";

modelOptics = "-";

magazines[]={Strela};

sound[]={\ca\Weapons\Data\Sound\javelin1_A,db20,1}; //pokus

drySound[]={\ca\Weapons\Data\Sound\Javelin_dry_v1,db-80,1};

reloadMagazineSound[]={\ca\Weapons\Data\Sound\flare_reload,db-70,1};

soundFly[]={\ca\Weapons\Data\Sound\rocket_fly1,db20,1.5};

value = 20;

canLock=LockYes;

picture="\CA\weapons\data\equip\w_9k32_ca.paa";

UiPicture="\CA\weapons\data\Ico\i_aa_CA.paa";

recoil=launcherBase;

minRange=1;minRangeProbab=0.30;

midRange=1000;midRangeProbab=0.8;

maxRange=2500;maxRangeProbab=0.10;

aiRateOfFire=5.0;

aiRateOfFireDistance=2500;

class Library {libTextDesc = $STR_LIB_9K32;};

};

Don't forget the "cfgNonAIVehicles" section with your config.cpp (or wherever it is to be put now)

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

class CfgNonAIVehicles

{

class ProxyWeapon {};

class Proxycorttim : ProxyWeapon {model = "\iegf4u\corttim.p3d"; simulation = "maverickweapon";}

class Proxycor25b : ProxyWeapon {model = "\iegf4u\cor25b.p3d"; simulation = "maverickweapon";}

     class Proxycor50b : ProxyWeapon {model = "\iegf4u\cor50b.p3d"; simulation = "maverickweapon";}

     class Proxycornapalm : ProxyWeapon {model = "\iegf4u\cornapalm.p3d"; simulation = "maverickweapon";}

   

};

http://community.bistudio.com/wiki....n_Types

Share this post


Link to post
Share on other sites

Huh ?! I said <span style='font-size:12pt;line-height:100%'>Su33</span>

I was talking my (Footmunch) released Su33 !

Share this post


Link to post
Share on other sites

Thread got me thinking of a better solution ...... and found 1 .... well at least another step close.

- Use Weapon Proxies, but don't define them in config for ammo etc

- Name each proxy (Like my above example "ch29_1" )

- Use the "hide" animation when you want that proxy to disappear (fired) reappear (reload).

- U still have to use a fired event trigger script to relocate the actual fired missile/bomb to the place where the proxy disappeared.

Advantages;

- Much easier to place and visualise your ammo hanging from the wing

- Cuts down on poly/vertex count, weapons are no longer actually in the LODs

...... now if only there was some way to get the XYZ positions of those proxies (for the re-position script), it could save heaps of time.

Share this post


Link to post
Share on other sites
Quote[/b] ] now if only there was some way to get the XYZ positions of those proxies (for the re-position script), it could save heaps of time.

What about the selectionPosition command. If the proxies themselves don't return a position. You could add a simple vertex? After that, you just need to adjust for the height of each different proxy object.

Share this post


Link to post
Share on other sites

out of curiousity.... why on the BIS Su34 there are proxies for both the rocket pods and missiles..... how do they make it work right.... or it it because the proxy for the rocket launcher is not atcually a "moving part" itself......

Share this post


Link to post
Share on other sites
or it it because the proxy for the rocket launcher is not atcually a "moving part" itself......

Exactly.

Its not "launched"

Same as the fuel tanks on the AV8

Thanks for the tip UNN .... wink_o.gif

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  

×