Jump to content
Sign in to follow this  
Prospero

Proxy objects - and interaction

Recommended Posts

Hi chaps,

Well, I suspect that I'll have to figure this one out myself, but anyway...

Proxy objects - how much interaction do they have with the game - geo collison detection / fire geo collison detection? Are they destroyable separately from the object to which they are a proxy?

Post all you know. That includes those of you jealous of the very little knowledge you have managed to acquire.

Prospero

Share this post


Link to post
Share on other sites

Hi Prospero. As 'an old hand' with oxygen, I can admit that I have experimented with the proxy problem, and have posted questions both here and in the oFPEC forums. Sadly there has not been too much information about proxies and I am still stuck where I am. How proxies react to collisions and destruction, I have not been able to ascertain. My major problem has been with using object proxies e.g. using a chair object as a proxy within my own addon was fine, as the chair object is in the data3d.pbo file with ofp.

i've been trying to use my own p3d objects as proxies, e.g. wall objects placed around a building. Try as I can, I have not found any method of making them appear. My last resort would be to recompile the data3d.pbo file with my objects in it. But then the problem arises.. I would not be able to distribute my addon without distributing the data3d.pbo. which is nigh on impossible because of its size and, probably against BIS terms as well.

I can see some exciting complex addons being created with the use of proxies. That is proxies that are new to OFP.

Sorry I wasn't much help, but this is as far as I've got.

BTW, I think you will find that a lot of the guys who have had O2 for a while are still learning, I know I am.

Cheers.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Colonel_Klink @ Oct. 10 2002,08:56)</td></tr><tr><td id="QUOTE">i've been trying to use my own p3d objects as proxies, e.g. wall objects placed around a building. Try as I can, I have not found any method of making them appear. My last resort would be to recompile the data3d.pbo file with my objects in it.<span id='postcolor'>

Proxies can be placed in other paths than \data3d, but it is a little bit more difficult.

In resistance config (addon O.pbo) we used macro PROXY_O to do the job:

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

{

#define PROXY_O(x,dir) \

class Proxy##x \

{ \

model=\o\dir\x.p3d; \

autocenter=false; \

scope=public; \

reversed=false; \

simulation="alwaysshow"; \

};

PROXY_O(postel_panelak1,misc)

PROXY_O(postel_panelak3,misc)

PROXY_O(kytka3,misc)

PROXY_O(lustr_kuch1,misc)

PROXY_O(sporak02,misc)

PROXY_O(stul_kuch1,misc)

PROXY_O(hrabe,misc)

PROXY_O(almara,misc)

PROXY_O(bedna_modr,misc)

PROXY_O(bedna_zel,misc)

PROXY_O(kachlaky,misc)

};

<span id='postcolor'>

File location of all objects above is in O\misc (i.e. misc subdirectory of addon O).

Share this post


Link to post
Share on other sites

Thanks Suma:)

I will experiment here and post results in next couple of days, but I briefly tried adding a proxy for the kytka3 object (see O.pbo above) and it worked. Kytka3 appears to be a potted plant.

So I'm figuring one can just recompile O.pbo with references to one's own proxy objects - having put the relevant .p3d files into the misc directory? Is that correct?

Other question I have right now is which LOD(s) should contain the proxy?

Best regards,

Prospero

Share this post


Link to post
Share on other sites

Oh dear... O.pbo is about 175 megs.

OK... let me try again. Let's say I'm going to model an object (let's say it's a house - called Bighouse) which I'm going to compose of the base model itself plus several proxies - but for now let's keep it simple and just add one proxy file - and let's call this proxy extension.p3d.

Let's say that the Bighouse files are residing in an addon directory called bighouse, and we put extension.p3d in a subdirectory called misc.

Then we add something like this to Bighouse's config.cpp file.

----------

class CfgNonAIVehicles

{

#define PROXY_O(x,dir)

class Proxy##x

{

model=\bighouse\dir\x.p3d;

autocenter=false;

scope=public;

reversed=false;

simulation="alwaysshow";

};

PROXY_O(extension,misc)

};

----------

I've tried this and it doesn't seem to work for me. OFP crashes on loading.

