Jump to content
creep

New Command cursorObject not working as intended

Recommended Posts

Hey guys,

 

like the title say, the new command cursorObject doesnt work as intended or described. The command is currently just an exact copy cursorTarget as of what I could test.

It does not recognize Trees, rocks, bushes or anything smaller than a house.

 

It would really like to get this fixed, since its a pretty useful command and would finally be a solution to the annoying nearest object workaround, which isnt really reliable. 

 

Any other experience from any of you?

 

 

Greetings!

Share this post


Link to post
Share on other sites

For me also. And disabled simulation objects as well. (it was <null_object> with cursorTarget)

Share this post


Link to post
Share on other sites

gotta pick this up here...

bi wiki says:

 

hint typeof cursorObject; 

 

but it does not return a class for objects like for example cinderblocks_f (terrain objects)

its working for things that can be already accessed via cursorTarget, but for those who have null object at cursorTarget, its not return anything here.

Share this post


Link to post
Share on other sites

gotta pick this up here...

bi wiki says:

 

hint typeof cursorObject; 

 

but it does not return a class for objects like for example cinderblocks_f (terrain objects)

its working for things that can be already accessed via cursorTarget, but for those who have null object at cursorTarget, its not return anything here.

 

typeOf only works, if the targeted object has a config.cpp entry.

 

Lets make a test with a random tree or Bush on Altis:

 

Does not work:

cursorTarget setDamage 1;

DOES work:

cursorObject setDamage 1;

Share this post


Link to post
Share on other sites

 

typeOf only works, if the targeted object has a config.cpp entry.

 

Lets make a test with a random tree or Bush on Altis:

 

Does not work:

cursorTarget setDamage 1;

DOES work:

cursorObject setDamage 1;

ok..

but howto check if a object is like the cursorobject then?

 

i got something like

target = "Land_Cinderblocks_F"

and now i want something like

if (target == cursorObject) ...addaction .."take it"...and then spawn some cinderblocks on playerspos

 

this is working for objects like houses etc that are already accessible via cursorTarget, there i get the class back even with cursorObject

 

but i just dont get any class back when using cursorobject on this

Share this post


Link to post
Share on other sites

You don't get a class back, because it doesn't exist (again: No Config entry).
 
I did it like this:

_Target = "Land_Cinderblocks_F";

_Obj = cursorObject;
_ObjName = toArray str(_Obj);
_ObjName deleteRange [0,((_ObjName find 58)+2)]; //Find " : " + the 2 following signs (2x "space")
_ObjName = toString(_ObjName);

If(_ObjName isEqualTo _Target)then{systemchat "Its the object"}else{systemchat "Nope, nothing"};

Could be done easier with "select", but i am tired as hell and way too lazy to write it down now  :P
 
EDIT:
Okay, wasn't so lazy:
 
Different way:

_Obj = cursorObject;
_ToCheck = str(_Obj);
_StartPos = ((_ToCheck find ":")+2); //find ":"+the following 2 "space"
_ObjName = (_ToCheck select [_StartPos, (((count _ToCheck) - _StartPos)-4)]); //remove ".p3d" from it
systemchat _ObjName;

Share this post


Link to post
Share on other sites

 

You don't get a class back, because it doesn't exist (again: No Config entry).

 

I did it like this:

_Target = "Land_Cinderblocks_F";

_Obj = cursorObject;
_ObjName = toArray str(_Obj);
_ObjName deleteRange [0,((_ObjName find 58)+2)]; //Find " : " + the 2 following signs (2x "space")
_ObjName = toString(_ObjName);

If(_ObjName isEqualTo _Target)then{systemchat "Its the object"}else{systemchat "Nope, nothing"};

Could be done easier with "select", but i am tired as hell and way too lazy to write it down now  :P

 

EDIT:

Okay, wasn't so lazy:

 

Different way:

_Obj = cursorObject;
_ToCheck = str(_Obj);
_StartPos = ((_ToCheck find ":")+2); //find ":"+the following 2 "space"
_ObjName = (_ToCheck select [_StartPos, (((count _ToCheck) - _StartPos)-4)]); //remove ".p3d" from it
systemchat _ObjName;

ah nice thx! gotta try this later when im at home

 

 

but why does bi wiki say then i can go and make 

typeof cursorObject

i thought cursorObject got introduced to make a handle for terrainobjects?!   i mean for everything except terrainobjects i could use cursorTarget

lets say i want a house

i could go and make

_target = cursorObject (Or use here cursorTarget, doesnt matter);_cin = "Land_u_Addon_02_V1_F";if(_target isKindOf _cin) then { hint str "got it"} 

 

and this will work..

 

 

what you are doing is something like splitting strings if i got it correct?

is there also any way to add a config entry manually? cause I got the target = cursorObject fixed in a piece of code(using here exile framework)

Share this post


Link to post
Share on other sites

 i mean for everything except terrainobjects i could use cursorTarget

 

 

Good luck with that, but I suggest you read about cursorTarget first: https://community.bistudio.com/wiki/cursorTarget

I have changed example for cursorObject to make it more universal: https://community.bistudio.com/wiki/cursorObject

  • Like 1

Share this post


Link to post
Share on other sites

Good luck with that, but I suggest you read about cursorTarget first: https://community.bistudio.com/wiki/cursorTarget

I have changed example for cursorObject to make it more universal: https://community.bistudio.com/wiki/cursorObject

no for real -  I use cursorTarget, or better say Exile uses it. and it works pretty seamless on different kind of objects, like houses, hbarriers, etc.

 

I just came across the difficulty to do the same with fences, walls and stuff that like dscha said has no config entry.

 

but your changes made it more clearly!

 

i can use now like

_model = getModelInfo cursorObject select 0;

hint str _model

and got the thing i want :)

 

tested snippet:

_model = getModelInfo cursorObject select 0; _Target = "cinderblocks_f.p3d"; if(_Target == _model) then { hint str "yeah"}

 

 

 

 

But...

for some reason i can't do

on TerrainObjects

cursorObject addAction ["cTerrain", hint str "1"]

 

while on createdVehicles

cursorTarget addAction ["cTVeh", hint str "2"]

cursorObject addAction ["cTObj", hint str "3"]

works

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×