Mr Groch 0 Posted January 21, 2008 Hi! I'm continuing HqPL work on ArmA Real Time Editor. I'm currently working at bug fixes 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
UNN 0 Posted January 21, 2008 Quote[/b] ]It is possible to check if object can be rendered beforecreating 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 Quote[/b] ]I have also one other problem - it is possibleto 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
Mr Groch 0 Posted January 21, 2008 Quote[/b] ]It is possible to check if object can be rendered beforecreating 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 Quote[/b] ]I have also one other problem - it is possibleto 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 Thanks Share this post Link to post Share on other sites
UNN 0 Posted January 22, 2008 Quote[/b] ]1. All class names of listed objects exist in the configs, becousethat 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 possibleto transmit arrays that contains other arrays over the net Arrays that contain other arrays can be many things. Objects are also pointers 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
Mr Groch 0 Posted January 23, 2008 Quote[/b] ]1. All class names of listed objects exist in the configs, becousethat 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 possibleto transmit arrays that contains other arrays over the net Arrays that contain other arrays can be many things. Objects are also pointers 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 And thanks for that arrays tip, will try this Share this post Link to post Share on other sites
UNN 0 Posted January 24, 2008 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