Home   Help Search Login Register  

Author Topic: Moving AI, with GL  (Read 614 times)

0 Members and 1 Guest are viewing this topic.

sweofp

  • Guest
Moving AI, with GL
« on: 23 Jun 2005, 01:17:55 »
Hello!
IÂ've got this very simple code that IÂ'm using to get my AI enemies to move a little random. My prob is that when i exec (lets say _movethere) in a trigger the teleported troops beams down at _here gamelogic for just a split second and then comes to the right place? Is there a way to avoid this?
Code: [Select]
#_moveon = _here
#_movethere = _There
#_movewhere = _Where

#_here
"_x setpos (getpos Here)" foreach units BOB
~2
BOB move getpos village1

#_There
"_x setpos (getpos There)" foreach units BOB

#_Where
"_x setpos (getpos Where)" foreach units BOB

Exit

qqqqqq

  • Guest
Re:Moving AI, with GL
« Reply #1 on: 23 Jun 2005, 02:37:34 »
You need an exit at the end of each section.

sweofp

  • Guest
Re:Moving AI, with GL
« Reply #2 on: 23 Jun 2005, 11:31:39 »
Hmm when I put an Exit after each section the positioned squad just get to the first GL point (_here) in the list.

qqqqqq

  • Guest
Re:Moving AI, with GL
« Reply #3 on: 23 Jun 2005, 15:02:13 »
I assumed that was not the whole script.   You must tell the script where to go.

? _inputstring == "whatever" : goto #_here

sweofp

  • Guest
Re:Moving AI, with GL
« Reply #4 on: 23 Jun 2005, 18:09:13 »
Ah IÂ'm sry I wasnÂ't clear enough. Well itÂ's the whole script so far.
Could you plz explain how to initialize it because IÂ'm doing somethin wrong? Cant get it to start right.
East detected by west
The triggername: _here
Condition: this
Activation: [] exec "vill1.sqs"
So I got 3 diff triggers with three diff namnes.

Tanx for the help so far.

:)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Moving AI, with GL
« Reply #5 on: 23 Jun 2005, 18:23:24 »
You want the troops to be teleported to some position and then what?
Wait a sec and teleport again?

Because that what your script does now ;).

Quote
#_here
"_x setpos (getpos Here)" foreach units BOB
~2
BOB move getpos village1
This part teleports units to the place Here, waits two secs and then there's a faulty use of the move command...

the move is used on single soldiers, or on groups (a single soldier is group infact), so the move command should be issued like this:
Code: [Select]
"_x move (getpos village1)" forEach BOB
then after issuing that order the script jumps here, immediately:
Quote
#_There
"_x setpos (getpos There)" foreach units BOB
and then in a blink of an eye here:
Quote
#_Where
"_x setpos (getpos Where)" foreach units BOB

And, what this is supposed to do exactly?:
Quote
#_moveon = _here
#_movethere = _There
#_movewhere = _Where


I'm a bit lost what you are trying to achieve... :(

If you're trying to get the enemies to approach that village1 from randomish direction then you will need something with which you determine the random thing that makes the script jump into one of those setPos sections (and after that exit)...
Something like:

Code: [Select]
_r=random 100
? _r < 30: goto "here"
? _r > 30 && _r < 60: goto "there"
? _ri > 60: goto "mars"

#here
"_x setpos (getpos Here)" foreach units BOB
~2
"_x move (getpos village1)" forEach units BOB
exit

#there
"_x setpos (getpos There)" foreach units BOB
~2
"_x move (getpos village1)" forEach units BOB
exit

#mars
"_x setpos (getpos Where)" foreach units BOB
~2
"_x move (getpos village1)" forEach units BOB
exit

You execute that like you do now, BUT remember:
BOB needs to be a group, in that group in some soldiers init field you write BOB=group this
Then, those GLs (=Game Logics) you use must be named as Here, There, Where and village1...

In theory this should work...
But I'm not giving any promises ::)
Prolly screwed something up like usually :P

There's no need to name the triggers unless you use the triggers themselves in the script...

East Detected by West means that the trigger is 'triggered' when in that trigger area a East unit is detected by a West unit. If that happens then the script will be executed...
« Last Edit: 23 Jun 2005, 18:23:52 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

sweofp

  • Guest
Re:Moving AI, with GL
« Reply #6 on: 23 Jun 2005, 21:10:42 »
Ok.
What I want is the same group to be teleported to the GL, this way I can get  the same group to spawn werever the Player choose to go, and the player can choose to take wich way he want to the targets. This way I dont need to use so many enemy AI groups either I can the same group to man say lke three different firepos.
And in one case I want the Ai group to move to a GL namned Village1 from the Gl namned Here.
Hope this clear things up..
 :D
Then I can make several groups, execute the appropriate script and have the player meet some enemies, of course
some randomness wouldnÂ't be bad either this making it even harder and make the mission more replayable.

Aight tested it it works nice!! Tanx! Now if I want the same but without the randomness?

Edit; second tought!
« Last Edit: 23 Jun 2005, 21:19:56 by sweofp »