Jump to content
Sign in to follow this  
Mr Groch

Checking if object can be rendered

Recommended Posts

Hi!

I'm continuing HqPL work on ArmA Real Time Editor.

I'm currently working at bug fixes wink_o.gif

It is possible to check if object can be rendered before

creating it? If someone is using editor upgrade, he will have listed

objects that are causing CTD's, and I want to check if

that object can be rendered, before creating it...

Currently I am using preloadobject method to prevent

creating such object in MP sessions, but player, that

is trying to create such object will have CTD...

Thx!

PS. I have also one other problem - it is possible

to transmit arrays that contains other arrays over the net?

Share this post


Link to post
Share on other sites
Quote[/b] ]It is possible to check if object can be rendered before

creating it? If someone is using editor upgrade, he will have listed

objects that are causing CTD's, and I want to check if

that object can be rendered, before creating it...

There are a couple of ways, depending on how the object was setup. Perhaps the best method now, would be to see if the class name exist in the configs. Take a look at config_name or one of the related commands.

Although I'm sure there is a better command, only I can never remember what it is sad_o.gif

Quote[/b] ]I have also one other problem - it is possible

to transmit arrays that contains other arrays over the net?

Yes, but if your looking for an easy way, then no. You have to add the references yourself. Say you had an array setup like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MYFIRSTARRAY=[A,B,C,D];

MYSECONDARRAY=[1,2,3,4,MYFIRSTARRAY];

Assuming MYFIRSTARRAY has already been initialised on the client, you could broadcast MYSECONDARRAY, after converting it to something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[1,2,3,4,"ARRAYPOINTER:MYFIRSTARRAY"]

When MYSECONDARRAY is updated on a client, you could write a function that searches for the tag ARRAYPOINTER: and converts the suffix MYFIRSTARRAY to a variable, which is then implanted as an array pointer, into the original array to replace the text string "ARRAYPOINTER:MYFIRSTARRAY".

Sorry I can't be anymore specific about all this, only I've never had to so this as yet, so it's all just theory. But it will work under given circumstances.

Share this post


Link to post
Share on other sites
Quote[/b] ]It is possible to check if object can be rendered before

creating it? If someone is using editor upgrade, he will have listed

objects that are causing CTD's, and I want to check if

that object can be rendered, before creating it...

There are a couple of ways, depending on how the object was setup. Perhaps the best method now, would be to see if the class name exist in the configs. Take a look at config_name or one of the related commands.

Although I'm sure there is a better command, only I can never remember what it is sad_o.gif

Quote[/b] ]I have also one other problem - it is possible

to transmit arrays that contains other arrays over the net?

Yes, but if your looking for an easy way, then no. You have to add the references yourself. Say you had an array setup like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MYFIRSTARRAY=[A,B,C,D];

MYSECONDARRAY=[1,2,3,4,MYFIRSTARRAY];

Assuming MYFIRSTARRAY has already been initialised on the client, you could broadcast MYSECONDARRAY, after converting it to something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[1,2,3,4,"ARRAYPOINTER:MYFIRSTARRAY"]

When MYSECONDARRAY is updated on a client, you could write a function that searches for the tag ARRAYPOINTER: and converts the suffix MYFIRSTARRAY to a variable, which is then implanted as an array pointer, into the original array to replace the text string "ARRAYPOINTER:MYFIRSTARRAY".

Sorry I can't be anymore specific about all this, only I've never had to so this as yet, so it's all just theory. But it will work under given circumstances.

1. All class names of listed objects exist in the configs, becouse

that list is created by reading all classes from CfgVehicles...

Some objects like Land_molo_drevo_krychle, Land_townhall, etc

exists in the configs but are causing CTD when trying

to create it...

2. That array looks like this: array = [[a1,a2,...],[b1,b2,...],[c1,c2,...],[],[],[]];

Not array variable in other array variable, just 2d array wink_o.gif

Thanks

Share this post


Link to post
Share on other sites
Quote[/b] ]1. All class names of listed objects exist in the configs, becouse

that list is created by reading all classes from CfgVehicles...

Some objects like Land_molo_drevo_krychle, Land_townhall, etc

exists in the configs but are causing CTD when trying

to create it...

The only time I've had a CTD when creating objects, is when either the main p3d can't be found, or a proxy in the p3d can't be found. There may be other ways, but for me that’s the main cause.

But I don't understand what you’re trying to do. You mentioned about editor updates, is the editor update causing the CTD? Or are you making your own objects using the content of the editor update?

Quote[/b] ]it is possible

to transmit arrays that contains other arrays over the net

Arrays that contain other arrays can be many things. Objects are also pointers wink_o.gif

Assuming the new PublicVariable command won't help with nested arrays? Then depending on what sort of info is in the array, it can be very easy.

For example, if you have an array of letters and numbers:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MYARRAY=[1,2,3,["A","B","C"]]

MYARRAY can be converted to a string, broadcast over the network, and converted back into an array on the clients.

If your Array contains either array pointers or objects, groups e.t.c Then you still have the same problem, you will have to do something along the lines of my previous post.

Quote[/b] ] That array looks like this: array = [[a1,a2,...],[b1,b2,...],[c1,c2,...],[],[],[]];

Given the variable names you used in your example. I can only assume they are objects?

Of course you can circumvent that particular problem if you populate your arrays on each client, as and when the objects are created.

Share this post


Link to post
Share on other sites
Quote[/b] ]1. All class names of listed objects exist in the configs, becouse

that list is created by reading all classes from CfgVehicles...

Some objects like Land_molo_drevo_krychle, Land_townhall, etc

exists in the configs but are causing CTD when trying

to create it...

The only time I've had a CTD when creating objects, is when either the main p3d can't be found, or a proxy in the p3d can't be found. There may be other ways, but for me that’s the main cause.

But I don't understand what you’re trying to do. You mentioned about editor updates, is the editor update causing the CTD? Or are you making your own objects using the content of the editor update?

Quote[/b] ]it is possible

to transmit arrays that contains other arrays over the net

Arrays that contain other arrays can be many things. Objects are also pointers wink_o.gif

Assuming the new PublicVariable command won't help with nested arrays? Then depending on what sort of info is in the array, it can be very easy.

For example, if you have an array of letters and numbers:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MYARRAY=[1,2,3,["A","B","C"]]

MYARRAY can be converted to a string, broadcast over the network, and converted back into an array on the clients.

If your Array contains either array pointers or objects, groups e.t.c Then you still have the same problem, you will have to do something along the lines of my previous post.

Quote[/b] ] That array looks like this: array = [[a1,a2,...],[b1,b2,...],[c1,c2,...],[],[],[]];

Given the variable names you used in your example. I can only assume they are objects?

Of course you can circumvent that particular problem if you populate your arrays on each client, as and when the objects are created.

I'm making Real Time Editor for ArmA. Editor scripts are

reading info about available objects from configs. And if

client is using editor update - all "hidden" objects also

will be visible. Problem is, that ome of the objects can't be

rendered, and I want to detect this, before he will try

to create such object...

Try to use SIX Editor upgrade and place townhall from

#Buildings in standart ArmA editor - CTD wink_o.gif

And thanks for that arrays tip, will try this

Share this post


Link to post
Share on other sites
Quote[/b] ]Try to use SIX Editor upgrade and place townhall from

#Buildings in standart ArmA editor

You might as well exclude the object from your dialog, using it's class name. No object exists within ARMA for the Townhall, thats why you get the CTD.

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  

×