Home   Help Search Login Register  

Author Topic: Manhunt not working (perhaps she likes me..?)  (Read 1483 times)

0 Members and 1 Guest are viewing this topic.

Corben Dallas

  • Guest
Manhunt not working (perhaps she likes me..?)
« on: 11 Jun 2005, 11:27:29 »
I've got a unit called Natasha who guards a Major. Using a trigger to try and get her to spot me when I shoot the Major, I call a script from OFPEC.

The trigger is;

  Activated by: West
  OnActivate: Natasha exec "huntme.sqs"
  Conditional: not alive TheMajor

The script is:

_huntUnit = this select 0
#loop
_huntUnit DoMove GetPos player
~10
?(Alive _huntUnit):goto loop
exit

Doesn't work  ???

I tried _this instead of this, but no go. When I shoot TheMajor she just runs in the opposite direction, all hot to trot. Stumped. :-[
« Last Edit: 11 Jun 2005, 11:28:42 by Corben Dallas »

Offline 456820

  • Contributing Member
  • **
Re:Manhunt not working (perhaps she likes me..?)
« Reply #1 on: 11 Jun 2005, 11:36:25 »
your very close and will probaly beet your self up because i think the problem is
[Natasha] exec "huntme.sqs"
your missing the brackets have a go then and if it doesnt work it must be the actual script

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Manhunt not working (perhaps she likes me..?)
« Reply #2 on: 11 Jun 2005, 11:36:33 »
If the unit is called Natasha then try:

[Natasha] exec "huntme.sqs"

EDIT: beaten by 8 secs



Planck
« Last Edit: 11 Jun 2005, 11:37:17 by Planck »
I know a little about a lot, and a lot about a little.

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #3 on: 11 Jun 2005, 11:44:08 »
Thanks guys, but I've just tried:

  [Natasha] exec "huntme.sqs"

with

  _this select 0

in the script. Still no go. (Maybe it's because I'm a BlackOp and she can't see me...)

Boggle ???

Offline 456820

  • Contributing Member
  • **
Re:Manhunt not working (perhaps she likes me..?)
« Reply #4 on: 11 Jun 2005, 11:46:43 »
Code: [Select]
_huntUnit = this select 0
#loop
_huntUnit DoMove GetPos player
~10
?(Alive _huntUnit):goto loop
exit

try this one instead

Code: [Select]
#loop
natasha DoMove GetPos player
~10
?(Alive natasha):goto loop
exit

and call the script by
[] exec "hunt.sqs" or what ever the script is called

edit - just becasue your a black op desnt mean you cant be seen plus its domove so she will follow you even if she cant see you oh wait hang on i think domove is for groups try the move command if domove doesnt work.
« Last Edit: 11 Jun 2005, 11:48:30 by 456820 »

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #5 on: 11 Jun 2005, 12:14:56 »
I was joking about the BlackOp..!

Still no go. I shoot the Major, she runs like hell in the other direction all angry and looking for me - in the wrong place!  :-\

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Manhunt not working (perhaps she likes me..?)
« Reply #6 on: 11 Jun 2005, 12:24:18 »
This is a puzzle.

Try
this allowFleeing 0

in Natasha's init field.

Also put some hints in script to tell you what is happening.

Code: [Select]
_huntUnit = _this select 0
#loop
hint format ["Player at = %1\nNatasha at: %2",getPos player, getPos _huntUnit]
_huntUnit DoMove GetPos player
~10
?(Alive _huntUnit):goto loop
exit

NB you do need to use _this not this

Instead of doMove try
move
commandMove

Check to see that she is not being given any other commands - is she part of a group for example?

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #7 on: 11 Jun 2005, 12:36:42 »
Tried all that, still no go! Argh!

One thing; the Hint comes up only once - shouldn't that update as it's in a loop while she's alive?

Should I be setting the trigger to Repeat, or just fire once? Seems to me firing once, then the script looping should do it.

OFP 1.46, btw.

Edit:

Plus, she and the Major are grouped, along with another bodyguard. Would the two still being alive and grouped stop the script working?

Ah.... Should I name the group and tell the *group* to hunt me instead..? If so, pointers appreciated (still mucho noobie)
« Last Edit: 11 Jun 2005, 12:38:38 by Corben Dallas »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Manhunt not working (perhaps she likes me..?)
« Reply #8 on: 11 Jun 2005, 12:49:42 »
i think the problem lies "here" -

Code: [Select]
_huntUnit = _this select 0
#loop
hint format ["Player at = %1\nNatasha at: %2",getPos player, getPos _huntUnit]
_huntUnit DoMove GetPos player
~10
?(Alive _huntUnit):goto "loop"
exit

goto commands need inverted commas ( "" ) around the loop anchor....

;)
« Last Edit: 11 Jun 2005, 12:50:31 by bedges »

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #9 on: 11 Jun 2005, 12:52:54 »
Does that mean it won't work if the commas are verted though..? ;)

Thanks, I'll try that.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Manhunt not working (perhaps she likes me..?)
« Reply #10 on: 11 Jun 2005, 12:55:00 »
Well spotted bedges.

Now, why did I miss that?

 ::) ::)