Prospero

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 10 2002,14:52)</td></tr><tr><td id="QUOTE">So I'm figuring one can just recompile O.pbo with references to one's own proxy objects - having put the relevant .p3d files into the misc directory? Is that correct?<span id='postcolor'>

No, you did not understand me. If you will change the macro definition, you can place proxy object models in any addon you want.

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

{

#define PROXY_MY(x) \

class Proxy##x \

{ \

model=\my\x.p3d; \

autocenter=false; \

scope=public; \

reversed=false; \

simulation="alwaysshow"; \

};

PROXY_MY(myModel1)

};

<span id='postcolor'>

Now you can have proxy model myModel1 in the addon my.

Share this post


Link to post
Share on other sites

AH! OK... I will go and try that. Hehehe I'll get there eventually. Thanks Suma:)

Prospero

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 10 2002,14:57)</td></tr><tr><td id="QUOTE">I've tried this and it doesn't seem to work for me. OFP crashes on loading.<span id='postcolor'>

I think you are doing it well. Maybe some problem with the model? I suggest you to try placing some known good proxy model instead of extension (like some of our misc models, e.g. kytka3).

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 10 2002,14:52)</td></tr><tr><td id="QUOTE">Other question I have right now is which LOD(s) should contain the proxy?<span id='postcolor'>

Any LODs you like. In normal LODs you can choose in which lods you want proxies to be visible. If you will place proxy in geometry, it will be included in collision testing as well. If you will place proxy in firegeometry, it will stop bullets. If you place it in viewgeometry, AI will not be able to see trough it.

Share this post


Link to post
Share on other sites

OK, I rewrote the code as follows:

----------

class CfgNonAIVehicles

{

#define PROXY_BIGHOUSE(x,dir)

class Proxy##x

{

model=\bighouse\dir\x.p3d;

autocenter=false;

scope=public;

reversed=false;

simulation="alwaysshow";

};

PROXY_BIGHOUSE(extension,misc)

};

----------

I followed the very same proceedure as detailed before in terms of adding this to the end of bighouse.cpp.

OFP crashes to desktop on loading with the error:

bighouse\config.cpp/CfgVehicles/CfgNonAIVehicles/:'#' encountered instead of '{'

.... I'm desperate to get this working:)!!!

Prospero

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 10 2002,16:22)</td></tr><tr><td id="QUOTE">OK, I rewrote the code as follows:

OFP crashes to desktop on loading with the error:

bighouse\config.cpp/CfgVehicles/CfgNonAIVehicles/:'#' encountered instead of '{'<span id='postcolor'>

You are now missing backslashes on the line ends. Those are neceessary for macro PROXY_... to work. If you do not want to use macro, you may do it as below. It will require more work when adding many proxy types, though.

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

{

class ProxyExtension

{

model=\bighouse\misc\extension.p3d;

autocenter=false;

scope=public;

reversed=false;

simulation="alwaysshow";

};

};

<span id='postcolor'>

I am afraid you will get the same crash you already had, unless you already found some problem in your extension.p3d.

Share this post


Link to post
Share on other sites

Thanks for all the help Suma, but I can't get either method working - always crashes out - both methods identically. Must be some problem with extension.p3d. Anyway, I'll pack it in now and try again tomorrow. I'm sure I'll get it working.

Thanks again:)

PS: If anyone gets it working in the meantime, do please post a simple demo. This makes large objects a real proposition. At the moment, my aircraft carrier is lots of individual objects, rather than one object with lots of proxies. This new method will hopefully mean that I can define it as one bigship (dynamic) instead of several houses (static), for as Fliper has pointed out, roadway LODS work for creating walkable surfaces on dynamic objects - although obviously, objects walking on these surfaces do not follow the movement of the surface.

Then again, it'll probably end up a combination of several objects, all with multiple proxies so that multiple turret weapons are possible, but now at least the hull can be "one" object of simulation-type ship (or bigship) - can't remember which. Mind's gone blank.

Prospero

Share this post


Link to post
Share on other sites

Well, today I didn't have a lot of coding time, but I'm still crashing my computer a lot;)

