This got lengthy but I think you could shrink it to just 1 event using variables, create object by name and other methods. I’m on my phone. So, I can’t really make a mockup. I also don’t know which parts are unique to each weapon.
These changes may be difficult to apply now depending on how far along with the project you are. You may be able to implement all or just some of them. Every bit helps.
What if instead of a different variable for each beam you use a single variable for beam type or weapon type and you change just that variable. You would then need to only check that one variable.
If weaponType variable contains "beam"
Check the various keys
Put the beams into a group, if the flares are different then create a group for them as well.
Actions
Create object by name weaponType from beam group
Create object by name weaponType +"_flare" weaponType from beam flare group
(if the flare style changes)
Any action or condition based on the beam or flare would use the beam or flare group name. As long as it's the same event it sube sent it would use just the picked group objects.
Sub event
If animation equals the list of animation name
or maybe if animation contains "Left"
Then flip the object
You may need to do the same for applying force if it changes based on flip status. One for flip, one for not flipped.
If other things like force or position or even kepress changed depending on the weapon type then you could create a structure of structures with a structure of each beam with a structure of things like force or any other unique property.
Weapons.smallBeam.Force = 300
Apply force Weapons[WeaponType].Force
If the direction of the applied force chamgea based on the flip status, you may need separate subevents to apply force based on flipped status then apply the force via the structure value. For the one state you could apply force variable *-1
If they use different sound unfortunately there’s not a play sound by name. There is an extension to play by filename or you could list the different sound conditions as sub-events. At least it would still just be once.
Alternatively, you could create an extension to play the sounds by name. You pass it the weapon and it could use a bunch of events with conditions if this play this, if that play that. That would clean up the main event sheet and with the sounds in 1 place you could make tweaks on 1 place.
Ok, I get the structure, but my beams are differents and individuals sprites for exemple I have “pw_beam” and then “large_beam” So how the game will know I change from the pw_beam to the large_beam ?
Is it with the variable for exemple pw_beam is assigned to “beamA”, large_beam to “BeamB” etc… ?
Can you screenshot a couple of the other beam event groups? Maybe, instead of adding the objects individually, you could use external layouts and add it by name.
OK. I understand. I thought you meant that each beam was made of multiple objects. My mistake.
Yes, your array could use the names of the beams and you would pick the the child structure based on that name. Everything could match.
Replace BeamA with the object name and then set the variable that tracks the current beam to that name to access the speed if needed and then use the same variable to add the object(s) by name and decide which sound to play, again if that’s needed.
Edit: oh, and when I asked about the other groups, I meant event groups. I just want to compare how a couple of the different beams were added. Although, seeing the object group also helps.
It can be difficult to make suggestions based on tiny snippets. Although, the oppose is also true because too much info causes people’s eyes to glaze over.
IDKW you mean by that. If you need the separate variables then there’s no reason that you can’t use both systems either together or different parts. You can modify things to fit your needs
Your situation is a bit more difficult because it’s already written. It might take a lot of reworking. It would streamline things but it might not be easy.
Do the multiple beam types fire at the same time or does the player get the ability to fire a more complex beam based on unlocking the other beam types?
No, it’s like in metroid if you have the time to check it out,
You start with a base beam, and it upgrade when you pick up the beam’s object.
So when you get from pw_beam to plasma, you only fire plasma
I’m vaguely familiar with the game. My method is based on an activeBeam variable. If the variable is one beam it adds that beam. How you set the activeBeam is up to you. Whether it’s fixed or changeable by the user is up to you. Are you using the mixing of the different modules to create multiple different weapons?
I do use the mixing of differents one to creates individual beams, for exemple picking some upgrades without others makes a whole other beam, but leads in a way or another to the same results at the end
( for exemple picking ice_beam lead to pw_icebeam and the picking plasma leads to plasma_ice / Or you can pick plasma so it leads you to plasma_beam and then the icebeam and it will lead to the same result : plasma_ice)
I don’t know how to handle the mixing and matching. You might be able to build the name based on the values of the selected modules but IDK enough about Metroid.
That’s a bit hard to explain… but the beams combine one to each other…
Without speaking of beams, let’s speak of ingredients :
You start with a tomato in hands, and then you find a pasta, so you end up with pizza, later you find some shrooms, so you end up with a shroom pizza etc…
Hope this make it clearer haha
You would always have “FireIce” and not “IceFire” because of the way it’s added to an empty string.
It would be all the combinations. FireIce, FirePlasma, FireIcePlasma, etc…
You could check if they’re valid by checking if they’re in a structure. But I still don’t know if you can choose to have Ice or Fire or FireIce. If you you’re putting an object into a slot then also setting the matching variable.