Maidens of the Kaleidoscope

~Hakurei Shrine~ => Rika and Nitori's Garage Experiments => Topic started by: Nickster206 on April 16, 2020, 07:26:07 PM

Title: Making Marisa's Lasers
Post by: Nickster206 on April 16, 2020, 07:26:07 PM
Hi all,

I'm about 2 weeks into learning and experimenting with Danmakufu. I've been testing out some of my own patterns and I understand how enemy lasers work, but I noticed there isn't a default player laser shot, only CreatePlayerShotA1. As a result, I have been having trouble understanding how other scripts make use of player-fired lasers, even after examining their code. I would really appreciate some help with this.
Title: Re: Making Marisa's Lasers
Post by: Python on April 18, 2020, 10:22:37 PM
CreatePlayerShotA1 isn't the only way to make player shot objects. As a rule of thumb, calling any shot creation function inside a player script will automatically mark that object as a player shot object. This includes CreateShotA1, A2, B1, B2, but also CreateLooseLaserA1, StraightLaserA1 and CurveLaserA1.

However, in order for them to do anything, you need to assign damage to them. Save the object ID in a variable and then use ObjShot_SetDamage and (if necessary, ObjShot_SetPenetration) on your object like so:

Code: [Select]
let obj = CreateLooseLaserA1(params);
ObjShot_SetDamage(obj, dmg);
ObjShot_SetPenetration(obj, pen);

I believe lasers have infinite penetration by default, but don't take my word for it. Experiment yourself. I hope I could be of use to you.  :)
Title: Re: Making Marisa's Lasers
Post by: Nickster206 on April 19, 2020, 01:29:07 AM
Thank you very much!  :D
I managed to get it working now (https://www.youtube.com/watch?v=s6tpa7cAPGI (https://www.youtube.com/watch?v=s6tpa7cAPGI)).

However, I now have an unrelated follow-up question. I've changed Danmakufu's default resolution to 1440x1080. However, the menu that opens up when I first launch the .exe and the menu that appears when you select an option (single, plural, etc...) only accept background images of size 640x480. How do I fix this to accept images of larger resolutions?
Title: Re: Making Marisa's Lasers
Post by: Python on May 16, 2020, 01:27:43 AM
If that's the case then I think DNH's main menu may be hardcoded in that regard. You can't change it. Though that shouldn't be thaaaaat big of a deal since it's just a way to navigate to your different scripts to run them, there shouldn't be any need to necessarily change the background, especially since you absolutely cannot change the menu itself. So if you want a custom main menu for your script, Package scripts are the way to go.