Home   Help Search Login Register  

Author Topic: Finding the intruders  (Read 2223 times)

0 Members and 1 Guest are viewing this topic.

funkster

  • Guest
Re:Finding the intruders
« Reply #15 on: 16 Aug 2005, 09:15:35 »
Great, thanks again.

(So much simpler, I didnt know they automatically changed back to SAFE!   ::)  )

Your a staff member now! When did this happen? Today? Congrats!

...Off to the labs for me, see what I can cook up...

funkster

  • Guest
Re:Finding the intruders
« Reply #16 on: 17 Aug 2005, 12:44:09 »
Ok, done some testing /changing. Found out I was doing all kinds of things wrong.

Wdefenders, Wreserve, Edefenders etc are all arrays of groups I have created. They are all defined in a script "definitions.sqs" which is called by a 'true' trigger at the start like so

Code: [Select]
;define the defending, advanced, and reserve groups:

Wdefenders = [Wdefender1, Wdefender2, Wdefender3, Wdefender4, WSU1]
Edefenders = [Edefender1, Edefender2, Edefender3, Edefender4, Edefender5, Edefender6, ESU1]

Wreserve = [Wreserve1, Wreserve2, Wreserve3, Wreserve4, Wreserve5]
Ereserve = [Ereserve1, Ereserve2, Ereserve3, Ereserve4, Ereserve5]

Wadvanced = [Wadvanced1, Wadvanced2, Wadvanced3, Wadvanced4]
Eadvanced = [Eadvanced1, Eadvanced2, Eadvanced3, Eadvanced4]

Wall = [Wdefender1, Wdefender2, Wdefender3, Wdefender4, WSU1, Wreserve1, Wreserve2, Wreserve3, Wreserve4, Wreserve5, Wadvanced1, Wadvanced2, Wadvanced3, Wadvanced4]
Eall = [Edefender1, Edefender2, Edefender3, Edefender4, Edefender5, Edefender6, ESU1, Ereserve1, Ereserve2, Ereserve3, Ereserve4, Ereserve5, Eadvanced1, Eadvanced2, Eadvanced3, Eadvanced4]

Ok, so far, so good.

Because they are arrays, I changed my other scripts to look like this (eYellow - yellow alert, causes appropriate units to go to where enemy has been seen intruding);

Code: [Select]
; First, checks to see if the red triggers have been set off, exits
; if they have. Otherwise
; eYellow.sqs - this will detect who set the trigger off, and send the response
; group their position by setting a waypoint at the position. (hopefully)

if ealertr then {exit}

_unit = _this select 0
_pos = getPos _unit

[move _pos] forEach Edefenders
[setSpeedMode "FULL"] forEach Edefenders

[move _pos] forEach Ereserve
[setSpeedMode "FULL"] forEach Ereserve

now, when called in the game, i get an error:

"[setSpeedMode "FULL"] forEach Edefenders" error, unknown operator...


Im lost, any ideas anyone?

Thanks.
« Last Edit: 18 Aug 2005, 04:00:20 by funkster »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Finding the intruders
« Reply #17 on: 17 Aug 2005, 13:51:42 »
Instead of

Code: [Select]
[setSpeedMode "FULL"] forEach Ereserve
try:

Code: [Select]
{_x setSpeedMode "FULL"} forEach Ereserve
Also instead of:

Code: [Select]
[move _pos] forEach Ereserve
Use:

{_x move _pos} forEach Ereserve
« Last Edit: 17 Aug 2005, 13:52:52 by THobson »

funkster

  • Guest
Re:Finding the intruders
« Reply #18 on: 17 Aug 2005, 22:54:07 »
Great, thanks heaps.Ill go and check if it works.

(I think this thread could keep going on and on and on and on....)

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Finding the intruders
« Reply #19 on: 17 Aug 2005, 23:27:54 »
Better to solve it when the first few ideas are done, then start a new one when you have a new question
« Last Edit: 18 Aug 2005, 10:05:38 by THobson »

funkster

  • Guest
Re:Finding the intruders
« Reply #20 on: 18 Aug 2005, 00:34:18 »
Oh, ok. I thought I was being polite by not hogging too many threads, but ok, if I have a new prob after this Ill post new thread.... :)

Ok, I have im implemented your suggestions, thanx, they seem fine.

However, there is a major problem, I thought the scripts were working,  because tanks racing around and battling. But, they are not! I think it was just those set on guard were going around by themselves.

I have tested the triggers I have for certain conditions, eg "red alert" - enemy detected right near the base, "yellow alert" - enemy detected in or territory, and the triggers work (i created messages in the on activation field). So the trigger side of things is fine.

However, the scripts that they call, are now no longer displaying error messages, but when I test under controlled conditions, they are not doing anything! Not one unit on the map goes back to base when red alert, or to where an enemy is spotted when in yellow alert! Why? I have no idea.
I wont post all the scrpit up again, as its up above here, I dont know why they wont move.

They are all groups, they are being ordered to a location with the MOVE command as u know, some are set to a GUARD waypoint, all armour is set to SAFE.

Any help pls....??

Thanks.
« Last Edit: 18 Aug 2005, 03:59:13 by funkster »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Finding the intruders
« Reply #21 on: 18 Aug 2005, 10:08:47 »
Well they should respond to a move command, but sometimes things are strange.  Try using doMove instead of move.  Other things to try are:
- move their waypoints
- use a switch trigger to send them to a new waypoint.

This is all part of the 'cooking' you need to do to make a mission sometimes.

funkster

  • Guest
Re:Finding the intruders
« Reply #22 on: 18 Aug 2005, 13:09:00 »
Ok, cheers, thats interesting. So sometimes it works,sometimes it doesnt huh? :-\ , interesting....

Ill be back no doubt, lol...

funkster

  • Guest
Re:Finding the intruders
« Reply #23 on: 31 Aug 2005, 09:57:27 »
Ok ok ok, things were not working, so i have given up on this mission, I think the rotteness goes to its core, so Im working on something much more interesting now which has given me more scripting experience and allowed me to see where I was making most of my mistakes anyway  8)

So, although this is not solved, I will mark it as solved, so it doesnt float away lost into the void...