Platform Builder Forums

Main => Suggestions => Topic started by: Antikore on April 15, 2020, 02:13:21 PM

Title: Tag options for objects
Post by: Antikore 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
Title: Re: Tag options for objects
Post by: War on April 15, 2020, 03:10:13 PM
I think we already suggested something like this
Title: Re: Tag options for objects
Post by: Antikore on April 15, 2020, 03:12:42 PM
Hmn, still
Title: Re: Tag options for objects
Post by: CGM 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!
Title: Re: Tag options for objects
Post by: Antikore 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.
Title: Re: Tag options for objects
Post by: CGM 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.
Title: Re: Tag options for objects
Post by: Antikore 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
Title: Re: Tag options for objects
Post by: Antikore on April 25, 2020, 04:18:37 PM
Bump, added more examples. TingThing really you should take in account this!!!
Title: Re: Tag options for objects
Post by: CGM on April 25, 2020, 04:19:26 PM
It'd really help...A LOT.
Title: Re: Tag options for objects
Post by: Antikore on May 03, 2020, 05:06:59 PM
I'm needing this system soon.