Jump to content
Sign in to follow this  
Cernu

bypass comparing errors

Recommended Posts

when two values cannot be compared, but are compared anyways (I have aLOT of problems with game objects, entities, templates, types, and individual objects), the script stops working. Do you know a coder way to bypass the error please ? 

  • Upvote 1

Share this post


Link to post
Share on other sites

Usually I will try to use an "If" first to make sure the variable is the right class/type, then compare/add/do something with it.

 

Ylands_201108_022731.png

  • Thanks 1
  • Upvote 1

Share this post


Link to post
Share on other sites

thanks, but I have issues if "example" is a game object, or doesn't even exist. You know, like using NONE, Unknown, null and stuff...

Edited by Cernu
  • Upvote 1

Share this post


Link to post
Share on other sites

I thought "Is Entity" (one of the options I have in the picture in the last post and something you and Azaren have talked about previously) would just give "FALSE" and then the IF wouldn't continue ?

Something like this IF chain, but with whatever instructions you need instead of the "write to console." You can also get rid of the "Else" to have it do nothing if false:

Ylands_201108_134514.thumb.png.3990496c2db6aec859d788f8f7167c0b.png
Ylands_201108_134540.thumb.png.b8ed4283c72917e97ba5744f4c1fdc22.png

Ylands_201108_134349.thumb.png.b8054be6af4b6aa1a666c0add2d15307.png

 

I do wish there was an option to see what type of game logic it is. ? Although, you can always use game logic labels and use an IF to see if it has that label. But that might be a lot of work to Ctrl Double click to get the trigger zones for example, then attach the game logic label, because you would have to do that for all types of game logic you have.

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
Sign in to follow this  

×