Planck
I know a little about a lot, and a lot about a little.

Offline 456820

  • Contributing Member
  • **
Re:Manhunt not working (perhaps she likes me..?)
« Reply #11 on: 11 Jun 2005, 12:56:26 »
yep i just then noticed it to it should work now with those " " in it means that it wont loop and will just exit.

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #12 on: 11 Jun 2005, 13:08:58 »
Seems to partially work. Mostly they run in the wrong direction (I've init'd them to not flee), and sometimes they come after me.

I have the group waypointed to walk somewhere nearby - would that still affect them even though they're in combat mode once I shoot the Major?

Offline 456820

  • Contributing Member
  • **
Re:Manhunt not working (perhaps she likes me..?)
« Reply #13 on: 11 Jun 2005, 13:12:12 »
yeh i think it would affect becuase once theyve moved to where the player was they are now told to move to their waypoint

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #14 on: 11 Jun 2005, 13:20:00 »
So what can I do about that?

Also, I have another group of folks driving in and meeting them. However, if I've shot the Major and the bodyguards are after me, the new group drive up, get out, and act like there's nothing odd going on. AI, huh?!

So, there are a mix of East and Resistance (Resistance are friendly to East, btw) - some react and some don't, so what do I need to do? Sound an alarm or something? Throw bagels?

Gawd, a simple mission is eating up my life!  :o
« Last Edit: 11 Jun 2005, 13:21:57 by Corben Dallas »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Manhunt not working (perhaps she likes me..?)
« Reply #15 on: 11 Jun 2005, 13:21:30 »
the waypoint will probably still be in effect, unless it's not cycled, in which case, they'll go to the waypoint, and then properly follow the script's instructions. if they're not at the waypoint, they'll try to go to it, but every 10 seconds get an instruction to go to the player's position. if i were you i'd do it like this -

use your waypoints for where they walk, followed by a 'seek and destroy' waypoint, then a cycle waypoint. create a switch trigger activated by the killing of the general. in the 'on activation' field run your script. synchronise the trigger with the last walking waypoint, the one before 'seek and destroy'.

now. your script will change from telling them to move to the player's position, to moving the 'seek and destroy' and 'cycle' waypoints to the player's position, like this -

Code: [Select]
_huntUnit = _this select 0

#loop

[natashas_group, 5] setwppos getpos player
[natashas_group, 6] setwppos getpos player

~10

?(Alive _huntUnit):goto "loop"
exit

the key is in the numbers contained within the [natashas_group, 5] setwppos getpos player bit - if your first waypoint is numbered 0, count up to the 'seek and destroy' waypoint, and that's the number. the cycle waypoint will be the next one.

that should work, not guaranteed, and perhaps not optimal, depending on the situation.

