Home   Help Search Login Register  

Author Topic: Officer (AI) Giving Orders?  (Read 1930 times)

0 Members and 1 Guest are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Officer (AI) Giving Orders?
« on: 09 Sep 2005, 06:16:54 »

I'm creating a single player mission. I have lots of steps i need to take in order to get there. I'm going to be posting on here a lot, so lets get ready.. ;D.

=========
PROBLEM
=========
The problem is, at the beginning of my mission, I have a small 5 man squad group information grouped together. What I want to be able to do is, have the officer order each unit to any desired position that I want, that is fairly close to the officer or however far I want it, becuase it's going to be at  an HQ base and I need the officer to position his soldiers including ordering the player to a specific spot.

========
QUESTION
========
How do I go about doing this? Please give step by step answers. Thank you..
Who's hyped for Arma4, long live Arma!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Officer (AI) Giving Orders?
« Reply #1 on: 09 Sep 2005, 10:09:02 »
When you say "I", do you mean "I" the player or "I" the mission designer?

If its the mission designer, do you want the places to be the same each time the mission is player, or different?
« Last Edit: 09 Sep 2005, 10:09:51 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:Officer (AI) Giving Orders?
« Reply #2 on: 09 Sep 2005, 12:59:26 »
Do you mean like that the officer can give commands to the soldiers without having to to be squad leader? Or just as squad leader give each soldier individual commands?
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Kyle Sarnik

  • Guest
Re:Officer (AI) Giving Orders?
« Reply #3 on: 09 Sep 2005, 23:22:51 »
I think I understand him, lemme take a try at this one  ;) .

Ok, place a game logic (side=game logic, class=objects) at the first one of your positions. In the name box, type Pos1 just to indicate its position #1. You can place more of these and name them sequencialy (Pos2, Pos3, etc..) wherever you want to set another possible position to move to. Now, if you've got either A.) a name for the officer or B.) a name for the group, you can use the following commands to order the soldiers, and the player, around.

A.) using the officer's name
Code: [Select]
((units group Officer1) select 1) commandmove (getpos Pos1)
B.) using the group name
Code: [Select]
((units Group1) select 1) commandmove (getpos Pos1)
Its simple really, now you just have to change the number after "select" to either 1, 2, 3, or 4 (1 = unit #2 in the group, 2 = unit #3, 3 = _unit #4, etc..)
and Pos1 to any of the positions you placed (Pos1, Pos2, Pos3, etc..). If you want to intentionaly order the player to move, try this:

Code: [Select]
player commandmove (getpos Pos1)
If cadet mode is on, a waypoint will be placed at the position of Pos1, telling the player to move there. However if veteren mode is on, I don't know if a waypoint or any type of marker will be placed there, in which case you probably want to use a marker on the map. Create one and name it something like PlayerWP or whatever. Then use this to move it around:

Code: [Select]
"PlayerWP" setmarkerpos (getpos Pos1)
And the marker will be placed where Pos1 is. Hope that answers your question (I really do, because that was a lot of typing  :P)

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Officer (AI) Giving Orders?
« Reply #4 on: 10 Sep 2005, 11:54:14 »
Okay, I'll get to all your questions/answers....

@MacGuba~
Quote
When you say "I", do you mean "I" the player or "I" the mission designer?
What I mean is I the mission designer.

@OFP Freak~
 yes have the squad leader give each soldiers individual commands. Like I want all the soldiers to be in one group, then at the beginning, having the officer order each soldier to any desired position that I want too and stay there until they are ordered to do something else..

@Kyle Sarnik~
Okay, your idea was good, but did not work the way you or I probably intented too. The code sample I used is this

Code: [Select]
player commandmove (getpos Pos1)
Now with that, i replaced the "Player" and put a units name there, such as R1. So it reads this code..

Code: [Select]
R1 commandmove (Getpos Pos1)
now that doesnt work, because right when the mission starts the soldiers are all obvouisly grouped together in one squad information. Then the soldier tries to move to that position, he moves there, and says "2 ready" and then falls back into formation. So that is my issue. The Soldiers fall back into position when I use the game logic and that command code you gave me. So anymore help, thank you guys for all your typing, hopefully it will gain you more typing skills, I know it does to me... ;D
« Last Edit: 10 Sep 2005, 11:55:53 by NightJay0044 »
Who's hyped for Arma4, long live Arma!

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Officer (AI) Giving Orders?
« Reply #5 on: 10 Sep 2005, 12:09:41 »
sounds like you need to incorporate the unitready command. that way you can wait until the units are in position, then issue a dostop command.

if you have a bunch of loons, and want to send them all off at once rather than one at a time, waiting for each loon to get into position before the next sets off, you need something like this -

Code: [Select]
loon_1 commandmove (getpos pos1)
loon_2 commandmove (getpos pos2)
loon_3 commandmove (getpos pos3)
loon_4 commandmove (getpos pos4)
etc...

#readyloop

?unitready loon_1 : dostop loon_1
?unitready loon_2 : dostop loon_2
?unitready loon_3 : dostop loon_3
?unitready loon_4 : dostop loon_4

~1
?not ((unitready loon_1) and (unitready loon_2) and (unitready loon_3) and (unitready loon_4)) : goto "readyloop"

player sidechat "All units in position, Sir!"

exit

what that does is:

  • issues the move commands
  • finds out if any of the loons is ready, and if so, stops him
  • loops until all units are ready
  • lets the player know when all units are ready

untested, but i suspect it works ;)