Maybe tomorrow.. (as the Eagles once sang)

Have you got it to work yet, Col Klink?

Prospero

Share this post


Link to post
Share on other sites

Hi Prospero

Here's what i experimented to day with and it works: I've commented some of it for you.

class CfgNonAIVehicles

{

#define PROXY_CWKsubstat(x,mods) \

// CWKsubstat = name of the addon

// x leave as is. It represents the proxy name.. i think

// mods = name of the sub folder within CWKsubstat

class Proxy##x \

{ \

model=\CWKsubstat\mods\x.p3d; \

// straight forward enough: the name of the addon, the sub folder inside the addon and x.p3d is for the name of the addon. Leave it as is if you are putting more than one proxy model. you'll see why below

autocenter=false; \

scope=public; \

reversed=false; \

simulation="alwaysshow"; \

};

// there are the two different models here that I used as proxies: trans.p3d and shed.p3d. You'll see that I had them in the mods sub folder just to keep it tidy.

PROXY_CWKsubstat(Trans,mods)

PROXY_CWKsubstat(Shed,mods)

};

The above works well, but my ftp wasn't to post a piccy.

Question for Suma. Although I have set all the geometry and fire gemeotry lod for the proxies i am still able to shoot and walk through them. I have even added the proxies to the fire geometry and geometry lods of the addon.

I have a small building as a proxy but even when there is a roadway lod and I cannot walk acroos the floor.. any ideas?

Also I have experimented with a flag on a car but i can't get the thing to flutter.. any way around this?

Btw, Suma, I'm enjoying this latest challenge. thanks.

Share this post


Link to post
Share on other sites

Saturday afternoon and I'm just about to have a go at it again, Col Klink. Thanks for that response. It's odd because that is precisely what I've got too... but I think I know what's wrong... I was playing around with some 'unusual' models...

One thing you might try - change the simulation type to "house". Just a thought if you haven't got it working yet. Then again, it may be that proxies must be of sim-type "alwaysshow" as they are part of CfgNonAIVehicles - who knows?

Prospero

Share this post


Link to post
Share on other sites

Colonel Klink,

Damn it, I still get the very same error - new objects - new config... damn!

1) Is there some additional thing I'm missing? Do you have to have the proxies in the Memory LOD, for example?

2) Could you possibly post your entire config for your house? I would be SO grateful:)

Edit: 3) And which PBO compiler are you using?

How frustrating!

Prospero

Share this post


Link to post
Share on other sites

Hi Prospero

Here's the entire config:

// CWKSubstation by Colonel_Klink

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

// type scope

#define private 0

#define protected 1

#define public 2

#define CanSeeRadar 1

#define CanSeeEye 2

#define CanSeeOptics 4

#define CanSeeEar 8

#define CanSeeCompass 16

#define CanSeeRadarC CanSeeRadar+CanSeeCompass

#define CanSeeAll 31

class CfgPatches

{

class CWK_SubStation

{

units[] = {CWK_SubStation};

//weapons[] = {};

requiredVersion = 1.20;

};

};

class CfgVehicles

{

class All{};

class AllVehicles:All{};

    class Land: AllVehicles {};

    class Static : Land {};

    class Building : Static {};

    class NonStrategic : Building {};

  class CWK_SubStation: NonStrategic

{

side=twest;  

vehicleClass="Objects";

  displayName="CWK_SubStation";

  accuracy=1.000000;

  scope=2;

model="\CWKSubstat\substation";

icon="\CWKSubstat\sub.paa";

  armor=200;

};

 

};

class CfgNonAIVehicles

{

#define PROXY_CWKsubstat(x,mods) \

class Proxy##x \

{ \

model=\CWKsubstat\mods\x.p3d; \

autocenter=false; \

scope=public; \

reversed=false; \

simulation="alwaysshow"; \

};

PROXY_CWKsubstat(Trans,mods)

PROXY_CWKsubstat(Shed,mods)

};

1. No I don't have the proxies in the memory lod.. might try that.

2. posted above

3. I use DePBO

And here's the result:

proxy.jpg