edit - the second group can have additional 'seek and destroy' waypoints set too, perhaps around the base, or set along with the first lot, and the same switch trigger can be synchro'd to them. the only drawback is that if you kill the general while the second group is en route, they'll divert course instead of arriving at the destination and then following.

and aye, mission editing can get like this. fun isn't it ;)
« Last Edit: 11 Jun 2005, 13:25:32 by bedges »

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #16 on: 11 Jun 2005, 13:29:19 »
Not sure I grasp all of that, but thanks - some experimenting will help it sink in.

One thing; they actually have about 8 waypoints after the start bit, which they follow along a path and then cycle around some buildings.

Is there a way of removing all those waypoints and then doing as you suggest? Seems a more efficient way to me. (My brain hurts).

Edit: just re-read your post bedges, and it's starting to make sense...

I should be able to set another Switch trigger where the UAZ group arrive, and do the same thing with them. Ie., if the Major or either bodyguard are dead, make them go into Combat, flee, or whatever..?
« Last Edit: 11 Jun 2005, 13:40:37 by Corben Dallas »

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #17 on: 11 Jun 2005, 14:04:18 »
Ok, still stuck.

How do I get them to move to the final (seek and destroy/cycle) waypoints, then activate the script, when they're at waypoint 1 when I start chucking bagels?

Also, how do I synchronise a waypoint in a trigger - whut??

Just found I haven't named the group, and can't find where! My head's a shed right now. Maybe go for a nice healthy walk, without weapons...
« Last Edit: 11 Jun 2005, 14:05:53 by Corben Dallas »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Manhunt not working (perhaps she likes me..?)
« Reply #18 on: 11 Jun 2005, 15:03:01 »
heheheh - welcome to the world of flashpoint editing ;)

i shall do a wee missionette and you can see how it's done.

/more soon...

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #19 on: 11 Jun 2005, 15:11:46 »
Many thanks bedges. I'm out in a few hours and all day tomorrow, so will check in tomorrow night.

Many thanks to all of you who're helping - much appreciated. I hope you like the mission when it's ready to look at (hopefully sometime within the next week). Of course decent scripted cutscenes and such will come later, though there's good atmospheric music in there already (no big files for Beta though, as advised).

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Manhunt not working (perhaps she likes me..?)
« Reply #20 on: 11 Jun 2005, 16:52:59 »
right then - it's all in the attached mission file, open her up in the editor and take a gander.

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #21 on: 11 Jun 2005, 17:27:58 »
Hadn't gone out yet, so I took a look - many thanks.

One thing I don't get is how does it know which squad is grp1 and grp2 in:

  _squada = group grp1
  _squadb = group grp2

?

Is the squad name the name you give the office in the editor? (Sorry for dumb questions, but it's a steep learning curve).

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Manhunt not working (perhaps she likes me..?)
« Reply #22 on: 11 Jun 2005, 17:32:30 »
you have it. the command 'group' points at whatever group the unit happens to be in - if in doubt, check the comref.

you could alternatively assign the groupname in the init line of the lead officer by saying 'grp1 = group this'... six and half a dozen.

and aye, the initial learning curve is steepish, but in ofpec you've found yourself probably thee best resource around. no self-promotion there, it's simple fact ;)

Corben Dallas

  • Guest
Re:Manhunt not working (perhaps she likes me..?)
« Reply #23 on: 11 Jun 2005, 17:39:23 »
Yep, you folks are very patient and helpful. I think I'm getting the idea now, and a few triggers, some tweaks, and some simple (for now) trigger cutscenes and it'll be ready for a beta run and some flaming..! :)

What I'm trying to do is make it difficult enough to be entertaining, interesting in the story idea, exciting in terms of atmosphere, and with a couple of twists to make people say, "Ah - sneaky!"

More in a couple of days (unless I fall down another pothole).

Again, many thanks. ;)

Edit:

Damn that's good! Dead within moments, even with a ~20 in the loop. It's almost as if they're alive (and I'm not..!)

Happy bunny :)
« Last Edit: 11 Jun 2005, 17:53:59 by Corben Dallas »