Home   Help Search Login Register  

Author Topic: Object acting as person?  (Read 566 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Object acting as person?
« on: 24 Mar 2005, 19:30:33 »
Hi all,
I have a problem. I'm making a training ground using Figure 11 targets (http://www.ofpec.com/addons_depot/index.php?ID=476)
I have a trigger with west present activating them so they pop up. But heres the problem.

I want the targets to pop up when the player enters the viewing range of them. So, like a detected script but when the target 'sees' the player instead of a enemy unit seeing him.

Is this possible?  :P

Thanks   ;)
« Last Edit: 24 Mar 2005, 19:52:15 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Object acting as person?
« Reply #1 on: 24 Mar 2005, 19:57:26 »
maybe crating a script wich detects de distance between the player an the target.... when it is ecuals or less than a number in meters, this one activates....
sometinh like
Code: [Select]

#begin
_man = this select 0
_target = this select 1

? ( _man distance _target) < 10 : whatever is the pop-uping scriopt;exit

goto "begin"

but usin the "_x" and "foreach" will be better... no idea how to scripot whit toes commands..

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Object acting as person?
« Reply #2 on: 25 Mar 2005, 00:15:16 »
It depends what you mean by 'sees'. If you mean 'within range', which is basically what the trigger simulates, then you've already done it.

If you don't want the target to pop up if the player is behind it, or if the player is in front of it but behind something else, then this is more tricky, but I've got a couple scripts which can simulate a more realistic 'sighting' quite well. But you'll have to explain what you mean in more detail, because it might be more straight forward than this.
« Last Edit: 25 Mar 2005, 00:16:43 by Fragorl »

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Object acting as person?
« Reply #3 on: 25 Mar 2005, 07:24:54 »
A long shot, but here goes . . .

Have you tried the knowsAbout comand on the object ?  Assuming that you placed the object in the editor it should be a part of a group, no ?

If this doesn't work try grouping the object with (say) an East soldier.  This SHOULD make it part of a group, which tends to share its knowsAbout rating instantly with all members.

Just a guess . . .



roni


Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Object acting as person?
« Reply #4 on: 25 Mar 2005, 10:23:37 »
I'll try that. At the moment i'm making do with a trigger carefully placed.  ;)

You see, what i've got is those targets in a custom built room.

When you enter it looks like this

                         --------------------
         entrance>        _____      |
                         |____       ____|
                         |                       |
                         |                       |

                            /\ Targets /\

The idea is that if the targets see the player, they go up and he has about 2 seconds to kill all of them.
But if the player crawls along that wall in the middle, opposite the door, he won't be detected by the targets, so he can exit the area without setting them off.
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Object acting as person?
« Reply #5 on: 26 Mar 2005, 02:03:14 »
@Roni
Knowsabout is a bit difficult to use.... basically it's 'on' or 'off', I find. If a unit doesn't know you're there, it's zero; the moment they know you're there it leaps to, say four, (i'm not sure about this). Then it kinda oscillates, decreading from 4 to 1.5, and then as soon as it reaches 1.5 it leaps up to 4 again. This keeps on happeneing regardless of whether the original soldier has line of sight to you or not, or whether they've seen you since the first time, shot at you, or anything. It's a bit useless IMO. For one thing, going prone reduces the time it takes for knowsabout to reset to zero (which it does after a looong amount of time, quite suddenly), even if you can see the soldier, and they can 'see' you.

@Greg
So what I'm getting at is, it would be nigh on useless ( ;D ) in your situation. Also - note I can't vouch for the 4 and the 1.5 values, I think they're slightly different.

My scripts *should* work quite well in this situation, the only problem might be if the room is too small, as my line-of-sight checks are often off by up to a metre. But if you post a copy of the mission, I'll see what i can do. ;)

 

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Object acting as person?
« Reply #6 on: 26 Mar 2005, 02:28:37 »
@Fragorl

Roger that.

There was a thread on this subject many moons ago - you're right on all counts.  The kA rating jumps stright to 4 as soon as you're seen and only goes down (slowly) if you are out of sight.  The enemy effectively "knows" your whereabouts until the rating goes below 1.5, so once you're spotted the enemy will keep tracking you for quite some time, even if you're hidden from view.

A few interesting points about this rating.  First off, it is automatically and instantly shared with all members of the same group, no matter how far apart they are.  Second, this info is NOT shared with any other group, no matter how close they are !

I tested this with two groups, with one member from each group standing within 2m of each on either side of a corner.  I placed myself around the corner in front of just one of them and had a script return the kA rating for both.  Surprise, surprise - the one that could see me went straight to 4, the other stayed at 0 until he himself could see me too !   Yet they were just 2m apart !  :o   :P

Another interesting bit of info -

I tested out a quick mission last night to see if objects can have a kA rating.  I placed a West soldier and a building (barracks) and made the BUILDING the player (!).  Yes, it does work, but if you play as an object in the game you can't move (natch !) and can't look around.  I even added extra buildings to the "group" but I still couldn't go into Leader view - rats !

(BTW - you can't add the building to an East or West group - boo hoo !)

I fired up the test then quickly discovered that an objects kA rating never changes - it's always stuck at zero !  I was a bit surprised at this - it makes sense (does the game really need to know if that tree knows if you're there ?), but the surprise was that it didn't make any difference whether it was a player object or not.

The bottom line is that you can't interrogate the kA rating of an object to get any useful info - you'll have to script it.  Ergo - Fragorl is right.   :thumbsup:

Cheers



roni