I'm getting some wierd things happening with them. Like the player being caught up in the transformers or the walls of the building. And bullets pass through them.

Share this post


Link to post
Share on other sites

Many thanks Colonel Klink:)

I will give it a go come daybreak;)

Edit: AND FINALLY! It works...:) Must have been a dodgy config (i.e. not the CfgNonAIVehicles part).

Many thanks again, Colonel Klink.

Now, I will see about the collision detection.

Prospero

Share this post


Link to post
Share on other sites

Hi all,

Well, I seem to be experiencing the same problem you had, Colonel Klink. I can walk & shoot through proxies.

Additionally, any idea what "reversed" does in the config? All it says there is that statics are not reversed, and dynamic objects are reversed. But reversed how...? Rotated? Put through a worm-hole?

Edit - OK it rotates them round Z axis by 180. Dunno what else it does though.

Prospero

Share this post


Link to post
Share on other sites

Suma, any chance of a couple of pointers here? I'd be most grateful.

I've spent the past two days on this, and I still can't get collision detection to work for proxy objects (neither in terms of blocking other objects or bullets). I have been using very simple objects in my experiments (< 100 vertices in all cases for all LODs).

I am defining the following LODs (followed by processes) for the proxy object:

1) 0 resolution

2) Geometry (simplified geometry / Component Convex Hull / add mass)

3) Fire Geometry (Find Components only - I do not make this convex)

4) Roadway (where appropriate, and Find Components)

5) Land Contact (where appropriate)

Further, (just in case) I have put the proxy as a named selection in the Memory LOD of the base model.

EDIT: I've just had a thought. I do not have a CfgModels entry in the config... hmm how would this work for proxies if it is required?

I have used the config.cpp snippet recommended by Suma without alteration. This works now - i.e. I no longer suffer OFP crashing on loading.

The second issue is regarding whether a custom rotation axis can be defined on the base object, and then a proxy object triangle be named as a selection in order that it can be rotated via the Animate command. I suspect the answer is no. Could you possibly confirm this Suma?

Many thanks (crosses fingers) smile.gif Sorry to be such a pain, Suma.

Prospero

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 14 2002,15:40)</td></tr><tr><td id="QUOTE">2) Geometry (simplified geometry / Component Convex Hull / add mass)

3) Fire Geometry (Find Components only - I do not make this convex)

4) Roadway (where appropriate, and Find Components)

5) Land Contact (where appropriate)<span id='postcolor'>

I think Roadway a Landcontact are not supported in proxy objects. As for collisions: did you try the objects you use for proxies as standalone objects? (One thing that might prevent collisions from working is too low mass, another is some mistake in component definition.)

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">The second issue is regarding whether a custom rotation axis can be defined on the base object, and then a proxy object triangle be named as a selection in order that it can be rotated via the Animate command. I suspect the answer is no. Could you possibly confirm this Suma?

<span id='postcolor'>

I think the answer is: "No, it will not work", but I am not sure.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">I think Roadway a Landcontact are not supported in proxy objects. As for collisions: did you try the objects you use for proxies as standalone objects? (One thing that might prevent collisions from working is too low mass, another is some mistake in component definition.)<span id='postcolor'>

Ok.. so its back to the drawing board on using proxies to add extra buildings or rooms. Or even as fences.

Suma, is there a way of including multiple models to create a single addon. I tried it with the radar bunker a while ago, but that meant creating models specially for the addon as a group, which resulted in some pretty weird positions if one part was moved in the editor.

Share this post


Link to post
Share on other sites

Hi Colonel Klink,

Did you at least manage to get collision detection to work? I'm still failing at this. Even if proxies can't be used as roadways, they could still be tremendously useful for creating large structures.

I tried everything Suma said - yes, all my objects are first checked as standalone objects - and yes, in this case they work as intended (collisions work - of both kinds, and they cast shadows etc).

Adding a CfgModels class did not make any difference.

Most frustrating... but I'll keep trying.

Prospero

Share this post


Link to post
Share on other sites

yeah. Mine work ok as standalone addons, but unfortunately i haven't been able to get the collision thingee to work proberly either. Back to it I guess.

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  

×