ofpfreak 0 Posted April 11, 2007 I've recently bought Armed Assault, as a big fan of Operation Flashpoint I had done tons of missions and scripting. In Armed Assault I'm wanting to do the same. Recently me and my friend were doing some stuffing around with the online mission editor and I gave the camel a small boost using a simple command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setvelocity [1000,0,50] Now this would boost the camel slightly upwards into the air at a large speed, but the problem is, it does that on the X angle (which is always east in this case). Because of this, I have revived an old nitrous script of mine from OFP, though I'm having some problems getting it to work again. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#accel _inc = 1 _amountleft = 0 camel1 setvelocity [(velocity camel1 select 0) + _inc*sin getdir camel1, (velocity camel1 select 1) + _inc*cos getdir camel1, velocity camel1 select 2] ~0.25 _amountleft > 40 : goto "exit" ? speed camel1 < 300 && alive camel1 : goto "accel" #exit exit Now, the problem here is somewhere with the last two lines before the #exit. It says something about the :'s. The error message says: Error type number, expected switch Now I can understand if Armed Assault had a few changes in the scripting code, but if so, can someone tell me what to put there instead? I'm guessing : was either replaced with a different command or a "switch" is now used whatever this may be. Share this post Link to post Share on other sites
nuxil 2 Posted April 11, 2007 your script looks wrong.. your can try something like this <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; _vel = velocity _vehicle; _dir = direction _vehicle; _speed = 300; while {(speed _vehicle < 300)} do { _vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2)]; }; now in the camles init feald you put. nil = [this] execvm "script.SQF" ; i havent tested it, but it should work.. as long as the speed is under 300 Km/t you should get a boost. offcource you must do some finetuing on it. Share this post Link to post Share on other sites
oktane 0 Posted July 13, 2007 Hello Gents This is exactly what I've been trying to to lately. I remember that old dirtbike from OFP with the turbo on it. And Karrilion had some nice scripts for nitrous using his PS input framework. I've looked at those oldies but... I've been trying to get it to work in Arma, but something is weird with how vehicle velocity is handled by the game engine. It would seem that there are two velocities, one that can be increased or decreased with the car engine, and another that can be set with the setVelocity command. I just want one velocity! If I make a car go 200kph for a few seconds, why doesn't its speed decay per the rules of the simulation. Instead it just stops flat. In other words, there doesn't seem to be a way to set the engine/trans speed of the car, just the velocity of the whole object, which the physics engine then sets back to 0 after you stop sending setVelocity commands. Does anyone think there can be a scripted workaround? I could 'simulate' the velocity decay in the script until the car was again going a reasonable speed but thats not making use of the physics engine. Plus the timing in that script may vary from computer to computer... Any advice would be awesome! OFP/ARMA Community Share this post Link to post Share on other sites
sakura_chan 9 Posted July 14, 2007 the problem with the last line is just syntax I think: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ? _amountleft >= 40 : goto "exit" ? speed camel1 <= 300 || alive camel1 : goto "accel" might help  ? Share this post Link to post Share on other sites