Jump to content


Photo

Battle List


  • Please log in to reply
3 replies to this topic

#1 ohaithar

ohaithar

    GMC Member

  • New Member
  • 150 posts
  • Version:GM8

Posted 22 March 2012 - 07:06 PM

How do i create a battle list with monsters? Let's say i am running around and i see a monster, then his picture and hp appears on my battle list. Then i could start attacking him by clicking on his name in "battle list".

Here is how it would look like :

Posted Image

Edited by ohaithar, 22 March 2012 - 07:07 PM.

  • 0

#2 blopit

blopit

    KING OF EVERYTHING

  • GMC Member
  • 784 posts
  • Version:GM8.1

Posted 22 March 2012 - 08:52 PM

The easiest way to do this would be using object list generating collision scripts.
Found on one of the best sites in the world!

The first 8 scripts in the link check in a defined geometric region and return a ds_list of all objects of the certain object type in that geometric region. Of course you could alter the script so that is puts the data in an array instead, BUT this will create more obstacles for you to overcome in the future.

SO the best this to do first is to make sure that all monsters are 'children' of a parent monster object.

Ok now you need to use one of the scripts (depending on how you want your view set up) to create a ds_list with all monster ids in that region.
Since you probably want to update every second or so you should destroy the previously generated list before you make the new one.

You should start a loop for the number of items in the list
Now that you have a list all you need to do is use the ds_list_find_value() function to find their ids and thus you can retrieve all info from their ids. Such as health, monster type (object_index), name
You can display these now and also set a cap on how many you want to display if you want.

Sorry I couldn't make you some actual code for you to use but I hope that you can follow this.

Edited by blopit, 22 March 2012 - 08:54 PM.

  • 0

#3 DZiW

DZiW

    GMC Member

  • GMC Member
  • 727 posts

Posted 22 March 2012 - 09:26 PM

Actually, as far as there's a physical limit of list size at the screen I would consider using arrays or even a string.

It's quite easy to update entering monsters lists, but it really depends how you handle fleeing monsters.

Yet the best options is clicking at the monster, not it's list icon IMO.
  • 0

#4 ohaithar

ohaithar

    GMC Member

  • New Member
  • 150 posts
  • Version:GM8

Posted 22 March 2012 - 09:52 PM

Actually, as far as there's a physical limit of list size at the screen I would consider using arrays or even a string.

It's quite easy to update entering monsters lists, but it really depends how you handle fleeing monsters.

How would you do that?

Yet the best options is clicking at the monster, not it's list icon IMO.


I want both options, clicking on a monster and selecting it from a list. Currently i have just left mbutton attack(need to keep clicking to deal dmg every 2 sec).


Can you explain it a little bit more? can't really understand what to do..

Edited by ohaithar, 22 March 2012 - 10:14 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users