string identity not working, why?

ArmA editing, missions, modeling, textures, terrains

Moderators: Lone Wolf, Snake Man

Linker Split
Recruit
Posts: 14
Joined: 2007-10-18 22:15:44

string identity not working, why?

Post by Linker Split » 2008-07-09 22:05:57

Ok, let me explain you what i want to achieve:

I want that when my character is near for example a bush, then the engine recognizes it is the bush lks_bush_leaf3_big.p3d and execut the second part of the script.
Now I'm stuck at this simple string identity, cause I want to compare the string lks_bush_leaf3_big.p3d and the one the engine recognizes through the line _r_obj = str "_obj"

if I put the famous trial line hint format ["%1",_r_obj], it works, the hint appears: lks_bush_leaf3_big.p3d
but when coming to the identity, it doesn't work. why????

Code: Select all

;my unit
_Character = _this select 0

#START
;find the nearest object in order (passed array which elements are: 0 = player, 1 = nearest object)
_near_obj = nearestObjects [_Character,[],3]

;select the array select 1, so the real object
_obj = _near_obj select 1

:convert the object into a string
_r_obj = str "_obj"

;identity which doesn't work
? _r_obj == "LKS_bush_leaf3_big.p3d" : _Character setDammage 1
~1
goto "START"

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests