I am used to writing out my scripts. It’s the first time I am using kismet/blueprints, and it goes well, but there are still some holes. Most of the time I know what I want to do, but I just don’t know how to do it in visual scripting.
To give an example of my problem, I’ll write it out in code:
Init:
db_ButtonLights(Lightswitch01, Light01, Light02);
db_ButtonLights(Lightswitch02, Light03,_);
kb:
IF
CharacterUsedItem(_Character,_Switch)
and
db_ButtonLights(_Switch,_LightX,_LightY)
THEN
Activate(_LightX);
Activate(_LightY);
(Code is just written out quick, it’s not 100% correct, but it gives the idea)
In this instance the script recognizes which button is being pressed, and automatically checks which lights correspond with that button. I can add as many buttons and lights to the database as I want, the script will always be the same.
Right now I know how to use a button to activate a light. That is not the problem. The problem is that I am copy/pasting nodes in the level blueprint and adding the different lights to different buttons. So I have the same script repeated all over the place. I just know this can’t be the way it should be done, but I don’t know how to make that database kind of thing in blueprint.
Important to know is that the number of lights may vary, so making a class blueprint of one or more lights linked to a button doesn’t work, since the amount of lights won’t always be the same. Or can I make a class blueprint with, let’s say, 5 lights, and just delete some of the lights in the level when I don’t need all five? Would still feel like hacking the system, I guess…
Thanks in advance. If the question has already been posted, I am sorry. I did a search on the forum, on the wiki and on google, and it didn’t return anything. Maybe I’m using the wrong keywords, I don’t know.
Mod:
This is what I got right now … as you can see it’s basicly twice the same script, just with different variables. How can I combine them into one script, while still being flexible, keeping in mind the number of lights a switch toggles, may vary.