Author Topic: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (locked)  (Read 183365 times)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #990 on: February 19, 2014, 02:48:10 PM »
So I'm at a stage in DEC where I feel like I want it to be a decent game. So... I need a scoring system, and ph3 doesn't have a default (as far as I know).

So I need to use AddScore. In many places.

Point items and spell card bonuses work (thanks to point items being self-explanatory and thanks to Talos). I can probably implement graze by putting AddScore in the player script's EVent. But how would I go about adding score for hitting enemies? Would it be as simple as adding score when a player shot hits an enemy, or would it involve some script info being placed in a system file or the like?

Thanks.

EDIT: I got it to work. Balancing is a different issue.
« Last Edit: February 19, 2014, 03:10:32 PM by Sparen »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #991 on: March 01, 2014, 05:38:28 PM »
Danmakufu [.1 pre3] has been released. Scripts by TalosMistake and other scripters that #included an empty file should now work. Curvy laser tips can be set to not be transparent using ObjCrLaser_SetTipDecrement. It is now possible to test if an object is visible. You can now set intersection lines for shots and can get the total height/width of a text object. You can also set Hue, Saturation, and Value for a render object.

(The download has some problems. However, it has been reported).

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #992 on: March 02, 2014, 08:17:25 AM »
Why would you include an empty file anyway in the first place? :V

This seems like a good release, also for sound effect lovers, Drake's sound-pan script was actually also realised by mkm's own method it seems.

Though wondering why mkm hasn't done anything yet regarding the multiple-times calling of wav files (so they dont replay).

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #993 on: March 02, 2014, 01:30:13 PM »
This seems like a good release, also for sound effect lovers, Drake's sound-pan script was actually also realised by mkm's own method it seems.

Actually it was a last minute request made by gt and me. lol I made requests for fixing the alpha on the tips of lasers, ObjIsVisible, and GetVertexPosition. I guess he might've forgotten about that SetPlayerState function I had asked for, which is ok. There were other stuff I wanted but it would not be possible without rewriting the engine again.(multi-threading, Antialias)

Anyway, the download link was fixed last night so enjoy the update everyone.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #994 on: March 03, 2014, 07:48:28 PM »
I have a question regarding the boss animation it self which I am somewhat struggling in ph3. It is about the floating gently up/down (comparable to the pulsing red circle).

Now getting the floaty animation going isn't the issue, the problem is that both ObjRender_SetPos and ObjMove_SetPos alter the actual position of the object. Or in other words, when you spawn a bullet contineously, you will see the starting point of the bullet being offset by the boss' position at that time.

I am thinking of spawning 2 objects where one is the 'enemy' type and the other one a sprite. The enemy will be invisible but be the actual position and the sprite being the floaty animation. Except this is all extremely iffy and work-aroundish so perhaps someone has a better idea.


ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #995 on: March 03, 2014, 10:38:11 PM »
I have a question regarding the boss animation it self which I am somewhat struggling in ph3. It is about the floating gently up/down (comparable to the pulsing red circle).

Now getting the floaty animation going isn't the issue, the problem is that both ObjRender_SetPos and ObjMove_SetPos alter the actual position of the object. Or in other words, when you spawn a bullet contineously, you will see the starting point of the bullet being offset by the boss' position at that time.

I am thinking of spawning 2 objects where one is the 'enemy' type and the other one a sprite. The enemy will be invisible but be the actual position and the sprite being the floaty animation. Except this is all extremely iffy and work-aroundish so perhaps someone has a better idea.
That workaround is unnecessary. Instead of using ObjSprite2D_SetDestCenter, use ObjSprite2D_SetDestRect to move the image around the boss's coordinates without moving the boss object itself.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #996 on: March 03, 2014, 10:39:43 PM »
That's exactly what the Render object part is for though. An ObjEnemy is composed of a Move object and a 2D Sprite object, which is a Primitive and Render object. ObjRender_SetPosition() shouldn't affect the Move object of the enemy, and so it shouldn't affect the spawning position of bullets, unless you're using ObjRender_GetX/Y() when firing them for some reason. Something else is going wrong here.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #997 on: March 04, 2014, 06:55:25 AM »
Ozzy, that is exactly an alternative I attempted but got stuck with the repositioning. Drawing the sprite correctly using SetDestRect and moving it proper around with the boss, how do you intend to do that?

