Author Topic: Danmakufu Q&A/Problem Thread v3  (Read 213428 times)

Re: Danmakufu Q&A/Problem Thread v3
« Reply #960 on: June 13, 2010, 04:06:13 AM »
You don't control object position through XY vertices.

 :smug:



@SparklingOrange
Among the other things these fine gents have listed, script_spells use  @Initialize@MainLoop  and  @Finalize  too, dawg.

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #961 on: June 13, 2010, 04:21:38 AM »
Quote
You don't control object position through XY vertices.

Yeah, just a quick correction there; in my experience when working with objects you either have to use SetPosition or vertices, if you use both then the vertices will act really really strangely, especially if you start trying to change the angle or the speed of the object.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #962 on: June 13, 2010, 04:45:41 AM »
But for standard use you want the object to actually do stuff. I use vertex manipulation to move effects around yeah, but usually you're going to actually get it to do something. Plus it's just easier for things like this. The vertices are measured by how far apart they are from the object position, so he's still going to need to set a position.

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

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #963 on: June 13, 2010, 04:44:42 PM »
How exactly do you use render targets? can anyone give me an example?

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread v3
« Reply #964 on: June 13, 2010, 04:50:01 PM »
How exactly do you use render targets? can anyone give me an example?

Azure explained it here: http://www.shrinemaiden.org/forum/index.php?topic=4771.msg357169#msg357169

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #965 on: June 13, 2010, 09:06:39 PM »
This question could be very subjective but I'll ask it anyways. It's not really Danmakufu-related either *shot

In your opinion, or from experience, what amount of life would a boss be at before they switch from the normal getting-hit sound to the high-pitched almost-dead-getting-hit-sound?

Stuffman

  • *
  • We're having a ball!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #966 on: June 13, 2010, 09:34:56 PM »
I never noticed they were different.

Also, I would prefer no normal shot sounds at all from the player since they basically play for the whole game D:

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #967 on: June 13, 2010, 09:38:12 PM »
The normal one isn't very loud and doesn't really bother me anyways. It's when you have sounds that go BVVVV BVVVV BVVVV BVVVV every time an option firescoughcoughcough that it gets grating.

5% health sounds about right.

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

Furienify

  • Yeehaw!
  • Equestrian Fansubber
    • Youtube Channel
Re: Danmakufu Q&A/Problem Thread v3
« Reply #968 on: June 13, 2010, 09:46:51 PM »
I was going to ask something like that myself - what's the syntax for that sort of thing?

I was thinking of just running a task like I do for my timer sfx- if(SyntaxForBossGettingHit && BossHealthLessThanBlah){playsfx}. Something like that. Except I couldn't find the function that detects the boss getting hit by player bullets.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #969 on: June 13, 2010, 09:53:54 PM »
Afaik, there is none.

What I did in those situations was to create a variable called bosshp with a value of -999, set it equal to the boss's life during @Initialize, and then put the following code in the main loop:

Code: [Select]
if(bosshp>(-999) ){
if(GetLife<bosshp){
STUFF THAT HAPPENS UPON HIT
}
bosshp=GetLife;
}
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #970 on: June 13, 2010, 09:56:53 PM »
I was going to ask something like that myself - what's the syntax for that sort of thing?

I was thinking of just running a task like I do for my timer sfx- if(SyntaxForBossGettingHit && BossHealthLessThanBlah){playsfx}. Something like that. Except I couldn't find the function that detects the boss getting hit by player bullets.

That function either does not exist, or is more esoteric than render targets.

I just check if the enemy's health has lowered from before and that enough time has passed since the last enemy-getting-hit-sound played. This does mean that the sound won't play if the enemy is invincible, by the way.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #971 on: June 13, 2010, 10:23:37 PM »
That function either does not exist, or is more esoteric than render targets.

I just check if the enemy's health has lowered from before and that enough time has passed since the last enemy-getting-hit-sound played. This does mean that the sound won't play if the enemy is invincible, by the way.

GetHitCount
and
GetEnemyLife

What?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #972 on: June 13, 2010, 10:25:29 PM »
GetHitCount
WHY DO I NOT KNOW THIS COMMAND?!
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Bitz

  • So Moe!
  • *heart attack*
Re: Danmakufu Q&A/Problem Thread v3
« Reply #973 on: June 13, 2010, 10:30:41 PM »
Durr hurr hurr *shoots self*

Yeah, I supposed GetHitCount could work too. However, GetHitCount only accounts for projectiles and not other things, like certain bombs and such.

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #974 on: June 14, 2010, 04:28:42 AM »
:smug:



@SparklingOrange
Among the other things these fine gents have listed, script_spells use  @Initialize@MainLoop  and  @Finalize  too, dawg.
Yes, I know. I didn't copypaste them onto my original post, but they're there in the actual script from my file.

