Author Topic: Tag options for objects  (Read 2088 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Tag options for objects
« on: April 15, 2020, 02:13:21 PM »
I want tags for all kind of objects, these will allow to check for these in command blocks etc.

Each enemy, item, projectile etc will have a little textbox which can be filled up with tags like this:
Code: [Select]
blaarg jumpingEnemy killedByDeadRays

Then we can have a command block that checks for example, for enemies and inside this code
Code: [Select]
if tag = jumpingEnemy
{
//Do things
}
This will execute the code if the specified enemy has the tag "jumpingEnemy", the tags are divided by spaces. This will be useful to pack enemies, items, characters, projectiles etc. into stuff that then can be checked for other things. Like, killedByRays means that the enemy can be killed by rays in the level (for example), so each ray we can check for this tag to kill them.

EDIT - MORE:
Also will be cool to have commands for tags also, so you can execute stuff over these objects with tags.
I'm making a game and I have two good examples on how I would use this thing.

There is an item called ice rain that converts all enemies into glitter balls, that explode with shrapnels upon contact. To make this, I should use a timeline that changes command by command each enemy into that ball, only those that are convertible, because there are some that I don't want to. But if I add a tag to all them like: "glitterable". We could do this
Code: [Select]
tag glitterable = enemy 11
//Enemy 11 is the glitter ball

Another example would be a menu with levels, that when you change the page all items that are buttons to go to the levels will be removed and the new items will be added.
But doing a timeline that removes all the possible items, or one that removes depending on the page you were is not much work and laggy?
A solution would be adding a tag called "levelMenuItems" to all them and using it to remove all them.
Code: [Select]
remove tag levelMenuItems

With this we achieve 2 main things:
- If planned correctly, we save a lot of time because you don't need to put each item id with the commands, or each enemy id or whatever.
- As PB doesn't need to read a lot of commands, we increase performance and the game is a lot better.
I forgot a third thing, lol

This would be a great addition to this:
https://theplatformbuilder.com/forums/index.php?topic=1281.0
« Last Edit: April 25, 2020, 04:17:15 PM by Antikore »
Sorry because my English is not very good because I'm Spanish ;) :P

War

  • "The top player is here!"
  • Level 20: Nobom
  • *
  • Posts: 1490
    • View Profile
    • My website
Re: Tag options for objects
« Reply #1 on: April 15, 2020, 03:10:13 PM »
I think we already suggested something like this
Hey, wassup wassup? My name is Warrior555MainsGanon (but just call me War) and I'm the main guy behind Megaman Zero Online and the upcoming Matt's Adventure! I don't speak often here but I'm a very friendly lad so if you wanna talk, don't hesitate!

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tag options for objects
« Reply #2 on: April 15, 2020, 03:12:42 PM »
Hmn, still
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Tag options for objects
« Reply #3 on: April 15, 2020, 03:15:36 PM »
Okay, let me get this straight. We place an enemy in the view, and we can put a tag on it? Then in commands, we can check for enemies with that tag? And we can also give nearest enemy/spawned enemies tags from commands!? If you ask me, that is very cool, and needs to be added. That way we can have more control over what enemies we want to manipulate!

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tag options for objects
« Reply #4 on: April 16, 2020, 08:58:09 AM »
Okay, let me get this straight. We place an enemy in the view, and we can put a tag on it? Then in commands, we can check for enemies with that tag? And we can also give nearest enemy/spawned enemies tags from commands!? If you ask me, that is very cool, and needs to be added. That way we can have more control over what enemies we want to manipulate!
You set the tags on the setup, enemy/item/projectile setup.

Like a way to group enemies in categories.
« Last Edit: April 16, 2020, 08:58:41 AM by Antikore »
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Tag options for objects
« Reply #5 on: April 16, 2020, 04:01:19 PM »
Well, in setup too, but in commands, it'd be nice to do that to have extra control.

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tag options for objects
« Reply #6 on: April 16, 2020, 05:25:08 PM »
Well, in setup too, but in commands, it'd be nice to do that to have extra control.
True
Sorry because my English is not very good because I'm Spanish ;) :P

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tag options for objects
« Reply #7 on: April 25, 2020, 04:18:37 PM »
Bump, added more examples. TingThing really you should take in account this!!!
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Tag options for objects
« Reply #8 on: April 25, 2020, 04:19:26 PM »
It'd really help...A LOT.

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tag options for objects
« Reply #9 on: May 03, 2020, 05:06:59 PM »
I'm needing this system soon.
Sorry because my English is not very good because I'm Spanish ;) :P