UNN
Member-
Content Count
1767 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by UNN
-
Particles obstructing weapon view
UNN replied to Q1184's topic in ARMA : CONFIGS AND SCRIPTING (addons)
Yeah, thats what happens when I tried it. It always spawns from the objects centre. -
Particles obstructing weapon view
UNN replied to Q1184's topic in ARMA : CONFIGS AND SCRIPTING (addons)
By chance, how are you generating the particles. If your using a named selection for the particle spawn point, is that named selection in the View - Gunner LOD? BTW if you can spawn particles from the location of an objects named selection, tell me how So far I can't get it to work -
call doesn't work but execVM works
UNN replied to d3nn16's topic in ARMA - MISSION EDITING & SCRIPTING
Without seeing the code in both of those scripts, it's impossible to say for sure. All we can do is guess. Perhaps your using a command that’s exclusive to ExecVM and won't work with the call command? Also there is locality, any variable that isn't defined as private within the call command, will be global to the calling script and function, so it's prone to being overwritten. -
The new system will probably be along the lines of Aces, but there are other ways to represent dynamic, visual elements on a vehicle. There are some new features to in Arma, that circumvent some of the problems with Aces in OFP. Although there was no reason why Aces could not have had, dynamic load outs via a GUI in OFP, other than Hardrock not having the time to do them. I'm assuming the difference your highlighting is to do with hardcoded weapon proxies over dynamic ones? So I don't see why we can't have a GUI built in by default, no matter which method we use? Like the Cargo system, I plan to use some sort of object orientated properties, for weapons, ammo and their pylons. I'm sure that if you build the correct rules into each of those three elements, it will work itself out?
-
Don't think you can get away that easily, you're still here through association Let us know how the conversion goes, it does look like an interesting engine.
-
Well it's all good fun. It may or may not be considered the cutting edge atm, but BI on it's own, is just one big toy box I have taken a break from the cargo system, but I've done most of what I wanted to do. So I will be returning to it, with renewed vigour!
-
RKSL has been working on a fixed wing, MP compatible, laser designator turret for the Predator and Tornado e.t.c With a fully functional, mouse controlled, remote turret. A demo video will be ready some time soon. The Talon is also in the works to.
-
Here's an unpacked example mission: UNN_AH_Hellfire_Attack.zip The script turned out to be easier than before: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle=_This Select 0; _Targets=_This Select 1; _Vehicle SwitchCamera "internal"; { WaitUntil     {     _Vehicle Reveal _x;     _Vehicle DoTarget _x;     Sleep 1;     !(Alive _x)     }; } ForEach _Targets; Looks like BI fixed the firing priority bug in the previous versions of Arma. Just remove the following line, once your happy the AH is doing it's job. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle SwitchCamera "internal"; You may have to add some extra bits, the script doesn't check to make sure the AH is still alive. But that might not matter?
-
I have a simple (ish) script that gets the AH-1 to fire it's Hellfires from two to three thousand meters away, if thats any help?
-
call compile scalar error with array?
UNN replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
It should be something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_carli=call compile format ["li%1 select 0", _name]; hint Format ["%1",_carli]; Or like this, depending on how you want to do it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_carli=ObjNull; call compile format ["_carli = li%1 select 0", _name] hint format["%1",_carli]; -
Yeah and the length of time it takes to reload each round in the config, is the time it takes to move to the next phase. To animate a six barrelled rotating gun, with a hundred rounds per mag, you would have: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class ammo_belt_rotation    {    type="rotationZ";    source="belt_rotation";    selection="barrel selection";    axis="axis";    memory=1;    sourceAddress="loop";    minValue=0;    maxValue=0.01;    Angle0=0;    Angle1=Rad 60;    };
-
MrFlea's function after it's been loaded into memory with PreProcessFile looks like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private["_x","_y","_z","_a","_t_sin","_t_cos","_dir","_up"]; _a = _this select 1; _t_sin = sin -(_a select 0); _t_cos = cos -(_a select 0); _x =[[_t_cos,_t_sin,0],[-_t_sin,_t_cos,0],[0,0,1]]; _t_sin = sin (_a select 1); _t_cos = cos (_a select 1); _y =[[1,0,0],[0,_t_cos,_t_sin],[0,-_t_sin,_t_cos]]; _t_sin = sin (_a select 2); _t_cos = cos (_a select 2); _z =[[_t_cos,0,-_t_sin],[0,1,0],[_t_sin,0,_t_cos]]; _a = [[((_y select 0) select 0) * ((_x select 0) select 0)+ ((_y select 0) select 1)* ((_x select 1) select 0)+ ((_y select 0) select 2)* ((_x select 2) select 0), Â Â Â ((_y select 0) select 0) * ((_x select 0) select 1)+ ((_y select 0) select 1)* ((_x select 1) select 1)+ ((_y select 0) select 2)* ((_x select 2) select 1), Â Â Â ((_y select 0) select 0) * ((_x select 0) select 2)+ ((_y select 0) select 1)* ((_x select 1) select 2)+ ((_y select 0) select 2)* ((_x select 2) select 2)], Â Â Â [((_y select 1) select 0) * ((_x select 0) select 0)+ ((_y select 1) select 1)* ((_x select 1) select 0)+ ((_y select 1) select 2)* ((_x select 2) select 0), Â Â Â ((_y select 1) select 0) * ((_x select 0) select 1)+ ((_y select 1) select 1)* ((_x select 1) select 1)+ ((_y select 1) select 2)* ((_x select 2) select 1), Â Â Â ((_y select 1) select 0) * ((_x select 0) select 2)+ ((_y select 1) select 1)* ((_x select 1) select 2)+ ((_y select 1) select 2)* ((_x select 2) select 2)], Â Â Â [((_y select 2) select 0) * ((_x select 0) select 0)+ ((_y select 2) select 1)* ((_x select 1) select 0)+ ((_y select 2) select 2)* ((_x select 2) select 0), Â Â Â ((_y select 2) select 0) * ((_x select 0) select 1)+ ((_y select 2) select 1)* ((_x select 1) select 1)+ ((_y select 2) select 2)* ((_x select 2) select 1), Â Â Â ((_y select 2) select 0) * ((_x select 0) select 2)+ ((_y select 2) select 1)* ((_x select 1) select 2)+ ((_y select 2) select 2)* ((_x select 2) select 2)]]; _a = [[((_z select 0) select 0) * ((_a select 0) select 0)+ ((_z select 0) select 1)* ((_a select 1) select 0)+ ((_z select 0) select 2)* ((_a select 2) select 0), Â Â Â ((_z select 0) select 0) * ((_a select 0) select 1)+ ((_z select 0) select 1)* ((_a select 1) select 1)+ ((_z select 0) select 2)* ((_a select 2) select 1), Â Â Â ((_z select 0) select 0) * ((_a select 0) select 2)+ ((_z select 0) select 1)* ((_a select 1) select 2)+ ((_z select 0) select 2)* ((_a select 2) select 2)], Â Â Â [((_z select 1) select 0) * ((_a select 0) select 0)+ ((_z select 1) select 1)* ((_a select 1) select 0)+ ((_z select 1) select 2)* ((_a select 2) select 0), Â Â Â ((_z select 1) select 0) * ((_a select 0) select 1)+ ((_z select 1) select 1)* ((_a select 1) select 1)+ ((_z select 1) select 2)* ((_a select 2) select 1), Â Â Â ((_z select 1) select 0) * ((_a select 0) select 2)+ ((_z select 1) select 1)* ((_a select 1) select 2)+ ((_z select 1) select 2)* ((_a select 2) select 2)], Â Â Â [((_z select 2) select 0) * ((_a select 0) select 0)+ ((_z select 2) select 1)* ((_a select 1) select 0)+ ((_z select 2) select 2)* ((_a select 2) select 0), Â Â Â ((_z select 2) select 0) * ((_a select 0) select 1)+ ((_z select 2) select 1)* ((_a select 1) select 1)+ ((_z select 2) select 2)* ((_a select 2) select 1), Â Â Â ((_z select 2) select 0) * ((_a select 0) select 2)+ ((_z select 2) select 1)* ((_a select 1) select 2)+ ((_z select 2) select 2)* ((_a select 2) select 2)]]; _dir = [((_a select 1) select 0) * 1 + ((_a select 2) select 0) * 0,((_a select 1) select 1) * 1 + ((_a select 2) select 1) * 0,((_a select 1) select 2) * 1 + ((_a select 2) select 2) * 0]; _up = [((_a select 1) select 0) * 0 + ((_a select 2) select 0) * 1,((_a select 1) select 1) * 0 + ((_a select 2) select 1) * 1,((_a select 1) select 2) * 0 + ((_a select 2) select 2) * 1]; (_this select 0) SetVectorDir _dir; (_this select 0) SetVectorUp _up; [_up,_dir] It's just a way of reducing the mount of typing in a function or script. He could have written it like it is above, only it would be harder to maintain and more prone to errors. So when he defines: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define M1(X,Y) ((_a select X) select Y) That just means you replace any occurrence of M1(1,0) With: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">((_a select 1) select 0) He's ok defining VY and VZ where he does, because it not evaluated until this line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dir = ROL; Then any occurrence of VY and VX in ROL are replaced with the values 1 and 0.
-
Cheers Simba, that makes it clear. I think I understand how reload is used now, it's an animation controller for weapons rather than vehicles. But it has to be defined in the Config of a vehicle, as an animation source? It actually drives the animation ammo_belt_rotation which was the one I was looking at in game. I didn't know you could reference animation sources that way. BTW The reload animation is a rotation anim, it starts at 1 and decreases by the number of rounds fired from the current magazine until it reaches 0. I got as far as this, trying to make it into a translation anim: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class myammo_belt_rotation     {     type="translationZ";     source="mybelt_rotation";     selection="test selection";     axis="axis";     memory=1;     sourceAddress="loop";     minValue=0;     maxValue=0.01;     offset0=10;     offset1=0;     }; You can see the selection moves a tiny amount every time a round is fired. But because there are 100 rounds in an MG mag and it reloads so quickly. You can hardly see the animation being played out. If you change it to a rotation anim, then the movement becomes obvious. maxValue is reached every time a round fires, with a hundred rounds per M2 mag, it worked out at 1/100=0.01. Perhaps not much use to you. But the ammo_belt_rotation selection can be used to return the amount of ammo left in a magazine. So that will come in handy. I've posted an example mission at the top of the thread, for anyone interested.
-
Well I must admit, I'm a little confused by your replies. I've already posted examples of the animations I'm using in Model.cfg. Look at the ninth post down, the post after Jezz. Well perhaps something constructive might come out of this. There does appear to be some missing animation sources amongst the Wiki, the Model.cfg provided by BI and user made addon configs? I could not find source="reload" in the model.cfg for vehicles from BI, neither could I find it in Wiki: Animation sources. But I did find this in the BI cfg. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Source="belt_rotation"; That's not on the wiki either. Perhaps it will work for your recoil animations?
-
In other words, he doesn't know the answer. That’s fine if someone doesn't know, but they should at least say so, or not reply in the first place? Honesty isn't that expensive. I still stand by my previous two posts, neither a value of 0 nor 0.00001 for animPeriod will speed up the animation. That’s been tested in game, it's not speculation.
-
Sorry, I did not explain myself very well. Initially I assumed animPeriod and some of the other settings defaulted to specific values, if you did not define them in your cfg file. It was those values I was interested in. I'm now begging to wonder if there used at all, at least for rotational animations. Linear animations are different, but I would have to dig out my old tests to double check. I did some more testing with different values for animPreiod. But rather than talk about turrets I will use the actual example I'm testing. I have a vehicle setup with this animation, so I can read the direction from the vehicles animation source: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class directionanim     {     type="rotationY";     source="direction";     selection="direction anim";     axis="axis";     animPeriod=0.0001;     minValue="rad -360";     maxValue="rad +360";     angle0="rad -360";     angle1="rad +360";     sourceAddress="loop";     initPhase=0;     }; I have another object setup with this animation, which is driven by the above animationphase. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class RotateY     {     type="rotationY";     source="user";     selection="yrotate";     axis="axis";     sourceAddress="loop";     animPeriod=0.0001;     minValue="rad -360";     maxValue="rad +360";     angle0="rad +360";     angle1="rad -360";     initPhase=0;     }; The script that coordinates both animations looks like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WaitUntil     {     _Object Animate ["RotateY",_Vehicle AnimationPhase "directionanim"];     False     }; The problem is, when I turn the vehicle, the object is animated correctly. Only it always lags behind the vehicle slightly. And takes about a second to finally catch up. So I tried changing animPeriod to 0, I tried removing it all together. I also tried it with a value of 2. In every case the object behaved the same way, regardless of what I set the animPeriod to. I do wonder if animPeriod is even used? I can also define the script like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WaitUntil     {     _Object Animate ["RotateY",Rad (GetDir _Vehicle)];     False     }; The same thing still happens. When I return to using the traditional OFP method: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WaitUntil     {     _Object SetDir (GetDir _Vehicle);     False     }; Then every thing works fine, no delay. In another quick test I changed the script to look like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WaitUntil     {     _Object SetDir (Deg (_Vehicle AnimationPhase "directionanim"));     False     }; That also works ok, no obvious delay when setting the direction. So all this leads me to believe that User animations have an inherent delay built into them. Or are my deductions still flawed? It would be handy if someone could double check this in game, rather than just make assumptions.
-
It's certainly a much welcome feature, add to that the ability to animate proxies now. But let's not overlook the mass of additional new scripting commands. For me at least, I think ExitWith has got to be the most used, from the current batch of new arrivals? Exactly, all these examples are based on inherited values. What would really be impressive is, showing us where in the games default config files, the base classes for animations and model,cfg are defined. Now that would actually be something to wink about for a change For me, it does not make sense. Unless BI have implemented a pre-defined delay for user animations. The worst I would expect, is a less than smooth animation. Remeber, my example calls a command to represent the current animation phase. So that should reflect the current state of the engine animation at that point in time? What it appears to actually represent, is the state of the animation phase, some time after. Think of it as a cushioning effect. Not that I can see, there is no animation source for firing available to all vehicle classes. The current animations assigned to weapons do not count on both accounts. First you can't reference a weapon directly, as an object pointer. Also the BI examples made public regarding animation sources and firing, seem explicitly to referrer to infantry weapons only. However the delays I'm concerned with, may only be obvious when your sharing animations across separate objects, that exists independently, using scripts. If for example you applied an animation to a gun selection using a function, from the vehicles fired event, there should be enough going on to distract the observer from any slight delay?
-
No worries, haven't seen a lot about Arma's new animation system on the forum. Which is a shame, as looks as though it could be very powerful. I do have to add more to the above example for gun elevation, but I need to figure out the VectorUp to degree maths before I can do that. Yeah, that’s about it. For example, if I setup a user defined anim called copyturret, that mimics the animation phase of the main turret. Then I run this script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">WaitUntil     {     _Tank Animate ["copyturret",_Tank AnimationPhase "mainturret"]     False     }; There is a small, but visible delay, between the main turret and the user animation I setup. Even though they have exactly the same settings in the config and model.cfg. It all centres around the AnimPeriod setting in model.cfg. Setting it to 0 does not result in an instant execution of the requested animation phase, in fact it's quite slow. I eventually used AnimPeriod=0.00001, to get the quickest reaction. Ok probably some of the extra zero's after the decimal place aren't needed, it's just to be on the safe side. Perhaps I need to run the script in a more aggressive while loop? Or accept the fact that user defined animations executed using scripts, will never be as fast as the games hard coded animations. P.S Has anyone experimented with overriding the animation sources? There is very little info about this on the wiki.
-
@NonWonderDog That code will come in handy. But what would be really handy is the code for returning the roll of the vehicle? In other words, the angle of rotation around the Z axis, in degrees. Cheers
-
Can't say for sure until I test it under those conditions. But I'm certainly going to try and push those commands to thier limit. I suspect it will be no worse than calling an equal amount of strings, of the same length, as public variables. The players on the server should take priority over someone JIP'ing. I hope BIS have made it so it takes the JIP a little longer to join, rather than lagging out all the current players. Don't get me wrong, I might have implied that this should replace publicvariable, but that wasn't my intention. For things like scores and resource or money counts, that are updated at regular intervals. I think publicvariable is ideal. But for the MP scripts I'm doing atm, I've managed to remove all those server side loops, that used to check for publicvariables being updated. It was a nightmare to do in OFP. I don't think ClearVehicleInit is bugged, as I can't see what else you would use it for, in it's current state? I think another command is needed. One that takes an index returned from SetVehicleInit, and allows you to remove that specific init event. A bit like RemoveAction or RemoveEventHandler. The actual time is taken from a client in game, and passed to the JIP script as an integer. JIP works the same way as starting a regular MP mission, in some respects. It will halt when it encounters the sleep command, until the second stage of joining the mission. So after the script progresses beyond the first sleep command, you know that all the calls to that script have been made, and you know the time of the very last call. I haven't tried it on a proper, remote, dedicated server yet. But the problem you mentioned can be fixed by moving the checks underneath the first call to sleep. You have to do this with objects that inherit from class Strategic anyway, because they always return Null when a player first JIP's. At least they do since the MP SetPos bug was fixed for Ammo crates e.t.c
-
I was to at first, but after using the command for a while, it turns out to be really handy. Imagine you have a truck that drives around deploying, say machine gun positions, using SetVehicleInit. Each of these machine gun position runs a script on all the clients once it's deployed. If that truck gets destroyed and eventually deleted as part of some cleanup script. You would still want each of the machine gun positions to be deployed and their scripts run, for anyone who JIPs. But it does complicate things. The opposite example would be a truck that drives around deploying a single command position, at various locations during a mission. If anyone JIPs, you would only want to deploy the command position at it's last location, ignoring any of the previous locations. In that case you could use the Time command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_StrInit=Format ["[This,%1] ExecVM ""DeployCom.sqs""",Time]; SetVehicleInit _StrInit; MYTRUCK ProcessInitCommands; In DeployCom.sqs you would have this check: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_StartTime=_This Select 1; If (IsNil "UNLOADTIME") Then     {     UNLOADTIME=_StartTime;     }     Else     {     If (_StartTime>UNLOADTIME) Then         {         UNLOADTIME=_StartTime;         };     }; Sleep 0.001; If (_StartTime<UNLOADTIME) ExitWith {}; UNLOADTIME=Nil; Looks that way, also if you then set the variable to nil, then publicvariable it again. It will still be broadcast to the JIP with it's original value. So far I've managed to almost avoid using PublicVariable. I had to use it once to coordinate the same script across client and server. Other than that, ProcessInitCommands has covered everything else.
-
As per my post on the wiki; clearVehicleInit, clears the pending init commands, not those already processed. Once the init commands are processed, they can not be removed. Even if the vehicle is killed or deleted. In this case, pending means waiting for a call by ProcessInitCommands. There is nothing wrong with the way this works in Arma. ProcessInitCommands and JIP on there own, do not cause desynch in MP. The scripts called during JIP can cause lag, so you have to be careful. I processed 30,000 simple JIP's commands as a test, the only noticeable difference was a delay of 3 to 4 seconds, before the mission started. But stacked init commands are something you have to take into account, it's inevitable during a mission that some of the init commands will become redundant. But you can avoid that with a few checks at the start of your JIP script. If you want to avoid calling scripts during JIP on units that have been deleted add this at the very start of your script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (IsNull (_This Select 0)) ExitWith {} If you want to avoid calling scripts during JIP on dead units as well: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (IsNull (_This Select 0)) ExitWith {} If !(Alive (_This Select 0)) ExitWith {} If you start calling scripts with ProcessInitCommands that aren't linked to objects, then things get a little more complicated. But there are plenty of ways of handling that.
-
I only use Autocenter=0 when I need to know the exact position of the pivot point, usually while setposing stuff in scripts. I think for anything else you should use Autocenter=1, if you can get away with it. ARMAs limit on the size of the geometry LOD, is another example of how you can screw up a large object, if it's off centre by to much.
-
I dunno, perhaps if you performed a little jig as well?...Surely it can't harm, if you make it energetic and put your heart into it! It may or may not work, but it’s one more thing to try?
-
In the options for BinPbo there is field called "List All Files To Copy Directly". *.rvmat is not included in the wildcards by default. Could that be the problem?