Kyle Sarnik

  • Guest
Re:Officer (AI) Giving Orders?
« Reply #6 on: 10 Sep 2005, 14:46:00 »
sounds like you need to incorporate the unitready command. that way you can wait until the units are in position, then issue a dostop command.

if you have a bunch of loons, and want to send them all off at once rather than one at a time, waiting for each loon to get into position before the next sets off, you need something like this -

Code: [Select]
loon_1 commandmove (getpos pos1)
loon_2 commandmove (getpos pos2)
loon_3 commandmove (getpos pos3)
loon_4 commandmove (getpos pos4)
etc...

#readyloop

?unitready loon_1 : dostop loon_1
?unitready loon_2 : dostop loon_2
?unitready loon_3 : dostop loon_3
?unitready loon_4 : dostop loon_4

~1
?not ((unitready loon_1) and (unitready loon_2) and (unitready loon_3) and (unitready loon_4)) : goto "readyloop"

player sidechat "All units in position, Sir!"

exit

what that does is:

  • issues the move commands
  • finds out if any of the loons is ready, and if so, stops him
  • loops until all units are ready
  • lets the player know when all units are ready

untested, but i suspect it works ;)

Yes dostop will work just like domove works, but I used commandmove so that the officer would give a radio message of where t move, and so I would also use commandstop so he would radio the AI/player to halt, unless you don't want the officer to order them to halt and simply have the AI stop on their own when they get there.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Officer (AI) Giving Orders?
« Reply #7 on: 10 Sep 2005, 18:49:56 »
@TO YOU SCRIPTERS~

Hi, although I would love to use your script, if I knew how to properly execute it. Please give me the execute commands to type in the game logics or the individual units.

@Kyle Sarnik

You know your code:
Code: [Select]
R1 Command Move (getpos pos1)
That script, when the mission starts, the officer does not say "2 Move to BlaBlaBla." The soldier would just move there and then go back to formation.
Who's hyped for Arma4, long live Arma!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Officer (AI) Giving Orders?
« Reply #8 on: 10 Sep 2005, 19:11:54 »
Should that not be:

R1 CommandMove (getpos pos1)


Possibly you need CommandStop to make him stay once he gets where he is going.

CommandStop R1



Planck
« Last Edit: 10 Sep 2005, 19:33:20 by Planck »
I know a little about a lot, and a lot about a little.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Officer (AI) Giving Orders?
« Reply #9 on: 10 Sep 2005, 19:32:14 »
Sorry guys, it's stil not working, cant you use makers, or how can I make them move to the desired spot, still un-solved.

 :gunman:
 
:hmm:
« Last Edit: 10 Sep 2005, 19:37:22 by NightJay0044 »
Who's hyped for Arma4, long live Arma!

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Officer (AI) Giving Orders?
« Reply #10 on: 10 Sep 2005, 19:39:02 »
Sorry guys, it's still not working. Below is my zip file for you to check out if you wish too see where my problem is located. Also I've marked on the map with a marker indicating where a desired spot is for the unit to move, it's very close to units.

Thanks everyone.
Who's hyped for Arma4, long live Arma!

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Officer (AI) Giving Orders?
« Reply #11 on: 11 Sep 2005, 06:15:01 »
Still need help overhere, I need to be able to get the officer of the sqaud to order his troops to any desired position on the map, whether if it's far away or really close. I want them to be all apart of the squad, all 6 of them, but i dont want them to stay in formation, and the "none" information deal doesn't work in the special category in the mission editor. Thanks everyone..
Who's hyped for Arma4, long live Arma!

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:Officer (AI) Giving Orders?
« Reply #12 on: 11 Sep 2005, 06:20:59 »
Yeah I figured it out, all on my own..

 :cheers:

 :thumbsup:

Alright what you do is. To get the officer to make a unit stay at a desired position, with out using really any scripting at all, just an easy way is this.....

-Place all the soldiers where you want that are apart of the sqaud including officer and player. everyone.

-Put this in there initialization field:

Code: [Select]
commandstop R1
Same goes for the rest of the them, obviously there name will change. Alright, now I can move on....

 ;D
Who's hyped for Arma4, long live Arma!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Officer (AI) Giving Orders?
« Reply #13 on: 11 Sep 2005, 10:57:05 »
NightJay0044, as a general rule its better not to make consecutive posts is the same thread - it can make the thread more confusing to read.    Please use the button to edit your existing post.     ;)

Anyway, glad you fixed the problem.  
« Last Edit: 11 Sep 2005, 11:05:23 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re:85% (AI) Soldiers Dead?
« Reply #14 on: 11 Sep 2005, 16:08:22 »
all right, thanks guys, got that issue taken care of. Now onto my second issue... ;D..

You know how I have all the Resistance soldiers in a certain spot right where I want them? Well now with all the enemies I have they just move from their positions when I even put the commandstop code in. This is what I have in one of their init fields.

Code: [Select]
commandstop R3; this setunitpos "UP"; this switchmove "crouch"; FIRST=true ; this dowatch G1; this allowfleeing 0
This code here:
Code: [Select]
this dowatch G1
That makes each of the soldiers watch a gamelogic in the direction the attack is coming from so they arent looking behind them when the attack is really coming from the front.

My question is, how do I make them stay at their current position, until they are ordered to move?
Who's hyped for Arma4, long live Arma!