Home   Help Search Login Register  

Author Topic: feet wet pilots  (Read 8330 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:feet wet pilots
« Reply #45 on: 23 Feb 2004, 11:49:24 »
Probably because he's trying to mantain formation.Doesn't player join GRPNull work ? (sorry if I have missed the
exact meaning ...)

This all look so good on paper ... keep up the good work,
Colonel_Klink !


yup, nearly there... [unit] join GRPNul  ;)
« Last Edit: 23 Feb 2004, 11:49:45 by Messiah »
Proud Member of the Volunteer Commando Battalion

sa8gecko

  • Guest
Re:feet wet pilots
« Reply #46 on: 23 Feb 2004, 11:56:23 »
Thanks Messiah for correcting me. I hope this didn't cause
Colonel_Klink any trouble.

Offline Colonel_Klink

  • Members
  • *
  • Independent Addon Creator
    • DC3D Game Modelling Zone
Re:feet wet pilots
« Reply #47 on: 23 Feb 2004, 11:59:51 »
Thanks for the grpnull bit. Will try that tomorrow.
BTW any ideas how toensure that the guys that have been rescued can be put back into their original team. For example imagine rescuing 12 guys (a squad) and only having 6 cargo spots which means two trips to rescue them. Once rescued they return to their own team. Now this is from within an addon script.. Could it be done?

Next: How do I determine how many empty cargo slots on my vehicle? I want to be able to rescue say the squad as above.

Also this needs to be determined if a rescue boat comes to me (player) and it has no empty cargo slots.
« Last Edit: 23 Feb 2004, 12:00:57 by Colonel_Klink »
Rebel without a pause...D.I.L.L.I.G.A.F.

PsyWarrior

  • Guest
Re:feet wet pilots
« Reply #48 on: 23 Feb 2004, 12:41:38 »
Thanks for the grpnull bit. Will try that tomorrow.
BTW any ideas how toensure that the guys that have been rescued can be put back into their original team.

Before placing in the new group, do
_origGrp = group _unit
Assuming that you want to set a local variable called _origGrp, and that the unit you're going to put in the boat is referred to as _unit.

Just keep the script running until the unit has disembarked, then
[_unit] join _origGrp
Should work.

You may (or may not) want to wait for a short time before releasing this addon, as you might (or might not) want to use some of the stuff in the PsyProductions script.

A question: How did you detect the closest boat to the player/ unit bailed out? Did you use a similar method to MOPD, documented above, or did you use something completely different?

-PsyWarrior
-PsyProductions

Tuulos

  • Guest
Re:feet wet pilots
« Reply #49 on: 23 Feb 2004, 12:45:13 »
Klink, i think i know what could be realistic: If the boat is full, it 1. radios for another boat, 2. leaves a Zodiac for you when it goes to empty it's cargo.
And by the way, could you make a script that a for example a coast guard airplane flies over and when the plane spots you they would drop Zodiac or live raft where you could climb and wait for a boat/helicopter they called with radio?
I think that SpawnVehicle or something might do the trick for spawning the Zodiac.

And now when I remember, thanks for the mission sa8 :)

PsyWarrior

  • Guest
Re:feet wet pilots
« Reply #50 on: 23 Feb 2004, 13:06:55 »
Greetings

The command you're looking for is

createVehicle

Which has to be used in a script like this anyway. This sort of stuff will probably not be implemented in the release version of either col_klink's (although I can't speak for him) or the PsyProductions scripts, as it is very mission specific stuff. Radio channels and the like need to be defined by the mission creator.

However, it would be possible for the mission designer to script this, and a script may even be released later which does this sort of thing.

I can say with certainty that, while radio broadcasts (sideChat and the like) may be used, custom radio 'callsigns' (the ones set off by the player in the command menu) will not be used in V1.0 of the Psychic Productions script.

-Supr. Cmdr. PsyWarrior
-Psychic Productions

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:feet wet pilots
« Reply #51 on: 23 Feb 2004, 13:12:57 »
klinkers.... its possible to check if the driver is there, gunner as well - CoC did it with the UA i think, so surely it should be possible enough to check cargo?

