Author Topic: ※ Danmakufu Q&A/Problem thread 3 ※  (Read 469108 times)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #450 on: January 10, 2017, 03:07:20 AM »
Nah, all that's fine. The load function is just called in the constants file (calling it in the script scope happens to be acceptable). The problem is just

#incluce"script/default_system/Extra_ShotConst.txt"
Thank you. I can't believe I never saw that fault myself. Now I've got the shot sheet working, which means that I am that much closer to finishing my work. Again, thanks for your help.

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #451 on: January 10, 2017, 03:13:02 PM »
Ah,uh
Hello there you guys :derp:
I was wondering how do I spawn bullets in a star like Sanae does
I know it requires trigonometry , but don't even know how to make this work :V

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #452 on: January 11, 2017, 09:09:50 AM »
It doesn't "require" trig, but using a bit to know where the star's points are is a good idea. Once you have that, you would just spawn lines of bullets from point A to B, which can be done with the following:

Code: [Select]
function bulletLine(x1, y1, x2, y2, n){
let dx = (x2 - x1) / (n - 1);
let dy = (y2 - y1) / (n - 1);
ascent(i in 0..n){
bullet(x1 + i*dx, y1 + i*dy); // your bullet here
}
}

The n is the number of bullets spawned. For a star with radius r (the distance from center to the points) the point at angle t is going to be (r * cos(t), r * sin(t)). Then you want to draw lines between each point and the point two after it (going clockwise). You end up with this:

Code: [Select]
function star(x, y, r, n){
ascent(i in 0..5){
let x1 = x + r * cos(i * 360/5);
let y1 = y + r * sin(i * 360/5);
let x2 = x + r * cos((i+2) * 360/5);
let y2 = y + r * sin((i+2) * 360/5);
bulletLine(x1, y1, x2, y2, n);
}
}
« Last Edit: January 11, 2017, 09:11:32 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

BobTheTanuki

  • Ph3?
  • What is it?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #453 on: January 12, 2017, 12:07:29 PM »
It doesn't "require" trig, but using a bit to know where the star's points are is a good idea. Once you have that, you would just spawn lines of bullets from point A to B, which can be done with the following:

Code: [Select]
function bulletLine(x1, y1, x2, y2, n){
let dx = (x2 - x1) / (n - 1);
let dy = (y2 - y1) / (n - 1);
ascent(i in 0..n){
bullet(x1 + i*dx, y1 + i*dy); // your bullet here
}
}

The n is the number of bullets spawned. For a star with radius r (the distance from center to the points) the point at angle t is going to be (r * cos(t), r * sin(t)). Then you want to draw lines between each point and the point two after it (going clockwise). You end up with this:

Code: [Select]
function star(x, y, r, n){
ascent(i in 0..5){
let x1 = x + r * cos(i * 360/5);
let y1 = y + r * sin(i * 360/5);
let x2 = x + r * cos((i+2) * 360/5);
let y2 = y + r * sin((i+2) * 360/5);
bulletLine(x1, y1, x2, y2, n);
}
}

Ah,I see,I see
I tried to do that without trig but it was hard xd
Okies,Thanks a lot for that :3

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #454 on: January 12, 2017, 06:55:21 PM »
I wanted to know if it is possible to have a texture or png work as a clipping mask like you would have in image editing software? what I'm looking to do is have part of the background be see through and open up to a separately scrolling layer however I also have a pattern on top that covers the blank space I am looking to make, any suggestions?

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #455 on: January 13, 2017, 09:59:50 PM »
Question about writing functions: Can I influence a local variable of an object I have define like in most Object Orientated languages?

