Forum Jump :

Author Message


Posts: 138
Rank:


Level: Member

Country: de
Location:
Occupation:
Age: 43
In-game name:

 
#1 Posted at 2010-06-15 14:40        
     
Well, after clearing one problem here we are with the next.

I tried Mr-Murrays artillery example for the enemy from the eitor guide, means, the artillery is activatied by a trigger if BLUFOR is detected inside by the enemy.

so far so good BUT than i got this error message ...

_Y = |#|getpos _Z select 1;
error getpos, type array, awaiting object

and this error ...


_K doWatch [_X,_Y,5000];

and here are the scripts ...

this sqs is activated by the trigger ...

_Ziel = _this select 0;
;Feuer
{[_x,_Ziel] exec "scripts\efire.sqs"} foreach [E1,E2,E3,E4,E5,E6]
exit;



this one is the efire.sqs

_K = _this select 0;
_Z = _this select 1;
_X = getPos _Z select 0;
_Y = getPos _Z select 1;
_K doWatch [_X,_Y,5000];
_A =_K Ammo "D30";
~5
_K fire "D30";
@ _A > _K Ammo "D30";
~3
_N = nearestObject [_K,"HeatD30"];
_X = _X+((random 80)-40);
_Y = _Y+((random 80)-40);
_H = "HeliHEmpty" createVehicle [_X,_Y] ;
_H say "Ari";
~1
_N setPos [_X,_Y,0];
"SH_125_HE" createVehicle [_X,_Y,0];
deleteVehicle _H;
exit;

maybe somebody knows how to fix it ... come on scripting gods

thx in advance


Author Message


Posts: 20630
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 43
In-game name: Foxhound

 
#2 Posted at 2010-06-15 15:56        
     
How do you activate the trigger, whats the condition and whats the exact syntax you start the script with.
I guess it simply can not find the unit activating the trigger (there is no "ziel")

Visit my family webshop desteigerhoutshop.nl.

Advertisement


Author Message


Posts: 138
Rank:


Level: Member

Country: de
Location:
Occupation:
Age: 43
In-game name:

 
#3 Posted at 2010-06-15 16:28        
     
Okay,

i made a trigger on my map,
* activation ... west
* multiple times
* recoverd by east
* size 2000 x 500
* on activation i wrote in ... [thislist] exec “scripts\eari.sqs"

I placed three hidden enemy units as spotter in the area ... the trigger is working but then i got this errors and the artillery is not fireing :-(


Author Message


Posts: 1057
Rank:


Level: Member

Country: en
Location: 15 Bajo Valor Road, Everon, Sahrani.
Occupation: Air Training Corps, Airsoft + College.
Age: 26
In-game name: grimfist

 
#4 Posted at 2010-06-15 17:44        
     
Search for Mr-Murrays Artillery example,
he released a mission with it all in, so you could have a look at that?


Author Message


Posts: 20630
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 43
In-game name: Foxhound

 
#5 Posted at 2010-06-15 18:02        
     
_BARNS_ : * on activation i wrote in ... [thislist] exec “scripts\eari.sqs"

"thislist" creates an array. Meaning you are refering to an array with the _Ziel local variable. Thats also exactly what the error says, it expects an object (only an object can return a position) but your trying to get the position of the whole array.
So, you can do 2 things (probably more but my scripting knowledge is like 4 years old and not updated since), run the script for all units within the array.
Change "thislist" to "thislist select 0". That will select the first unit activating the trigger. But it will of course limit the enemy artillery on that units particular position, not the others.
Unless you change the script so it gets the group the unit is part of.


Please note the above is my rusty scripting knowledge. I am sure I said something wrong but at least it could give you some info to go with.

Visit my family webshop desteigerhoutshop.nl.

Author Message


Posts: 138
Rank:


Level: Member

Country: de
Location:
Occupation:
Age: 43
In-game name:

 
#6 Posted at 2010-06-15 18:52        
     
Grimfist : Search for Mr-Murrays Artillery example,
he released a mission with it all in, so you could have a look at that?

I know that mission, BUT it is an artillery mission for a player not activated by the ai!

@Foxhound

thx alot i am going to try this out, hope it works!


Author Message


Posts: 1057
Rank:


Level: Member

Country: en
Location: 15 Bajo Valor Road, Everon, Sahrani.
Occupation: Air Training Corps, Airsoft + College.
Age: 26
In-game name: grimfist

 
#7 Posted at 2010-06-15 18:54        
     
I have one, where you can call artillery, but when a enemy man spots a blue-for, they call artillery.


Author Message


Posts: 138
Rank:


Level: Member

Country: de
Location:
Occupation:
Age: 43
In-game name:

 
#8 Posted at 2010-06-16 16:18        
     
Awesome m8,

thats what i am looking for, plz post it here!


Author Message


Posts: 138
Rank:


Level: Member

Country: de
Location:
Occupation:
Age: 43
In-game name:

 
#9 Posted at 2010-06-16 19:05        
     
Problem solved ...

i changed this code line ... hint by Seba!

_X = getPos _Z select 0;
_Y = getPos _Z select 1;

to

_X = (getPos _Z) select 0;
_Y = (getPos _Z) select 1;

and

in on activation i wrote in ... [thislist select 0] exec “scripts\eari.sqs" hint by Foxhound!

thx alot m8s! :D