![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | mattkw80 |
I’m trying to make a simple 2D Rimworld type game.
I can click on NPC’s and a window pops up. (Where the NPC info will show).
I’ve been struggling for months now - I cannot figure out how to get the NPC’s stats to show up in the window.
Can anyone give me an overview as to how they would approach this?
I can click on NPC’s and a window pops up.
Which node-type are you using for the window?
njamster | 2020-03-19 15:40
I’m so sorry I have not answered - I will get back to you on this and appreciate your taking the time to ask me. I’ll get better details and comment back asap - I really want to get this resolved as it’s holding up my ‘Godot’ learning and has been for months.
mattkw80 | 2020-03-21 14:51
To try to explain…
When an NPC is clicked, a rectangle pops up on the screen,
and has as many Richtext labels as needed
- this is where I want list all the stats of the NPC.
The rectangle lives in a node called HUD…
HUD / Area2D / ColorRect / RichTextLabel.
I guess the question regardless of controls used…
once I’ve clicked the NPC… how do I go about
populating all the little RichTextLabels with the stats?
It’s hard to even explain what I’m trying to do here, sorry.
mattkw80 | 2020-03-21 15:44
So your problem is about assigning text to a RichTextLabel from a script?
njamster | 2020-03-21 16:04
No I’m good making controls do things.
It’s a matter of… I’ve click my NPC object… the rectangle (NPC information form) pops up, and not I want to populate it with all the NPC data, of the NPC that was clicked.
Im not sure I how reference the actually NPC. Let’s call him Bob. I click on Bob, the form comes up, I’m missing a probably very simple concept where the NPC information form doesn’t know I clicked on Bob so doesn’t know which NPC to pull values from.
Another way I might be able to tackle this - is if I could find a Godot example where someone else is already doing something similar.
mattkw80 | 2020-03-21 16:46