Drake, here below the familiar script to implement the same thing. I am altering ObjRender to move the sprite up/down but the bullets will "wave along"
Code: [Select]
task laserFam(x,y) {
let obj = ObjEnemy_Create(OBJ_ENEMY);
let laserPos = 0;
laserFrame = 0;

ObjEnemy_Regist(obj);
ObjPrim_SetTexture(obj,laserTex);
ObjRender_SetScaleXYZ(obj,scale,scale,0);
ObjSprite2D_SetSourceRect(obj,0,0,256,128);
ObjSprite2D_SetDestCenter(obj);
ObjMove_SetPosition(obj,x,y);

exploEffect(GetEnemyX-25,GetEnemyY,0.9,3);
concenEffect(obj,240,1,64,64,255);
concenEffect(obj,80,3,64,255,64);
while(!Obj_IsDeleted(obj)) {
ObjRender_SetPosition(obj,ObjMove_GetX(obj),ObjMove_GetY(obj)+laserPos,0);
laserPos += cos(laserFrame)/180;
laserFrame+=2;
CreateShotA1(ObjMove_GetX(obj),ObjMove_GetY(obj),1,180,103,5);
yield;
}
}

I am actually thinking of pointing this out to mkm-san. It doesn't makes any sense as Drake mentions. Render should be explicitly intended for sprite behaviour not for the true position.

Edit Posted on mkm-san's bbs with a sample script of Rumia and screenshot. Lets see what his opinion is about this.

Edit2:
Quote
[08:53:58] <Helepolis> Mkm: A object has only one position.
[08:53:58] <Helepolis> ObjMove_SetPosition and ObjRender_SetPosition are about the same.
[08:53:58] <Helepolis> (But ObjMove_SetPosition has better precision.)
[08:53:58] <Helepolis> When the bullets appear from another position,
[08:53:58] <Helepolis> it is necessary to manage another position independent with the boss object.
[08:54:02] * Helepolis shrugs

Not quite sure how to interpret his words, almost seems as if he is telling me to use 2 objects (like I initially mentioned).
« Last Edit: March 08, 2014, 08:54:07 AM by Helepolis »

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #998 on: March 08, 2014, 10:14:39 AM »
I interpreted his response as, essentially, "create a second object to manage the boss sprite".

But regarding the SetDestRect, suppose your boss image is 64x48. You'll want to manually set the dest rect so you can visually move the sprite, as such:

ObjSprite2D_SetDestRect(obj, -32, -24, 32, 24);

That will center it. To make it move up and down, introduce a sin variable that will add onto the y values.

Code: [Select]
let m = 0;
let mv = 0;
(loop){
    ObjSprite2D_SetDestRect(obj, -32, -24+m, 32, 24+m);
    m = sin(mv)*5;
    mv+=9;
}

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #999 on: March 08, 2014, 12:59:51 PM »
I see, your code looks similar to the one I implemented for the SetPos, except you're altering the DestRect as Ozzy mentioned before. I'll give that a go after lunch and report the results.

Edit
I totally understand it now. I was major confused with the code and the way to interpret it. I remember that Drake on IRC told me that it was ObjSprite2D_SetDestCenter(obj); being a culprit but for what reason I couldn't quite get. The way you explained -32 , 32 for the left to right coordinates immediately made me realise this is like the effect objects in 0.12m using 4 vertex to create a rectangle.

ObjSprite2D_SetDestRect(); begins at the centre of the obj where  ObjSprite2D_SetDestCenter(); positions the texture at the centre depending on the SourceRect.

Thanks for the info, now I can apply proper animation for my boss/enemies. Cheers.
« Last Edit: March 08, 2014, 01:46:49 PM by Helepolis »

Kimidori

  • Undefined Fantastic Girl, Nue
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #1000 on: March 13, 2014, 09:16:09 AM »
It seem like making a nice flight path and shaped danmaku is hard without much knowledge of Geometry and/or Trigonometry. ._.

I still haven't been able to make a flower shaped danmaku without manually placing bullet to draw them out....

Would anyone be so kind to give me a sample code of drawing a flower with math?
« Last Edit: March 13, 2014, 09:24:56 AM by Kimidori »


"No matter what, cute is justice. If you're watching shows without moe, you should really be questioning your life decisions. The creation of 2D anime girls is the pinnacle of human achievement." -Logan M

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #1001 on: March 13, 2014, 01:33:34 PM »
Please elaborate on which kind of flower you are looking for. Talos has used flowers before, and polar/parametric equations can easily generate a flower pattern.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (version .1 pre something)
« Reply #1002 on: March 13, 2014, 09:54:05 PM »
!

Yo yo, listen up.
Thread reached its limit.
You might want to visit.
The new thread rocking sock: http://www.shrinemaiden.org/forum/index.php/topic,16584.0.html
As this one gets the lock.



Old thread stays sticky for 24-48h to help people notify.