Pass data to overlay scene?

I have a weapon system,

it consists of,

1.“flag” that adds a value to a list, if the value does not exist, and adds the ammo from the weapon

2.the weapon-Named the same as the value on the list, it’s added by the weapon manager, reloaded etc.

3->(issue)Now I would also like to add a “Card” to the scene for each weapon, that will be both displayed on a backpack (3rd person) as well as in a hud overlay,

how would I pass this model to the other scene? render to texture or?

Usually it’s necessary to make additional icons for UI and inventory display. You can manually move duplicates of objects to another scene and rename or modify them, but it’s easy to forget which ones have been done, or get the names wrong or whatever.

Have you thought about storing the models in a separate blend and importing them to both scenes with libload or libnew? Then all the objects will be there automatically.

Make everything in the overlay scene invisible when you don’t need it and visible when you do.And use message actuator to send a message to a empty on the overlay scene.The empty has a message sensor on it.That is the easy part.

For future simplicity, I guess I can drop the “pick up item” and weapon in the main scene and drop icons in the overlay this also lets me use the same value as the corresponding gun as the name of the icon,

like PickUp_gun_1 Gun_1 and the overlay icon can also be named Gun_1

this way I can use the value stored in the weaponlist to recall the icon and weapon…

You can edit strings to use for getting objects and meshes too.

for example:

leg = str(own['leg'])
arm = str(own['arm'])

body = "chipmunk"
head = "alligator"

object_string = leg + "_" + arm + "_" + body + "_" + head  + "_15"

object_string += "_object_for _adding"

scene.addObject(object_string,own,120)

You can also use indexes


alphabet = "abcdefghijklmnopqrstuvwxyz"

print (alphabet[0])

==> "a"

There’s lots of tutorials around for manipulating strings in python, you can really do a lot with them than I’m suggesting here. :slight_smile: