Author Topic: [Modeling] Recoloring Nodes: On Custom AI/Bots [SOLVED]  (Read 3375 times)

I'm using events to set the node color of a bot. If anyone recalls amades bot events and the "setNodeColor" stuffs.

A old topic list all default player nodes: http://forum.blockland.us/index.php?topic=201140.0

Using these events to change the color of a players head via "headSkin" works like a charm.

However, I'm making my own playertypes, and I can't figure out how to make my custom model's node recolorable.

-Issues-
Can't re-color node of custom model
Trying to hide any node just hides the whole model/player. Does this with bear bot as well.

---I've tried---
Naming groups same as default player (ie. headSkin)
Naming groups with their own custom names

Do I have to state the nodes in the code...? What am I doing wrong?

~~~Finally I figured it out.  Took ages.


« Last Edit: June 27, 2015, 12:32:04 AM by tony-0222 »

What is called a "node" inside of Blockland is a DTS object. In Blender, these are usually just simple mesh objects (using the name of them). To be recolorable, they need to have a material assigned whose texture is transparent.

they need to have a material assigned whose texture is transparent.
Does it need to be 100% trans? Time to test this out.

edit: Does the .png texture in the package need to be trans too?

re-edit: Figured it out. Still having issues though. I want multiple nodes re-colorable, not just 1. If I have multiple nodes it sets the color of all of them no matter what nodename I put in the event line :c

and it still hides all nodes no matter what node im trying to hide
« Last Edit: June 22, 2015, 05:29:10 AM by tony-0222 »

What is called a "node" inside of Blockland is a DTS object. In Blender, these are usually just simple mesh objects (using the name of them). To be recolorable, they need to have a material assigned whose texture is transparent.
Actually, the texture does not need to be transparent, it can be anything.

Does it need to be 100% trans? Time to test this out.

edit: Does the .png texture in the package need to be trans too?

re-edit: Figured it out. Still having issues though. I want multiple nodes re-colorable, not just 1. If I have multiple nodes it sets the color of all of them no matter what nodename I put in the event line :c

and it still hides all nodes no matter what node im trying to hide
Could you post your code? Also, this should kinda be in Coding Help, but meh. No point in creating a new topic. :P

Actually, the texture does not need to be transparent, it can be anything.
Could you post your code? Also, this should kinda be in Coding Help, but meh. No point in creating a new topic. :P
I figured it would be a modeling issue, but I wasn't 100% sure.

Anyways, yeah here ya go. Keep in mind I'm not a good coder, so sorry if there's any mistakes of any kind.

Actually, the texture does not need to be transparent, it can be anything.

How do you plan to recolor the texture then? It just overlays the texture on top of the solid color.

How do you plan to recolor the texture then? It just overlays the texture on top of the solid color.
I've never used a transparent texture for hands on support... Or have I... Dang it, Port, you're making me second guess myself now. XD

I've never used a transparent texture for hands on support... Or have I... Dang it, Port, you're making me second guess myself now. XD

Seemed like he was talking about recoloring, not hands on weapons :p

Seemed like he was talking about recoloring, not hands on weapons :p
Indeed. Here is my progress.

I got the recoloring to work using Event_PlayerBotPlus from Goth77's Mod Topic.
(This is how I've been doing it, it allows nodes to be re-colorable and such, a port of the old bot events code)

The event works like- [onBotSpawn -> self -> botEditAppearance -> setNodeColor -> [Nodename] [Color]

No matter what node I put in, it changes the whole bots color
 (or hides/un-hides the whole bot using hideNode/unHideNode).

I think it has to do with the node names and how it works in the Event_PlayerBotPlus.

Could someone look into this for me?

Question: why are you naming the groups and not the objects themselves?

Question: why are you naming the groups and not the objects themselves?
 

Besides the point, using Gothboy's code and having my friend help me out, I managed to get every part of the bot recolor-able besides the feet and hat for some (forgeted up) reason. Still trying to get that bit to work.


Edit: Done, figured it out.
« Last Edit: June 27, 2015, 12:32:31 AM by tony-0222 »


ShroomLFoot and ShroomRFoot Nodes weren't accepted by blockland for some reason. After I re-named them, they were color-able. I forgot to list the hat in the nodes list in the code.

So after fixing my nodenames (which didn't work for some reason), and fixing the names in the event code, it worked.

Special thanks to Eagle517 for coding help