i'm no scripting guru, so don't know how you would go about it off hand, but i'm sure there are people here who could get it working.
Proud Member of the Volunteer Commando Battalion

PsyWarrior

  • Guest
Re:feet wet pilots
« Reply #52 on: 23 Feb 2004, 13:30:39 »
Messiah,

It is possible to check how many units are in cargo, as long as you know what crew the boat has. You could:
count units in _boat
(rough syntax only), minus the crew. So if a boat had just a driver, and 3 people in cargo, the count command would return 4, - the driver = 3.

If you had driver, commander and gunner, and 3 people in cargo, you would get 6, - 3 = 3.

The problem is, you have to know how large the crew of the boat is. This could be done, in theory, by checking who the driver, commander and gunner are using

_drv = driver _boat

For example. If nothing is returned, you don't count them.

So MKII PBR, would return for driver and gunner, but not for commander (assuming it was fully crewed). You would then count the units in cargo using

_cargo = (count units in _boat)- 2

(again, rough only).

I can't test this without being on a computer with OFP (which i'm not at the minute), so no guarantees.

Hope that made some sense...  ::)

-Supr. Cmdr. PsyWarrior
-Psychic Productions
« Last Edit: 23 Feb 2004, 13:33:46 by PsyWarrior »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:feet wet pilots
« Reply #53 on: 23 Feb 2004, 14:56:08 »
going on that.... couldnt you place a large trigger over the whole map area, and count units and add them to a list.... then use some pretty simple scripting to see if any in that list are in the boat.... that would seem a simple enough work around - its the same basic stuff i did to make a 'shout for medic' script a while back - can be done, as i did, for each side as well (triggered by west, east, resistance, civilian) so you can decide who can be in the list and can get into the boat...

klinkers, i think that may be the simplest way to do it
Proud Member of the Volunteer Commando Battalion

PsyWarrior

  • Guest
Re:feet wet pilots
« Reply #54 on: 23 Feb 2004, 19:00:52 »
Greets,

Yes, it could always be done with triggers, but if the Colonel wants to publish the script as part of an addon (not as a mission design script), it needs to be completely autonomous.

So triggers probably would be easier in one respect, but the addon would require the mission designer to put the trigger down before the addon would work properly.

So, conversely, it's easier to deal with the code in the script, rather than leave it up to the mission designer who might be a complete novice.

Personally, I like to make my scripts autonomous so that they can be used and reused with very little actual effort (usually just changing things in the exec line of the script).

But triggers is a very valid option for anyone making a SAR mission, and who doesn't want to wait. It could also be used for testing purposes, to ensure that my scripting actually works at all  ::).

-PsyWarrior
-PsyProductions

UPDATE: Seperate AI control scripts introduced so that AI will correctly handle bailing out.
« Last Edit: 23 Feb 2004, 20:22:53 by PsyWarrior »

fragsta

  • Guest
Re:feet wet pilots
« Reply #55 on: 23 Feb 2004, 21:15:37 »
Are we close to seeing this script?

Offline Colonel_Klink

  • Members
  • *
  • Independent Addon Creator
    • DC3D Game Modelling Zone
Re:feet wet pilots
« Reply #56 on: 24 Feb 2004, 01:51:44 »
At the moment the scripting I'm using is integral to the fishingboat/police launch/ lifejackets etc. But can be used by other addons using the init section.
Just to clarify.. I'm a novice script writer so A lot of what I am doing is trial and error. :)

To detect the rescue boat, or the guy in the life jacket I used the nearestobject syntax. This is fine for detecting 'known' boats, choppers etc as in the fishing boat addons that will also be able to detect all BIS boats and choppers as well as the Falklands mod ones.

Its a pity there is no 'typeof' command to check from a base type. e.g. boatw is a base, or even ship/smallship to go back to the parent class of boat. Helicopters would be easy as helicopter is the base class.

A typeof command would look something like this (presuming)

First check for nearest object then check the typeof unit as in:
 [psuedocode]if _nearestunit is typeoff ship then blah blah blah[/endpsuedocode].

