Ok so ive got a couple more things that im currently stumped on.
Im wanting to have it where a person needs to find their body once they are dead and i want a tracker that shows them which direction it is, I can think of a couple ways to do it but none of which would be very efficient. Any suggestions?
Second I want to have a map button that shows an picture of the entire map with a marker as to where they are on the map. Ive look at the demos and all seem to take a lot of cpu to use.
ID:160189
Oct 28 2008, 4:34 am
|
|
In response to Jeff8500
|
|
Jeff8500 wrote:
Pretty sure the CPU thing is unavoidable. You can remove useless loops, etc. but you will have to keep looping to get an accurate display. Of course, you can avoid having it consistently by simply building an image of the map once on world/New() or as such and caching it for re-usage. |
In response to Kaioken
|
|
But that would make it less accurate if you delete atoms or make new ones :P. Of course, you could cut out looping through all static objects (that should never be deleted) and using those to build the background. Assuming that he has them, at least.
|
In response to Jeff8500
|
|
Jeff8500 wrote:
But that would make it less accurate if you delete atoms or make new ones :P. You probably don't need the map produced to be updated to the current state of the world all the time (it's also more realistic ;D) and also don't have significant changes to it through runtime to makr an update worthwhile(?). Though if you do because you have a building game or something, it's not too much of a problem, either; you'd update the cache periodically, every once in a while. It won't be realtime, but it doesn't really need to be, right. You could have it run as a background proc updating the cache every half an hour - or as often as 5 minutes if you wanted, if the map can be changed quickly in your game (or, whatever). |
In response to Kaioken
|
|
Thats what I was thinking of doing was making the image and storing and and just displaying it and then adding a general marker as to where they are. But again Im not sure as to how to do that
|
In response to Kaioken
|
|
My map isnt changing at all so i wouldnt need to update it but how would i create the map in the first place and store it.
|
Make a variable for their body, which will remain null until they die. Then, when they die, the body variable is set to their body object. From there, arrows pop up around them pointing to where the body is. I recommend get dir, or, if you want to have it point exactly where it is, Nadrew's get_true_dir() proc. Keep in mind icon_states's alone won't work with the latter; you need to keep using the turn proc, or use the fcopy_rsc() proc and store the icons somehow.
Second I want to have a map button that shows an picture of the entire map with a marker as to where they are on the map. Ive look at the demos and all seem to take a lot of cpu to use.
Pretty sure the CPU thing is unavoidable. You can remove useless loops, etc. but you will have to keep looping to get an accurate display.