Hello friends,
i really would like to get back to the core of this question, because it's (roughly-alike) the problem in my case, it just has another reason. I'm permanently actualising the screen output and the screen "flickers" due to term.clear() or term.clearLine(). I brought the data of the OCS-Proximity-Sensor to the screen, based on the Targets x- and z position. The Name of the Targets are shown. The Screen is cleared and the Targets are shown again at (maybe) their new position.
Expressed simplified:
while loop
within a "for - in pairs - do" loop
targets are shown on x, z, based on (target.Position.X), (target.Position.Z)
end
screen is cleared
end
How do I have to manage my "Output", without the need of cleaning the whole screen or the targets line. Maybe I just don't know how to put the targets into an object and then show object - clear object ??!!??
When the for loop ends and runs a new pass, x and z are containing of course new data and its logical, that i can't erase the old position with their new data and when i erase the target in the actual pass (with my limited knowledge), it brings up a flicker.
How do i have to erase the targets-display at the old position or maybe just before the new position becomes actual?
Greez
Help plotting entity positions using OCS
Started by ZagKalidor, Jun 18 2013 12:04 PM
4 replies to this topic
#1
Posted 18 June 2013 - 12:04 PM
#2
Posted 18 June 2013 - 12:50 PM
I've split this into a new topic for you, since it's different enough to call for it.
What you're going to want to do is structure your main loop a little differently:
This restructuring gets around the time-consuming target information lookups. The flicker you're experiencing is because you clear the screen before you start the loop again, and then it takes some time to gather all of the information on the entities in range. If you separate out the information gathering and the actual drawing, you can leave the last known information in the screen right up until you have got all of the new information and are ready to draw it to the screen.
What you're going to want to do is structure your main loop a little differently:
while true
declare local table
for each target
add target position and name to table
end
clear screen
for each entry in local table
draw to screen
end
end
This restructuring gets around the time-consuming target information lookups. The flicker you're experiencing is because you clear the screen before you start the loop again, and then it takes some time to gather all of the information on the entities in range. If you separate out the information gathering and the actual drawing, you can leave the last known information in the screen right up until you have got all of the new information and are ready to draw it to the screen.
#3
Posted 18 June 2013 - 01:58 PM
Wow, thank you man,
you really take me further, this really has more than one learning objective. Well, i think it takes some time for me to realize that but i prefer learning by doing.
Btw, I'm the founder and first member of the Lyqyd-Fan Club. I'm drinking a beer on you, cheers.
you really take me further, this really has more than one learning objective. Well, i think it takes some time for me to realize that but i prefer learning by doing.
Btw, I'm the founder and first member of the Lyqyd-Fan Club. I'm drinking a beer on you, cheers.
#4
Posted 18 June 2013 - 04:22 PM
Can I be the coowner?
#5
Posted 18 June 2013 - 11:15 PM
Member first class and co-president
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