EDIT:* Just looking at the countType command
Code: [Select]
"Tank" countType list triggerOneNot sure how this could be implemented but will give it a try.
END EDIT

Not sure when the next fishing boat release will be as I'm also looking at having the zodiac on the back of the police launch as being deployable which also allows the use of a zodiac being used as Tuulos suggested above.

At the moment I use the createvehicle command to create instances of the life jackets etc. I dont play multiplayer and have no idea how the addon will behave on a server. It may be that someone with more grey cells might be able to make a better job of it.

I will try the count idea to check the number of empty cargo slots.

Thanks for everyone's input.
Cheers
Klinky
« Last Edit: 24 Feb 2004, 02:01:31 by Colonel_Klink »
Rebel without a pause...D.I.L.L.I.G.A.F.

PsyWarrior

  • Guest
Re:feet wet pilots
« Reply #57 on: 24 Feb 2004, 12:11:32 »
Greetings,

@fragsta - The PsyProductions script will be in the Beta Testing board here soon, after finalising and internal testing. It should be ready for general release (as V1.0) sometime in the next two weeks.

@Col Klink - countType is what the PsyProductions script uses, and it's invaluable. Once you've picked up the objects in the area, you can filter them using

_ships = "SHIP" countType [_obj1, _obj2, _obj3, _obj4]

detecting any unit of type "SHIP", and numbering

Be careful when using nearestObject that you don't detect the player unit. This has been a great problem with the MOPD system, as it periodically detects the source unit (i.e. the player), and my attempts to filter this have not yet succeded. I have tried

? _targ1 == _unit: _targ1 = objNull
and
? _targ1 == player: _targ1 = objNull

With little success. It will not detect if the target is the same as the player. For reference, _targ1 is the target picked up the nearestObject command after the first cycle of the MOPD system. The current version of MOPD (0.5) cycles 4 times and therefore, selects 4 targets (_targ1..._targ4).

Has anyone got any ideas on how to resolve this?  ???

Looking forward to the release of the lifejackets Colonel (it does look a little stupid bailing from a PBR in a zodiac, which is almost as large)  ::) , and the next version of the fishing boats.

-PsyWarrior
-PsyProductions

sa8gecko

  • Guest
Re:feet wet pilots
« Reply #58 on: 24 Feb 2004, 12:52:36 »
Quote
e careful when using nearestObject that you don't detect the player unit. This has been a great problem with the MOPD system, as it periodically detects the source unit (i.e. the player), and my attempts to filter this have not yet succeded. I have tried

? _targ1 == _unit: _targ1 = objNull
and
? _targ1 == player: _targ1 = objNull

Well, you know the player position:
? position (_targ1) == position (vehicle (player)): ...
I don't know if arrays can be compared this way, but it should work,
assuming the player or _targ1 is not moving too fast.
Otherwise check distance:
? ((vehicle (player)) distance _targ1) == 0: ....
if the distance method above you can't discriminate, try relaxing
the condition a little:
? ((vehicle (player)) distance _targ1) < 0.2: ...



P.S.: Footmunch has finally read my message, PsyWarrior. You will
have news soon.

PsyWarrior

  • Guest
Re:feet wet pilots
« Reply #59 on: 24 Feb 2004, 13:16:59 »
Greetings,

@sa8gecko - The distance check will not work. A hint format check of the distance between unit and the target reveals some strange results:

hint format ["Distance from target: %1. Target: %2. Player: %3." _targ distance _unit, _targ, _unit]

result: "Distance from target: 1.9886468[approx]. Target: WEST: Echo Black 2 (PsyWarrior). Player: WEST: Echo Black 2 (PsyWarrior)."

So, clearly, _targ and _unit are the same, despite the fact that the filters should have prevented this. Yet, they are about 1.9 (variable) m away.

Setting this hint to loop produces more strange results. The distance varies around the 1.98... mark, and does not remain constant, despite the fact that the player should always be the same distance away from himself.

Checking the position is inspired, though. I can't test it now, but I'll have a go at it ASAP. What really annoys me though, is that the _targ and _unit are clearly identical, but I can't get a "_targ == _unit" conditional to detect this.  ???

-PsyWarrior
-PsyProductions