Home   Help Search Login Register  

Author Topic: NearestObject and 1.75  (Read 1548 times)

0 Members and 2 Guests are viewing this topic.

Offline CapMorgan

  • Members
  • *
  • OFP fan
    • Cazadores de monte
NearestObject and 1.75
« on: 07 Sep 2002, 00:25:44 »
OK, i can't find any solution to this...I know the command has changed in 1.75, and i don't know how to use it now.
this is the script working under 1.46, a simple missil-follow cam.

_i = 0
@((_actor ammo "carlgustavlauncher") == 0)
_disparo = nearestObject [_actor, "carlgustav"]
_camera camSetTarget _disparo
_camera camCommit 0
_camera camSetRelPos [1,0,1]
_camera camCommit 0


Thanx for reading this.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:NearestObject and 1.75
« Reply #1 on: 07 Sep 2002, 00:46:56 »
I think the command is either broken or there is something BIS didn't include in the new command ref. I think the 1.75 command ref says exactly what the old command ref said about the nearestobject command.

I've run into the same thing with a missle follow script. ???

Hopefully BIS will either fix the command or release an updated command reference that is accurate.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline CapMorgan

  • Members
  • *
  • OFP fan
    • Cazadores de monte
Re:NearestObject and 1.75
« Reply #2 on: 07 Sep 2002, 15:53:08 »
May be it has something to do with the ObjectID...but i can't beleave BIS didn't realise nearestObject wasn't working...or they did and...who cares!! hehe. The problem is that there's aparently no solution for the follw script, and that's a pitty, because they are really good stuff for cutscenes. Hope they fix it...

Offline KTottE

  • Former Staff
  • ****
Re:NearestObject and 1.75
« Reply #3 on: 07 Sep 2002, 16:26:25 »
Quote
nearestObject pos
Operand types:
    pos: Array
Type of returned value:
    Object
Description:
    Nearest building of given type to given position or object. pos may be [x,y,z, "type"] or [object, "type"].

Example:
    nearestObject [player, "StreetLamp"]


Nicked from the 1.75 comref.

_actor has to be an object. It can't be an array or a variable.
That's how I understand it anyway.

Cheers, KTottE

PS. This will remain in Sounds & Cutscenes for a while longer, but if the discussion continues on nearestObject and not a missile-cam thing, it will be moved to Scripting: Advanced.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline CapMorgan

  • Members
  • *
  • OFP fan
    • Cazadores de monte
Re:NearestObject and 1.75
« Reply #4 on: 07 Sep 2002, 18:29:00 »
well, _actor is a unit, so it's an object. _disparo is the carlGustav rocket, also an objetct.
Anyway the description is the same in both command ref. (1.3 and 1.75) but the command has changed, that's a fact. That's why im frustrated,  i don't have the tools (or the brain) to solve this.

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:NearestObject and 1.75
« Reply #5 on: 07 Sep 2002, 22:28:02 »
Quote
nearestObject [player, "StreetLamp"]

This example from the command ref does not work in v1.75, while it does work in v1.46.

There definitely is a problem with the command in 1.75.

Perhaps this should be in the scripting forum.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Bremmer

  • Guest
Re:NearestObject and 1.75
« Reply #6 on: 07 Sep 2002, 22:38:40 »
Yeah - nearestobject is knackerd in 1.75.

Suma (BIS lead programmer) admitted that it was just an oversight, and said that it would be fixed with the next patch ... still waiting though  :-\