Example:
Code: [Select]
function someFunction(number) {
    let obj = CreateObj(etc...
    let value = number;

    <drawing stuff>

    return obj;
}

let someObject = someFunction(1);

// Somewhere I want to retrieve that value and modify it.

Was there a way to retrieve that local variable and set/modify it? Or do I have to work with Obj_Set/GetValues ?

The object for me problem in question is a ObjPrim_Create(OBJ_SPRITE_LIST_2D)
« Last Edit: January 13, 2017, 10:01:42 PM by Helepolis »

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #456 on: January 14, 2017, 06:19:19 AM »
That specific pattern would be possible if functions were first-class citizens in the language (i.e. functions can be put in variables, used as arguments, etc), as it would let you create lexical closures. But you can't do that so no.

Object values are more or less what you want.

I wanted to know if it is possible to have a texture or png work as a clipping mask like you would have in image editing software? what I'm looking to do is have part of the background be see through and open up to a separately scrolling layer however I also have a pattern on top that covers the blank space I am looking to make, any suggestions?
You can, but it requires the use of shaders. Fortunately alpha masks are one of the official samples you already have (SamplePS02) and it should work with minimal tweaking, but in order to have the scrolling behaviour you want you will need to do significantly more work, either by doing some extra shader programming or by using render targets and using the resulting texture as the mask.
« Last Edit: January 14, 2017, 11:59:11 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #457 on: January 14, 2017, 07:59:10 AM »
If that is the case then I'll apply plain code duplication for now. Ugly as hell until I find time/effort to refactor.

Trung0246

  • Gaming, coding, drawing, composing, ... for fun
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #458 on: January 14, 2017, 09:55:32 PM »
Dump question, but can I do these thing?

Code: [Select]
function returnArray(one, two, three) {
    return [one, two, three]; //Return array of value with same type or different type?
}
function returnObj() {
    let data = //Somehow create an object that store value?
    /*
    Like this? (C++, C#, ...)
   
    struct {
        int testOne;
        bool testTwo;
    };
    */
    return data; //And return it?
}

And if it were like this

Code: [Select]
function wait(time) { //Basic yield
    loop (time) {
        yield;
    }
}

//Wait inside another function
function test() {
    wait(45);
}

//Calling test
test(); //What is the behavior now? Pause the script file for 45 frame or what else?
« Last Edit: January 14, 2017, 10:58:16 PM by Trung0246 »
My workbench & codedump
Gallery & album (WIP)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #459 on: January 14, 2017, 10:49:15 PM »
Dump question, but can I do these thing?

Code: [Select]
function returnArray(one, two, three) {
    return [one, two, three]; //Return array of value with same type or different type?
}
function returnObj() {
    let data = //Somehow create an object that store value?
    /*
    Like this? (C++, C#, ...)
   
    struct {
        int testOne;
        bool testTwo;
    };
    */
    return data; //And return it?
}

Neither of them are possible. For the latter, you will have to assign object values to another type of object.

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #460 on: January 15, 2017, 02:10:48 AM »
That use of looping yields would work as you imagine. It's important that both of those are functions and not tasks, as otherwise you'd just be yielding in a new separate thread that would do nothing.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Trung0246

  • Gaming, coding, drawing, composing, ... for fun
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #461 on: January 15, 2017, 05:03:54 AM »
Neither of them are possible. For the latter, you will have to assign object values to another type of object.

Tutorial on things that you said? Need to read more on it.

And after a look on wiki, I saw CommonData, is that the same as struct, or different, but same, but different, or Obj_SetValue and Obj_GetValue?

Also, I wonder what the data type of Obj ID? String or what?
« Last Edit: January 15, 2017, 05:05:53 AM by Trung0246 »
My workbench & codedump
Gallery & album (WIP)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #462 on: January 15, 2017, 05:24:24 AM »
Tutorial on things that you said? Need to read more on it.

And after a look on wiki, I saw CommonData, is that the same as struct, or different, but same, but different, or Obj_SetValue and Obj_GetValue?

Also, I wonder what the data type of Obj ID? String or what?

CommonData is equivalent to global variables shared across all scripts (there are also standard global variables but their scope is limited to within a script and included files). Obj_SetValue and Obj_GetValue are used to store custom fields in objects.

The data of object IDs are integers, I think. Usually you refer to the variable referring to an object and pass that in as a parameter.

Trung0246

  • Gaming, coding, drawing, composing, ... for fun
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #463 on: January 15, 2017, 07:57:39 AM »
Obj_SetValue and Obj_GetValue are used to store custom fields in objects.

Hm.. so that is the only way... maybe I have to create fake bullet just for storing data (no drawing, invisible, no hitbox...)

Or I should just use CommonData like SetCommonData(Obj{private scope name goes here}_{key name}, value)

MKM should add Obj_Create() to create new plain object like struct just like in many major programming language :\

And btw what the hell is Primitive Object?

The data of object IDs are integers, I think. Usually you refer to the variable referring to an object and pass that in as a parameter.

Have to test on this... You should include these in your tutorial for god sake :p

Btw do you or anyone else have the list of all constant in PH3?

And what are the different between remainder and modc? (I know how to use %) Wiki didn't explain clearly to me much...
« Last Edit: January 15, 2017, 08:08:17 AM by Trung0246 »
My workbench & codedump
Gallery & album (WIP)

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #464 on: January 15, 2017, 11:49:00 AM »
If you're familiar with hash tables (or map data structures in general) already, Common Data areas are essentially hash tables taking strings as input, that are accessible throughout all running scripts.
SetCommonData(key, value) will map the string key to arbitrary value, and GetCommonData(key) pulls from the table. Using those functions uses the default Common Data area, which has the id "" (empty string). You can create more Areas for more tables; essentially there is just one overarching structure that is ultimately a hash table (that takes the area id string as key) of hash tables (the common data areas).

Each "object" also has its own table, which is what you access using Obj_SetValue / GetValue. But unlike Common Data which is engine-global, object values require the object IDs to access. Object IDs are indeed just integers.
Do not use Common Data to store individual object data; this is very bad practice due to their global nature.

I definitely agree there should be an empty object, but there isn't, so yes one thing to do would be to create a dummy Shot or Enemy object. Stuff like this is totally valid and doesn't seem to cause unwanted issues:
Code: [Select]
let bla = ObjShot_Create(OBJ_SHOT);
Obj_SetValue(bla, "_name", "ghost");
Obj_SetValue(bla, "_hp", 8);
Obj_SetValue(bla, "_attack", 2);
Obj_SetValue(bla, "_pos", [0,0]);

Primitive objects are most drawable objects that use texture and vertex information to be drawn. Sprites are Primitive objects with four vertices placed in a rectangle, but any number of vertices can be placed wherever. Its called Primitive because that's what they're called in graphics. If you want to make complex graphics with many vertices, you use the primitive object functions.

There are a lot of predefined variables. I could list most of them but I don't know why you'd need a list of them in the first place; the documentation will list them when necessary.

remainder(a, b) is an alias for a % b . modc(a, b) is the same but retains the C-like behaviour of preserving sign. So -3 % 5 = 2 but modc(-3, 5) = -3.
« Last Edit: January 15, 2017, 11:55:47 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Trung0246

  • Gaming, coding, drawing, composing, ... for fun
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #465 on: January 16, 2017, 02:34:30 AM »
There are a lot of predefined variables. I could list most of them but I don't know why you'd need a list of them in the first place; the documentation will list them when necessary.

I need those because I'm currently making a complier for danmakufu (not sure when It will done) on the web so if you can list those I really appreciated :)

Also include variable that scripter can't modify like GetCurrentScriptDirectory?
« Last Edit: January 16, 2017, 04:23:12 AM by Trung0246 »
My workbench & codedump
Gallery & album (WIP)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #466 on: January 16, 2017, 03:12:27 PM »
I need those because I'm currently making a complier for danmakufu (not sure when It will done) on the web so if you can list those I really appreciated :)

Also include variable that scripter can't modify like GetCurrentScriptDirectory?

Reserved Keywords: https://sparen.github.io/ph3tutorials/ph3u1l5.html#sub9
Functions: http://dmf.shrinemaiden.org/wiki/Functions_(ph3)

Trung0246

  • Gaming, coding, drawing, composing, ... for fun
« Last Edit: January 16, 2017, 04:53:13 PM by Trung0246 »
My workbench & codedump
Gallery & album (WIP)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #468 on: January 17, 2017, 09:22:25 PM »
I've been lost on the scrolling background with scrolling cutouts a while. I've looked into shaders and create render target but haven't gotten either to work, so what exactly am I missing?
http://pastebin.com/0z1ZxkX9

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #469 on: January 21, 2017, 09:47:31 AM »
Does somebody knows, if "Blender" can work like "Metasequoa" making 3D objects?

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #470 on: January 21, 2017, 03:12:33 PM »
Does somebody knows, if "Blender" can work like "Metasequoa" making 3D objects?

Blender is a 3D modeling tool, and you can export Blender projects to DNH-compatible formats.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #471 on: January 21, 2017, 07:14:52 PM »
Blender is a 3D modeling tool, and you can export Blender projects to DNH-compatible formats.

Hooray! But how can I do it? I tried each format, but it didn't work: .3ds .abc .blend .dae .fbx .mtl .obj .ply .stl .x3d
At first I have always done it with Metasequoa. With .mqo formats.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #472 on: January 21, 2017, 09:21:46 PM »
Hooray! But how can I do it? I tried each format, but it didn't work: .3ds .abc .blend .dae .fbx .mtl .obj .ply .stl .x3d
At first I have always done it with Metasequoa. With .mqo formats.

There's a plugin for .mqo export somewhere.
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #473 on: January 22, 2017, 12:07:12 AM »
More newbie questions from me. Does ph3 have a function for creating armour for a boss? That is, cut the incoming damage a boss takes from shots by a set number? As I understand it, you can use ObjEnemy_SetDamageRate to set a percentage of damage taken from bombs and bullets. But it's not percentage I'm looking for. I want a flat rate, so that an attack with few but high-powered hits will be more effective than an attack with many low-powered hits.

Second. Is there a way to link a boss HP to the stats of their familiars? That is, the boss herself is immune to all damage, but as you destroy familiars, the boss takes damage until she reaches 0 HP. I suppose it's possible through the use of ObjEnemy_AddLife, but will that work on a survival spell? And if so, is it possible to change the upcoming spellcard depending on if the spellcard was beaten by timeout or by defeating familiars?

Thanks in advance.
« Last Edit: January 22, 2017, 12:12:24 AM by Skilvrel »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #474 on: January 22, 2017, 12:30:02 AM »
Hi again! So realising alot of my issues are mainly on the scoring mechanic of my script, I wanna ask two thing. (If that is not a problem)

One question is that I am trying to render how many points (2,000,000) are needed until something happens. But, I can't seem to get it to go back to 2,000,000 again. Here is the code: http://pastebin.com/5ybgYYuy

Also, you know how when a spell is cleared or bombed, all the bullets turn into items and increase point item value right? Well, I have the point value system in my script but I don't know how to let bullet-turned-items increase it. I have seem people use custom items to replace the ones in danmakufu, which I tried myself and ended up failing due to my lack of knowledge on creating custom items. Nevermind, turns out that it was because I have not used "StartItemScript" thought Default_System
« Last Edit: January 22, 2017, 02:38:48 PM by lolpudding »

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #475 on: January 22, 2017, 09:26:21 AM »
I've been lost on the scrolling background with scrolling cutouts a while. I've looked into shaders and create render target but haven't gotten either to work, so what exactly am I missing?
It's complicated. If you wanted to use pure shaders, you'd have to write a shader technique that uses a variable to set the position of the texture before it's applied. But that may or may not be more difficult than an alternative.

Because the shaders work on textures and not on what's drawn on screen already, but you want it to scroll, I was suggesting to draw the subtracting texture to a particular position on a render target, and then use that resulting texture with the shader as-is. Implementing either of these options kind of stinks though. I've made it easy for you by spending the time to do it myself.

https://gist.github.com/drakeirving/6694f73f5cb5cdb981a09e310e798250

Code: [Select]
/*----------------
Mask object, for applying alpha masks to specific drawing layers.
Is a 2D Sprite object and requires manual setup of texture and rects.
Applies mask on layers from `layer_min` to `layer_max`.
-----------------*/
function ObjMask_Create(layer_min, layer_max){
let objMask = ObjPrim_Create(OBJ_SPRITE_2D);

// set up render target
CreateRenderTarget("tex_mask");

// set up shader
let mask = ObjShader_Create();
ObjShader_SetShaderF(mask, GetCurrentScriptDirectory() ~ "SamplePS02_HLSL.txt");
ObjShader_SetTechnique(mask, "TecMask");
ObjShader_SetTexture(mask, "textureMask_", "tex_mask");
SetShaderI(mask, layer_min, layer_max);

task run(){
while(!Obj_IsDeleted(objMask)){
// make visible when drawing to render target
ObjRender_SetAlpha(objMask, 255);
RenderToTextureB1("tex_mask", objMask, true);
// otherwise invisible
ObjRender_SetAlpha(objMask, 0);
yield;
}
Obj_Delete(mask);
RemoveTexture("tex_mask");
}
run();

return objMask;
}

Here's an example with a scrolling alpha mask. My `mask.png` texture is 256x256 but that isn't really important.

Code: [Select]
let mask = ObjMask_Create(26, 28); // applies to layers 26~28
ObjPrim_SetTexture(mask, GetCurrentScriptDirectory() ~ "mask.png");
ObjSprite2D_SetSourceRect(mask, 0, 0, 1024, 1024); // looped texture for scrolling
ObjSprite2D_SetDestCenter(mask);

let x = 0;
let y = 0;
loop{
// scroll texture
ObjRender_SetPosition(mask, x, y, 0);
x = (x + 1) % 512;
y = (y + 1) % 256;
yield;
}

Realistically speaking, if you actually had no idea what I've been talking about, you should have dropped the idea altogether. You don't need this effect to make a decent background.
« Last Edit: January 22, 2017, 09:33:15 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #476 on: January 22, 2017, 09:28:07 AM »
There's a plugin for .mqo export somewhere.

Thank you! I found this Plugin. There's one more question, is it possible to do 3D animation in ph3?

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #477 on: January 22, 2017, 09:35:16 AM »
Mesh objects have animation capabilities, as written in the documentation. I have no idea what the specifics are though so just play around with the functions and see what makes sense.


More newbie questions from me. Does ph3 have a function for creating armour for a boss? That is, cut the incoming damage a boss takes from shots by a set number? As I understand it, you can use ObjEnemy_SetDamageRate to set a percentage of damage taken from bombs and bullets. But it's not percentage I'm looking for. I want a flat rate, so that an attack with few but high-powered hits will be more effective than an attack with many low-powered hits.
This seems kind of silly conceptually. Shmups have gone forever without needing this, since it generally comes down to the fact that focused shots are balanced so they cover a narrow area but deal a lot of damage, while spread shots are balanced so they cover a wide area but deal relatively less damage, that is mitigated by having more shots hit. If the difference is instead about the low-powered shots having a high number of hits per second, then just give the "strong" shot more damage or reduce the hit rate of the other shot. Asking for an explicit balancing override seems to ignore the point, but if you really want to you can always set different damage rates based on reading which player it is with GetPlayerID.

Second. Is there a way to link a boss HP to the stats of their familiars? That is, the boss herself is immune to all damage, but as you destroy familiars, the boss takes damage until she reaches 0 HP. I suppose it's possible through the use of ObjEnemy_AddLife, but will that work on a survival spell? And if so, is it possible to change the upcoming spellcard depending on if the spellcard was beaten by timeout or by defeating familiars?
The former is definitely possible just as you think. The latter is a bit more complicated, but it basically amounts to having the single script run different tasks (with the actual contents) based on CommonData (not recommended) or setting an object value with Obj_SetValue on the boss scene object during the script before, and reading it on the relevant script.
« Last Edit: January 22, 2017, 10:04:45 AM by Drake »

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by Aiけん | ウサホリ -

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #478 on: January 22, 2017, 04:43:38 PM »
Second. Is there a way to link a boss HP to the stats of their familiars? That is, the boss herself is immune to all damage, but as you destroy familiars, the boss takes damage until she reaches 0 HP. I suppose it's possible through the use of ObjEnemy_AddLife, but will that work on a survival spell? And if so, is it possible to change the upcoming spellcard depending on if the spellcard was beaten by timeout or by defeating familiars?

Drake has already answered this but I'll add my two cents. Depending on how you implement familiars, it may be practical to add a boss hitbox on the familiars - IE place a hitbox on the familiar that sends damage to the main boss. Alternatively, if you want it to be on a death-only basis, you can, on familiar death, decrease the boss HP by a certain amount by adding negative life to the boss (as Drake stated).

AFAIK changing the upcoming spellcard depending on defeat method is an exceptionally ugly process since boss scenes are pre-loaded. You'd need CommonData at the very least, but since I've never done this myself, I can't really say.

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #479 on: January 26, 2017, 04:27:44 PM »
All this talk of familiars transferring damage to the parent boss reminded me of a question that maybe you all can help answer.

So, a long time ago I made a Yuyuko fight and wanted to implement a hitbox on her fan graphic (like in PCB) where she took reduced damage from. The way I did it (this was back in 0.12m) was to position a bunch of invisible familiar enemies on it that would transfer damage back to Yuyuko (using SetDamageRateEx). This obviously wasn't optimal and I have always wondered if a better way was possible.

With the final stage of my new game, EUB, I want to do a similar thing again for its final boss. Since ph3 doesn't even have an equivalent to SetDamageRateEx, I figured it would be even less effective to use the invisible familiar method. I thought of just using ObjEnemy_SetIntersectionCircleToShot to just position additional instances of the boss's hitbox on the graphic, but that wouldn't produce the reduced damage that I'm looking for (and that's particularly important to limit the effectiveness of spread shottypes). Any ideas?

EDIT: Just curious, does anyone have any actual insight on how precisely ZUN produced this result in PCB and other games?
« Last Edit: January 26, 2017, 04:41:54 PM by ExPorygon »