Jump to content

Condition Issue


ajs52698

Recommended Posts

Im attempting to check if the function Findallreferencesoftype returns a object but Im having issues.

 

 

Objectreference Blahblah = Game.FindClosestReferenceOfTypeFromRef(Bucket,Self,100.0)

 

The problem Im having is this returns none if it doesnt find the object and Iobjectreference if it does.

 

If BlahBlah == Iobjectreference This will not work

 

So how Can I check if it does find the object[using the bucket like this, If blahblah == Bucket, doesnt work either)

 

 

Link to comment
Share on other sites

Your variable will look for the bucket exactly 100 units from whatever self is. 100 units is EXTREMELY SMALL. I believe that's something like three steps for the player. When looking for something with those functions, it's ok to have a radius of at least 6000.0 units, as an exterior cell is about 4,000.0 units in length. For interiors you need to go much higher, like 20 or 30k because the thing you want could be at the end of the dungeon, etc, and you can't know how many units that is off hand. (Example.. Embershard Mines in Skyrim, from the entrance to the exit is around 37k units, I believe).

 

The type objectreference will return none if there is no object. The function therefor will return none if the bucket was not found and return it if it has.

 

So the proper syntax when checking if it's none or not:

if BlahBlah == none
; stuff here
endif
or

 

If BlahBlah
; code
endif
 
; Shorter version of the above example

or

 

if !BlahBlah
; code
endif
 
; means it's "not none"
If this is confusing, just use the first example. Edited by EveningTide
Link to comment
Share on other sites

Yea i want it to be a small radius and when using Debug.notification(blahblah) if it detects the bucket I get Iobjectreference in return and if it doesnt I get none.

 

so what your saying Is I shouldnt specify what Im looking for, example instead of this If blahblah == Bucket I should just do this If if BlahBlah?

 

I need to check IF it FINDS the object, not if it doesnt.

 

ah wait I see you used !, i havent had experience with this, let me see if it works.

 

Yea if I used if !blahblah it still doesnt seem to work as whatever happens after the if isnt conditioned.

 

If !blahblah doesnt work but If blahblah == !none does work!

 

Thanks for help

Edited by ajs52698
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...