Issues with Module.Get.TargetID

tinyromeo

Active Member
As some might know I am authoring a salvage bot (Wrecking Ball - in the scripts releases forum). I am hard at work fixing bugs, but all my time is consumed dealing with a recurrent issue. Finally I am reluctant enough to ask for help.

In my script I compare my targets id's to my modules targets id's for use in deactivating tractor beams when a wreck or container is close enough to loot/salvage. Something to the tune of:

Code:
if ${TractorBeams.Get[${j}].TargetID} == ${Targets.Get[${i}].ID}
When I test this outside of my script I have perfect results every time. However, when it is in the works in my script it will let slip incorrect ids multiple times regardless of how many times I ask it to compare ids.

I have suspected in the past that this was an issue of entities leaving the grid, but I am not so sure anymore. Perhaps the entities are reassigned ids?
Am I missing some stupid obvious thing?
Are my suspicions maybe true about entities leaving the grid?
Could lag maybe cause this?
Or perhaps is there something deep down happening in innerspace/isxeve that I could not possibly be aware of?
 

CyberTech

Second-in-Command
Staff member
As some might know I am authoring a salvage bot (Wrecking Ball - in the scripts releases forum). I am hard at work fixing bugs, but all my time is consumed dealing with a recurrent issue. Finally I am reluctant enough to ask for help.

In my script I compare my targets id's to my modules targets id's for use in deactivating tractor beams when a wreck or container is close enough to loot/salvage. Something to the tune of:

Code:
if ${TractorBeams.Get[${j}].TargetID} == ${Targets.Get[${i}].ID}
When I test this outside of my script I have perfect results every time. However, when it is in the works in my script it will let slip incorrect ids multiple times regardless of how many times I ask it to compare ids.

I have suspected in the past that this was an issue of entities leaving the grid, but I am not so sure anymore. Perhaps the entities are reassigned ids?
Am I missing some stupid obvious thing?
Are my suspicions maybe true about entities leaving the grid?
Could lag maybe cause this?
Or perhaps is there something deep down happening in innerspace/isxeve that I could not possibly be aware of?
Put
echo if ${TractorBeams.Get[${j}].TargetID} == ${Targets.Get[${i}].ID}
above the compare line. If both numbers match but the compare is failing, and the numbers are very big, then try the development innerspace.
 

tinyromeo

Active Member
echo if ${TractorBeams.Get[${j}].TargetID} == ${Targets.Get[${i}].ID}
This is exactly how I test it, that exact echo is even inside my script (after the compare though). Yes the numbers are very large (90000000000000000547839) something like that, however the compare doesn't always fail. Most of the time it works and works good, but every once in a while (lag, entities disappearing) it will fail.
But development IS huh.... time for google.
Since you mentioned very large numbers, would maybe a float or double do the trick? (Not a very solid C programmer yet, but if I recall floats and doubles store bigger numbers than an int right? Just not sure if datatype matching is necessary)
Big thanks!!
 
Top Bottom