OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CapMorgan 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.
-
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.
-
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...
-
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.
-
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.
-
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.
-
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 :-\