Jump to content
Sign in to follow this  
SWIFT88

annoying problem

Recommended Posts

when i run an addon i get the error message pop up.....

"_gun setpos [_posx,_posy,_posz]|#|" Error Type Any, expected number "

Share this post


Link to post
Share on other sites

Looks like a scripting error - is it occurring with a particular addon?

Share this post


Link to post
Share on other sites

If it's a script you are working on then here's the correct ways to script it.

There are a few options, depends on what u need to do.

But here are a few scripting rules and methods.

The getpos command returns an array [x,z,y]

The setpos command sends and array [x,z,y]

These commands can be run as a whole, or split into single co-ords:

x coordinates is east-west

getpos _object select 0 is always it's x co-ord

z is south-north

getpos _object select 1 is always it's z co-ord

y is height above ground

getpos _object select 2 is always it's y co-ord

This will increase the guns height above ground level by 10

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_gun = _this select 0

_posx = getpos _gun Select 0 //returns number value for east-west

_posz = getpos _gun Select 1 //returns number value for south-north

_posy = getpos _gun Select 2 //returns number value for height above ground

_gun setpos [_posx,_posz,(_posy)+10]

This will also increase the guns height above ground level by 10

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_gun = _this select 0

_gun setpos [getpos _gun select 0, getpos _gun select 1, (getpos _gun select 2) +10]

This will simply place the gun wherever u want it

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_gun = _this select 0

_gun setpos [2500, 2500, 100]

That's the scripting for positioning of an object, but if it's just an error you're getting then it must be an addon or script you are using in your mission that has the script error...my hunch, it's something with a gun ;)

Share this post


Link to post
Share on other sites

maybe if SWIFT88, you could post the script someone could pinpoint the problem.

or

if it is not your addon then maybe you are missing an addon that the script calls the position of.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×