Well i downloaded yesterday before i went to sleep the shot_replace thingy, now i just need to know how to use it, as in, 1 - the readme file says which codes for which bullets, but then im not that good at recognizing some of them with their image to say "ah, this bullet is with this variable", some pic -> code would be nice. 2 - if i use that, can i add the anchor to that file and use it?, as for the size thingy, i just cut it from the rip from UFO sprites, considering is kinda small yeah i would need to increase it's size on MS_Paint (unless it allows me to scale it to a bigger size). 3 - if i were to use the shot_replace thingy wouldnt that mean that only people with the shot_replace would be able to use the script?, and if so, how can i edit it so that i can just include it in my script.
1 - Trial and error is one way. Another is opening shot_All.dnh and shot_replace.dnh in Notepad/whatever code editor you use and opening shot_all.png in MSPaint/whatever graphics editor you use. Now, whenever you move your mouse in Paint, in the lower left corner there should be two numbers that represent the coordinates of the mouse in the picture. Find the numerical ID of the bullet referenced from shot_replace.dnh, locate the bullet with that ID in shot_All.dnh and look at the rect of that bullet. The first two coordinates define the upper-left corner of the bullet in the shot_all.png file you opened with MSPaint, so you can just go locate the corner and see which bullet is down-right from that point. Do note, though, that if the render type of the bullet is not ALPHA, it will look different in Danmakufu than in MSPaint.
However, as I initially said, trial and error is probably the best way. Try out different bullet types and you'll see what they look like.
2 - Technically, it's possible (I'm not knowledged enough of the copyright and general policy issues regarding that, so you should probably ask someone else. I'm just assuming editing the file is O.K. as long as you're not trying to claim the whole file is your work). Just insert the anchor into shot_all.png through whichever graphics editing program you're using (editing it in MSPaint is probably stupid, though, since unless it's been changed lately that program can't handle transparencies, but there are myriads of free graphics editors on the internet that do support transparency so finding one shouldn't be an issue) and change one of the shotdata blocks in shot_All.dnh into the required information for the anchor (adding one won't probably work since Danmakufu has a upper limit on the amount of bullets in shotdata files, but you can just remove one you most probably aren't using). Of course, that brings me into...
3 - If you are, in fact, going to modify the file, you probably have to distribute it alongside your code, too. You can do this by for example coyping the SHOT_REPLACE -folder to your script folder (I recommend doing this before editing the files, so that you still have the original) and just replace the include function command specified in the readme with:
#include_function ".\SHOT_REPLACE\shot_replace.dnh"
Then just call shotinit; in the initialization part of the code and it should work. Do note, though, that if you're not modifying the script, you're probably okay with only referencing that the shot replace script is required in whatever topic you're posting your cards in, since most of the people here on the forums have downloaded it.
Edit 3: If i want to make a Point system do i have to add the task on every script, or only the stage script
Edit 4: If i want to change the BGM in mid of a fight, (a.k.a like Mystia on IN with dialogue included) i should delete the previous BGM before i Play the new one right?, assuming im using the song from the 1st dialogue, to delete it from memory in let's say 6 spellcards later, would it delete it even if the spellcard didnt load it on initialize? im kinda confused about that
Edit 5: Ehh it would be nice if someone could tell me the exact script for reflecting bullets for the X vertices and for the Y vertices (for each) so i can have an overall use of it whenever i need to make reflecting stuff.
E3 - Depends entirely on the point system and it's complexity. Generally, if you use enough Common Data variables, you'll do well enough with just adding the processing system to the stage and adding any custom point items you've made on scripts that drop them (perhaps by importing a function from a general script).
E4 - Haven't had to do anything like this before, so I can't really comment on that.
E5 - There are multiple ways of doing this. The one I use (not necessarily the most simple and efficient one) is: Whenever the object hits a wall (X coordinate less than the left bound or greater than the right bound, or the same for Y), split the speed/angle combination into components (speedx = speed*cos(angle), speedy = speed*sin(angle)), and if the component is going out of the field (x < left bound and speedx < 0, or x > right bound and speedx > 0), multiply the corresponding speed by -1 (speedx = speedx*(-1)), and recalculate the angle (angle = atan2(speedy, speedx)). Here's an example code I've used in some spellcards:
task SpinShot(xpos, ypos, speed, angle, avel, aacc, minavel, bounces, graph) {
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj, xpos, ypos);
Obj_SetSpeed(obj, speed);
Obj_SetAngle(obj, angle);
ObjShot_SetGraphic(obj, graph);
ObjShot_SetDelay(obj, 0);
ObjShot_SetBombResist(obj, false);
Obj_SetAutoDelete(obj, true);
while (!Obj_BeDeleted(obj)) {
angle += avel;
avel += aacc;
if ((avel < minavel && aacc < 0) || (avel > minavel && aacc > 0)) {
avel = minavel;
}
let velx = speed*cos(angle);
let vely = speed*sin(angle);
if (Obj_GetX(obj) < 5 && velx < 0 && bounces > 0) {
velx *= -1;
bounces--;
}
if (Obj_GetX(obj) > 443 && velx > 0 && bounces > 0) {
velx *= -1;
bounces--;
}
if (Obj_GetY(obj) < 5 && vely < 0 && bounces > 0) {
vely *= -1;
bounces--;
}
if (Obj_GetY(obj) > 475 && vely > 0 && bounces > 0) {
vely *= -1;
bounces--;
}
angle = atan2(vely, velx);
Obj_SetAngle(obj, angle);
yield;
}
}
That's a task for a bouncing bullet with variable set location, speed, angle, angular velocity (avel), angular acceleration (aacc), maximum/minimum angular velocity (minavel), amount of bounces the bullet does and the graphic of the bullet. It bounces off of all 4 walls, so that should be enough for example code.
However, there's also a second, possibly slightly easier, faster and overall more efficient method than mine, that I unfortunately haven't had the will to learn for, due to it requiring a bit more memorization that this one in my opinion. If someone here could post the general formula that works only with angles, you'll probably want to use that instead.