UNN
Member-
Content Count
1767 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by UNN
-
Call loadfile or a pre-compiled function that’s freed up after execution, would be better if you can get away with it? For JIP there are at least 10 opportunities to execute functions and commands, before ExecVM executes from a configs init event. These include the mission editor init fields. A dedicated server has four and an MP client has 2. So it does cut out some useful functionality if you only use ExecVM. Where as the Call command will cover all of these events. *Edit: Actually I just realised, it only presents a problem if both addons are calling the same script. Which reduces the likely hood of this happening, even more. So it probably isn't anything to worry about after all. So the following isn't relevant in most cases. That’s what worries me, we may not always have control over this. If addons from different authors are combined into a mission. The scenario I was thinking about, might be when you have two different addons: Addon A: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">cfgVehicles My_Unit1 : SoldierWB     {     ....     ....     class Extended_Init_EventHandlers         {         class My_Unit1             {             My_Unit1_class_init="(_this select 0) exec ""\My_Addon\Unit1_Script.sqs"";";             };         };     }; Addon B: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class My_Unit1; cfgVehicles My_Unit2 : My_Unit1     {     ....     ....     class Extended_Init_EventHandlers         {         class My_Unit2             {             My_Unit2_class_init="(_this select 0) exec ""\My_Addon\Unit2_Script.sqs"";";             };         };     }; Won't the inheritsFrom command execute Unit1's init event a second time, from within Unit2's addon? Not that such a scenario is going to happen all that often. But it's best people are at least aware of it, if it does.
-
When I try to view binarized BI models in Bulldozer, via a proxy i.e Select Create, Proxy, then browse to P:\Ca\Wheeled\HMMWV.p3d It always hides selections. You see the selections flash on the bulldozer view briefly, then there removed. The proxies work fine in game, just not with Bulldozer. Any idea if I can fix this? Cheers
-
No there selections. The only way to view a binarized object in Bulldozer, is to point to it with a single proxy. Only Bulldozer will hide most of the default selections, unless you tell it which skeleton to inherit from.
-
Got it sorted now: I had to create a Model.cfg for the object holding the proxy: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSkeletons     {     class Car; //Define base class.     class ProxyCfgObjBones: Car         {         isDiscrete=1;         skeletonInherit = ""; //Inherit all bones from class Car.         skeletonBones[]={};         };     }; class cfgModels     {     class Car;     class ProxyCfgObj: Car         {         skeletonName = "ProxyCfgObjBones";         sectionsInherit="";         sections[]={};         };     };
-
I need to be able to view all the standard Arma addons in Bulldozer, so I'm trying to point to the content of the games addons. I moved an unpacked version of vehicles.pbo, to my P: drive (P:\Ca\Wheeled\HMMWV.p3d). I create a single proxy as described above, then try and view it. Bulldozer does not report any missing objects or textures and it does briefly draw the object correctly, then quickly hides the selections. No worries, I can view the MLOD addons distributed by BI ok. Only I need to view all the games objects as proxies, for reference. It works ok for simple objects like ammo crates e.t.c just not for complex vehicles. Cheers
-
Without knowing what building your using, it's hard to say. But try dropping yourself over the roof top, and see if your feet touch the roof. If you still get a gap, when your standing on it as a player, then it's the way the object has been setup.
-
Thanks for posting the links to the mirrors. Managed to check it out know, so I have a couple of questions: Any reason why you used ExecVM to launch the init events, rather than Call? Another thing that worried me, was inheritance. If a unit using the extended init event handlers, inherits from another unit using a different extended init event. Will the extended init events assigned to the parent, be executed twice, when really they shouldn’t?
-
You have to watch the setpos commands when used with objects that have one or more roadway LOD's. Like bridges and multi storey buildings. Same applies for SetPosASL. For example, if you have a bridge with a roadway, 10m above the ground. You can setpos an object at 10.01 m and it will sit on the roadway. Setpos it at 10.5 M and it will be 10.5 meters above the bridges roadway. There is a small tolerance for roadways, if you exceed it, the object is positioned relative to the roadway and not the ground. So you have to use trial and error. But it helps to get a rough idea of how high up you will be setting the object, then work from that.
-
Is there a limit in the compiler?
UNN replied to Nutty_101's topic in ARMA - MISSION EDITING & SCRIPTING
I could not be bothered finding the actual limit, but you can have more than 2038 characters. The limit being enforced could be down to the Format command? In OFP using Format with a large string would cause a CTD. Any way, I tried this as a quick test: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Count=0; _Str="["; While {_Count<20000} Do     {     _Str=Str+"1111111111,";     _Count=_Count+1;     }; _Str=Str+"1111111111]"; Hint Format ["Count %1",Count (Call Compile _Str)]; The above code will return an array count of 20001 elements. So that’s just about 20001*11 characters in _Str without any problems so far. If it is down to the format command, you could store your scripts in arrays, written into functions. For example: MyScript.sqf: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[ "_Count=0;", "_Str=""["";", "While {_Count<20000} Do", "{", "_Str=Str+""1111111111,"";", "_Count=_Count+1;", "_Str=Str+"1111111111]";" ] So then you would have something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Source=Call Complile LoadFile "MyScript.sqf"; _Output=""; {_Output=_Output+_x} ForEach _Source; _pScript=[] Spawn (Compile _Output); Like I said, I only did a quick test. Also not sure how this will fit into what your actually trying to do. -
I'm certainly interested in taking a look at it. But are there any mirrors? I can't download anything from FileFront.
-
What about the size of the rigg at the moment? If you exceed something like 50 to 65m for your objects bounding box, you also have split the object. Seen as your already splitting some objects. You could always model other parts of the rigg as seperate objects to. That way you can give them seperate destruction effects via the config?
-
I'm a little confused about the point behind the blog. I think the tools are already in place to recreate the topography of real world locations, with or without Arma 2? It kind of comes across as either guilt or frustration, that real world objects can't be used. Because of fears they might be considered a little to drab, compared to the average gamers view of the European countryside? To me at least, the Real-life terrain, looks just like the landscape in the North of England. So I could live without majestic pines
-
Local variables filtering down
UNN replied to dmarkwick's topic in ARMA - MISSION EDITING & SCRIPTING
No, at least you can't access them from new missions, so there as good as gone. They won't interfere with other missions. -
Yeah, the While loop used to just terminate after 10,000 cycles in previous versions of Arma. It was changed recently. Considering those two commands is as good a place to start as any. It's a subject that comes up on numerous occasions, only it used to be the @ command in OFP, instead of WaitUntil. Ok, you might not think it’s the most important question, but it’s still a valid question.
-
I'm definitely thinking back to found memories, of loosing half my work, because I forgot to add one simple command to a script, when running fullscreen But my point is, the whole concept of time, as measured by the game. Only helps to confuse things in this context. My original opinion still stands, having a better understanding helps tackle specific problems. This thread is a good example, which sbsmac is already aware of. Ok, it's true the majority of people won't encounter this kind of problem. Not everyone wants to run 110 player servers. But for anyone who wants to push the game as far as they can, it's a valid topic for discussion. But getting back to measuring game time e.t.c You can execute a line of code 9,999 times and it won't register on the game clock at all: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Count=0; _MyTime=Time; While {_Count<9999} Do { _Count=_Count+1; }; Player SideChat Format ["Time %1",Time-_MyTime]; So arguing over whether you can run a script at exactly 0.001 seconds is kind of missing the point. It's possible, to seriously effect the games performance, with scripts alone. As you say, second guessing the game might not be much help. But being able to make informed decisions, based on the kind of tests Doolittle posted. Is hardly going to be detrimental to anyone?
-
Lol...It's possible to run an OFP/Arma script at 0 frames per second
-
It was more a general question, about what the sleep command is perceived to do. Sorry, your post wasn't displayed when I made mine. Of course, but not with every command, every 0.001 seconds. You can bring the game to a grinding halt, with one line of code. I think it helps to try and understand what’s going on, so we can way up the best approach to a specfic problem.
-
I reckon one thing you can safely say is. Sleep is the most efficient way of pausing for a predetermined amount of time. As for the rest, a lot depends on the circumstance. But out of curiosity, which do you think, from these two. Is the quickest condition to check, from a CPU's point of view? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If _ABool Then {}; Or <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (_ANum>_BNum) Then {};
-
Is this a new forum rule, have I missed something? Are we supposed to visit every thread, once a month and comment on if it's changed suffucently for our tastes? So thats 48902 people, posting in 65200 topics, once a month. That sounds like fun...Or are you a special case
-
Local variables filtering down
UNN replied to dmarkwick's topic in ARMA - MISSION EDITING & SCRIPTING
Theres a simple way, where you just pass everything when each script is called? Say you start your fire with an exploding oil drum using: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[This,0,100] Spawn DMW_BurnObject Then DMW_BurnObject has this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Object=_This Select 0; _BurnCount=_This Select 1; _BurnMax=_This Select 2; //Get the next lot of combustables using whatever method _NearestObjects=...blah...blah... { _BurnCount=_BurnCount+1; If (_BurnCount<_BurnMax) Then     {     [_x,_BurnCount,_BurnMax] Spawn DMW_BurnObject;     }; } ForEach _NearestObjects; But that method is not very dynamic. Another way would be to use a global array, with each array element holding a counter for a separate "patch" of fire. Init.sqf: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">DMW_BURNARRAY=[]; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[This,-1,100] Spawn DMW_BurnObject <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Object=_This Select 0; _PatchIndex=_This Select 1; _BurnMax=_This Select 2; //Initialise local variable _BurnCount=-1; //See if it's a new script started by something other than a previous copy DMW_BurnObject If (_PatchIndex==-1) Then     {     _PatchIndex=(Count DMW_BURNARRAY);     If (_PatchIndex>0) Then         {         _PatchIndex=_PatchIndex-1;         };     _BurnCount=1;     }     Else     {     //Increment the counter for the current patch     _BurnCount=(DMW_BURNARRAY Select _PatchIndex)+1;     }; //Update the counter in the array DMW_BURNARRAY Set [_PatchIndex,_BurnCount]; //Get the next lot of combustables using whatever method _NearestObjects=...blah...blah... { //Increment the counter for the next object _BurnCount=_BurnCount+1; If (_BurnCount<_BurnMax) Then     {     //Update the count for a specific patch     DMW_BURNARRAY Set [_PatchIndex,_BurnCount];     //Launch another script     [_x,_PatchIndex,_BurnMax] Spawn DMW_BurnObject;     }; } ForEach _NearestObjects; Obviously there is more to it than just that, but with global arrays you can decrease the counter when old fires die out. Allowing you to wait for old fires to die out, if you reached the maximum, before spawning new ones. Also it will allow you to keep track of how many fires you have running across the entire map, simply by totalling up the count for the entire array. There are other ways that avoid global variables. But I think that’s just making it way to complicated. -
SetVectorUp, SetVectorDir and 3D coords
UNN replied to UNN's topic in ARMA - MISSION EDITING & SCRIPTING
There you go -
Hi, I'm trying to make sense of two new commands, setVectorUp and setVectorDir. These commands should allow us to change the pitch and bank of objects. However it's not turning out to as simple as I had hoped for. I didn't take long to realise there was something a bit more complex than say, velocity vectors. I got to thinking it might be based on 3D transformations? But I know next to nothing about proper 3D maths, so I'm left blindly stabbing around in the dark. The only thing I did managed to do, was rotate a vehicle using setVectorDir. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Aircraft=_This Select 0; _Aircraft SetFuel 0; _Pos=GetPos _Aircraft; _Pos Set [2,7]; _Inc=0; WaitUntil    {    _Inc=_Inc+0.1;    _Aircraft SetPos _Pos;    _Aircraft SetVectorDir [Sin _Inc,Cos _Inc,0];    Hint Format ["Up : \n%1\n\nDir :\n%2\n\nInc :\n%3",VectorUp _Aircraft,VectorDir _Aircraft,_Inc];    }; Hardly an achievement, seen as you can already do this with setDir in a loop. But getting some sort of sensible reaction out of these commands is a milestone for me. Just to give you another example, I tried the same idea with setVectorUp: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Aircraft=_This Select 0; _Aircraft SetFuel 0; _Pos=GetPos _Aircraft; _Pos Set [2,7]; _Inc=0; WaitUntil    {    _Inc=_Inc+0.1;    _Aircraft SetPos _Pos;    _Aircraft SetVectorUp [Sin _Inc,Cos _Inc,0];    Hint Format ["Up : \n%1\n\nDir :\n%2\n\nInc :\n%3",VectorUp _Aircraft,VectorDir _Aircraft,_Inc];    }; It still rotates, but as you can see, it's now fixed in a 90 degree bank? I've tried as many combinations of Sin, Cos e.t.c As I can think of, but so far, standard rotation is all I can work out. Just wondered if anyone else has tried this out, or perhaps knows more about the parameters these commands use? If not, there is always the hope that a maths whiz  will come along to throw some light on this.
-
is there a way to lock and unlock cars with a code
UNN replied to apex130's topic in ARMA - MISSION EDITING & SCRIPTING
A bit offtopic, not sure what this has to do with the Comref? But the the Wiki could certainly be updated with a note about the change in behaviour, for the Lock command in Arma. Anyone who can be bothered to knock up a quick test mission -
is there a way to lock and unlock cars with a code
UNN replied to apex130's topic in ARMA - MISSION EDITING & SCRIPTING
Yep, looks like it does after a quick test in SP at least. Good news all round. One less thing to worry about Cheers I was looking at having to create Game Logics grouped with civilians, to fill all the cargo slots. Just to stop AI boarding vehicles for a script based system. Hopefully MP works the same. Still comes up with the getin option, but anything is better than friendly fire. So I can live with that -
Why would someone want to do that? If someone goes out of their way to confuse everyone else, there is only one natural conclusion... So far, what I've read on the wiki seems pretty explicit.