Home   Help Search Login Register  

Author Topic: problem  (Read 3970 times)

0 Members and 1 Guest are viewing this topic.

Offline astaroth

  • Members
  • *
problem
« on: 19 Feb 2009, 10:09:12 »
J' have a problem with init in config.cpp

init="[(_this select 0)] exec ""\BMW M5 (e60)\accel.sqs|#|; default value most be 0

don't work in mission editor and see this info

Fuck

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: problem
« Reply #1 on: 19 Feb 2009, 15:22:03 »
Not sure exactly what the problem is, because more info is needed to clarify the issue.

Having said that I can say the example you posted that doesn't seem to be complete.

Should maybe be:

init="[(_this select 0)] exec ""\BMW M5 (e60)\accel.sqs""";


Planck
I know a little about a lot, and a lot about a little.

Offline astaroth

  • Members
  • *
Re: problem
« Reply #2 on: 20 Feb 2009, 16:33:09 »
do you see any Bug's or errors in this line

_amount>20 |#|: goto "exit" Error operator unknown


#accel
_inc = 1
_amount = 0
_car setvelocity [(velocity _car select 0) + _inc*cos getdir _car, (velocity _car select 1) + _inc*sin getdir _car, velocity _car select 2]
_amount=_amount+1
_amount>20 : goto "exit"
? speed _car < 330 && alive _car : goto "accel"

#exit

Walter_E_Kurtz

  • Guest
Re: problem
« Reply #3 on: 20 Feb 2009, 17:19:40 »
?


Literally. The line is If _amount is greater than 20 then goto "exit"

Offline astaroth

  • Members
  • *
Re: problem
« Reply #4 on: 22 Feb 2009, 19:13:42 »
if _amount > 40|#| : goto "exit" type needs to be logical


Can you explain what's going on with these types of ?

Walter_E_Kurtz

  • Guest
Re: problem
« Reply #5 on: 23 Feb 2009, 04:24:56 »
I don't know about "types of" - if something doesn't work, I try something else without worrying too much about why.


Be consistent in your syntax.

Either:
? _amount > 40: goto "exit"

Or:
if (_amount > 40) then goto "exit"   <- use brackets around the condtion


and, if you want to get more advanced:
if (condition) then {outcome} else {alternative}

Offline astaroth

  • Members
  • *
Re: problem
« Reply #6 on: 23 Feb 2009, 16:48:26 »
ok thanks
how to make a script that ON  with the engine

Walter_E_Kurtz

  • Guest
Re: problem
« Reply #7 on: 24 Feb 2009, 02:51:57 »
Use the isEngineOn command.

First give the vehicle a name, for instance OneCarefulOwner, then

Method 1 - Trigger

Place a trigger, dimensions 0 x 0, activated Once and make the condition
Code: [Select]
isEngineOn OneCarefulOwner and launch your script in the On Activation line.


Method 2 - Waiting script

Alternatively, if the script is already running and you are just waiting for the engine to start, use the line
Code: [Select]
@isEngineOn OneCarefulOwner and the script will continue.

Offline astaroth

  • Members
  • *
Re: problem
« Reply #8 on: 25 Feb 2009, 14:04:04 »
the script does not run these 2 methods do not help
see if the code for errors

Code: [Select]
#accel
_inc = 1
_amountleft = 0
vechicle setvelocity [(velocity vechicle select 0) + _inc*sin getdir vechicle, (velocity vechicle select 1) + _inc*cos getdir vechicle, velocity vechicle select 2]
~1
if (_amount > 500) then { goto "exit" }
? speed vechicle < 330 && alive vechicle : goto "accel"

@isEngineOn OneCarefulOwner

#exit

« Last Edit: 25 Feb 2009, 14:09:07 by astaroth »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: problem
« Reply #9 on: 25 Feb 2009, 18:26:17 »
The command 'vehicle' has the wrong spelling and possibly the syntax for it is not correct.

Syntax is 'vehicle unit', and returns the vehicle, if any, that the unit is in.
The unit itself is returned if it is not in a vehicle.


Planck
I know a little about a lot, and a lot about a little.

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: problem
« Reply #10 on: 25 Feb 2009, 22:22:33 »
Hmm, I think vechicle (formerly _car) isn't used as a command but as a global variable.

Talking about variables: _amount isn't assigned a value, _inc is of no real use, _amountleft isn't used at all and I can only guess how OneCarefulOwner made it into the script. :)

Astaroth, can you describe what the script should do?
try { return true; } finally { return false; }

Offline astaroth

  • Members
  • *
Re: problem
« Reply #11 on: 26 Feb 2009, 15:53:08 »
the script is designed to expand to 330 vehicles per hour with 550Nm torque

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: problem
« Reply #12 on: 27 Feb 2009, 07:53:38 »
Try this. With the current settings (_f = 1.2) ArmA's hatchback will end the quarter mile in ~9.4s at a speed of ~230km/h... :D

Code: [Select]
; boost.sqs

_car = _this select 0
_u = vectorUp _car
_maxSpeed = 330

; You might have to change this value depending on the type of car you use
_f = 1.2

@isEngineOn _car
#accelerate

_height = (getPos _car) select 2

? not alive _car          : goto "end"
? speed _car >= _maxSpeed : goto "end"
? _height > 1             : goto "end"

_v = velocity _car
_vx = (_v select 0) * _f
_vz = (_v select 1) * _f
_vy = (_v select 2) * _f

_car setVelocity [_vx, _vz, _vy]
_car setVectorUp _u

~0.01
goto "accelerate"


#end
exit
try { return true; } finally { return false; }

Offline astaroth

  • Members
  • *
Re: problem
« Reply #13 on: 27 Feb 2009, 08:44:19 »
but the script runs for a short time anyway thanks :)

Offline astaroth

  • Members
  • *
Re: problem
« Reply #14 on: 05 Mar 2009, 19:03:14 »
know of any scripts on the repetition time
I am so thoroughly

_car setVelocity [_vx, _vz, _vy]
_car setVectorUp _u

~0.25