Well, let xpos=GetCenterX+rand(0,416); should probably be let xpos=rand_int(0,416);
Second, you aren't setting the object's position which means it's nowhere. You don't control object position through XY vertices.
Third, xpos+(60*cos(120)),ypos+(60*sin(120)) should be xpos-80,ypos-300 i.e half the UV for each segment. This means the object's position is in the center of the graphic.
Fourth, vertices don't have anything to do with how your spell runs. There would still be the cutin and sound effect.
Yeah, just a quick correction there; in my experience when working with objects you either have to use SetPosition or vertices, if you use both then the vertices will act really really strangely, especially if you start trying to change the angle or the speed of the object.
I only wanted the texture to position randomly on the x axis, and the y stays at the center. For the angle, I only want it to stay at 90o. I guess it wasn't really necessary to put in the XY functions, so I did what you guys suggested and set the position like so...if it helps, I posted the entire spell script here. I put ??? on the IntersecrionLine xy coordinates 'cause I'm not sure how to set up the damage line relative to the position of the texture (I've put random values to test it out)
Code: [Select]
script_spell CCoil{
let lightning=get~".\img\teslalightningtex.png
let spellcount=0;
task LightningRipple(){
let objlightning=Obj_Create(OBJ_SPELL);
let xpos=rand_int(0,416);
let ypos=GetCenterY;
Obj_SetAlpha(objlightning,200);
                Obj_SetAngle(objlightning,90);
ObjEffect_SetTexture(objlightning,lightning);
ObjEffect_SetRenderState(objlightning,ADD);
ObjEffect_CreateVertex(objlightning,4);
ObjEffect_SetPrimitiveType(objlightning,PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetVertexUV(objlightning,0,0,0);
ObjEffect_SetVertexUV(objlightning,1,160,0);
ObjEffect_SetVertexUV(objlightning,2,160,600);
ObjEffect_SetVertexUV(objlightning,3,0,600);
while(!Obj_BeDeleted(objlightning)){
Obj_SetPosition(objlightning,xpos,ypos);
ObjSpell_SetIntersecrionLine(objlightning,???,100,10,true);
yield;
}
}
task run{
SetPlayerInvincibility(300);
ForbidShot(true);
loop(45){yield;}
while(spellcount<101){
if (spellcount%5==0){
LightningRipple();
LightningRipple();
LightningRipple();
PlaySE(GetCurrentScriptDirectory()~"lightning.wav");
if(spellcount==101){
PlaySE(GetCurrentScriptDirectory()~"crash.wav");}
}
spellcount++;
yield;
}

ForbidShot(false);
SetSpeed(3.5,2.5);
loop(90){yield;}
End();
}
  @Initialize{
  LoadGraphic(lightning);
  run();
  }
  @MainLoop{
  CollectItems();
  yield;
  }
  @Finalize{
  DeleteGraphic(lightning);
  }
}
Yet there's still no difference because no matter how many times I've checked for mistakes on this, the only thing this does is use up a bomb counter. No CutIn effect or sound, no lightning bolt, no lightning death, nothing, zilch, nada...

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #975 on: June 14, 2010, 04:38:10 AM »
You didn't fix the first thing.

let lightning=get~".img   eslalightningtex.png

should be

let lightning=get~".img   eslalightningtex.png";

And I'm still not sure about the directory you have set up there but yeah.

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

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread v3
« Reply #976 on: June 14, 2010, 05:04:12 AM »
Plus, assuming you defined get as GetCurrentScriptDirectory, get~".\img\teslalightningtex.png" won't work, since it would put your current script path twice in a row (script\something\script\something\img\file.png rather than just script\something\img\file.png). Either use GetCurrentScriptDirectory or .\, but not both, like this:
Code: [Select]
let lightning=get~"img\teslalightningtex.png";

SparklingOrange

  • Is a scrub.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #977 on: June 14, 2010, 07:04:00 AM »
You didn't fix the first thing.

let lightning=get~".\img\teslalightningtex.png

should be

let lightning=get~".\img\teslalightningtex.png";

And I'm still not sure about the directory you have set up there but yeah.
Arrgh...missed that one too. It's fixed.
Plus, assuming you defined get as GetCurrentScriptDirectory, get~".\img\teslalightningtex.png" won't work, since it would put your current script path twice in a row (script\something\script\something\img\file.png rather than just script\something\img\file.png). Either use GetCurrentScriptDirectory or .\, but not both, like this:
Code: [Select]
let lightning=get~"img\teslalightningtex.png";
Really? I did both and the files still loaded properly. It might've been something else.

Update: I've found the problem for the whole spellcard issue...it turns out I didn't capitalize the c in @SpellCard, so it's not running the freaking script at all.

I am a moron.

But now that's out of the way, there comes another issue. The lightning didn't render, but the damage line did. Whether the lightning was too small or whatever...it didn't show up. I switched from ADD to ALPHA, but when I tried playtesting, my computer crashed twice for some strange reason. Coincidence or not, I'm still trying to check it out...

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #978 on: June 14, 2010, 05:32:28 PM »
god fucking dammit sakhrgkasgkdasjfgaks


Anyways, the reason it isn't showing up is because you misinterpreted what I said and removed XY entirely. UV vertices and XY vertices are intertwined with each other. UV sets the position on your image as a vertex point on the game field XY distance from the object's actual position. When you have all four vertices up, it will make a rectangle. Say the XYs were set like this:

ObjEffect_SetVertexXY(objlightning,0,-80,-300);
ObjEffect_SetVertexXY(objlightning,1,80,-300);
ObjEffect_SetVertexXY(objlightning,2,80,300);
ObjEffect_SetVertexXY(objlightning,3,-80,300);


Then the lightning will be drawn in a rectangle with the object's actual position being in the direct center.

ObjEffect_SetVertexXY(objlightning,0,0,0);
ObjEffect_SetVertexXY(objlightning,1,160,0);
ObjEffect_SetVertexXY(objlightning,2,160,600);
ObjEffect_SetVertexXY(objlightning,3,0,600);


Then the top-left corner of the lightning is the object's position.

ObjEffect_SetVertexXY(objlightning,0,70,-50);
ObjEffect_SetVertexXY(objlightning,1,160,-110);
ObjEffect_SetVertexXY(objlightning,2,130,370);
ObjEffect_SetVertexXY(objlightning,3,240,0);


This will totally skew the graphic and I have no idea where the object position actually is, but I don't really care.

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

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #979 on: June 15, 2010, 04:01:31 PM »
how do you get danmakufu to draw everything onto a render target?
or is this not even possible and have I been lied to?

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #980 on: June 16, 2010, 12:22:57 PM »
how do you get danmakufu to draw everything onto a render target?
or is this not even possible and have I been lied to?

Azure explained it, me gets link. :ohdear:
Huzzah for render targets :V

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #981 on: June 16, 2010, 01:38:28 PM »
...
freakin read up. that page you linked to doesnt answer my question and it has been posted before.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #982 on: June 16, 2010, 02:20:11 PM »
...
freakin read up. that page you linked to doesnt answer my question and it has been posted before.
Damn, then I'm not sure what now.
I'm stumped on this too :(

Re: Danmakufu Q&A/Problem Thread v3
« Reply #983 on: June 17, 2010, 03:50:21 AM »
Argh, I am stumpted


http://pastebin.com/c9bhhRa3] This Code  is giving me problems, I want it to shoot the Fence bullets like I set it to, it works the first time, then when the boss gets in the middle, it messes up, I've tried using both the If method and the task method, but I have no idea how to get this to work, sorry for any inconviences I cause you guys

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #984 on: June 18, 2010, 12:14:21 AM »
http://www.mediafire.com/?mlglzm2djew

I'm trying to work out the spellcard background, but... If you notice, at one point, the squiggly lines in the back undergo some weird cutoff effect.
Could someone help me with this?

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #985 on: June 18, 2010, 12:27:13 AM »
http://www.mediafire.com/?mlglzm2djew

I'm trying to work out the spellcard background, but... If you notice, at one point, the squiggly lines in the back undergo some weird cutoff effect.
Could someone help me with this?
I tried changing
   SetGraphicRect(0,0,600,1000+scroll);
to
   SetGraphicRect(0,scroll,600,1000+scroll);
and
   SetGraphicRect(0,0,600,600-scroll);
to
   SetGraphicRect(0,-scroll,600,600-scroll);

Now it works. Not entirely shure what caused the error, though.  :/
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

KomeijiKoishi

Re: Danmakufu Q&A/Problem Thread v3
« Reply #986 on: June 19, 2010, 03:18:30 PM »
How can I achieve this?

If I have a negative number, I want that it counts as a positive one.

But I want positive ones to stay positive.

Using " |number| ! didn't work.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #987 on: June 19, 2010, 03:22:16 PM »
Um den Betrag einer Zahl n zu erhalten gibt es zwei M?glichkeiten.

Entweder: abs(n)
Oder: (| n |)

Dritte aber unpraktische M?glichkeit: (n^2)^0.5
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

KomeijiKoishi

Re: Danmakufu Q&A/Problem Thread v3
« Reply #988 on: June 19, 2010, 03:23:25 PM »
Danke, funzt jetzt.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #989 on: June 19, 2010, 04:21:33 PM »
Excuse me (and sorry for my poor english). How can I let objects remain after defeating boss?

I want to make UFO item when I defeat a spellcard, but UFO object had just disappeared as spellcard ended and nothing happened. ???