OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: tarrega on 16 Feb 2005, 16:16:41
-
please look at this scips below:
_HEAP=_this select 0
_HEAPpos=GetPos _HEAP
_HEAPposX=_HEAPpos select 0
_HEAPposY=_HEAPpos select 1
~0.1
_tempObj1 = "SHELL120" camCreate[_HEAPposX, _HEAPposY, 0]
~0.01
_tempObj1=objNull
it is said the scrips of anti-infantry landmine ,but it doesnt work in my testing missions. ??? how could i fix it?
-
I suspect you haven't initialized the script correctley. Read SnYpir's introduction to code snippets and I'll think you'll understand. ;)
:beat: *Gets Shot* :beat:
-
Use hints and hint format commands (check the online comref) to check the progress of variables in scripts. Very handy for debugging.
Also double check the syntax with the comref.
-
i added a trigger:
axisA 5, axisB 5, Activation: Weat;on Activation :[this]exec "HEAP.sqs"
and when the squad moved in,what was shown on the top of the screen was:
'_tempObj1 = "SHELL120" camCreate[_HEAPposX, _HEAPposY, 0]|#|';Error Type Any,expected Number
what does it mean?
-
The line of code quoted has an error in it. The # shows approximately where in the line of code the error occurred. The error message, "type any, expected number" means that the game was expecting a number, but you (in the line of code) gave it something else. The game therefore doesn't know what to do and spits out this error message.
Since all you are trying to do is create an explosion at the position of the trigger, you don't need a script. Try this
On activation: bang1 = "heat120" camCreat getPos this
-
Or just use this script:
_HEAP=_this select 0
~0.1
_tempObj1 = "SHELL120" camCreate getpos _HEAP
~0.01
_tempObj1=objNull
:beat: *Gets Shot* :beat: