Author Topic: Danmakufu Q&A/Problem Thread II  (Read 184658 times)

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #840 on: January 13, 2010, 03:56:27 PM »
Some bullet questions again.

How can I create spiral bullet stream like this?

And how can I create bullet that bounch on each side?
From Naut's Tutorial I can make them bounch in X but when I try in Y, the bullet act very odd.
(I want them to bounching around permanently until spell brake.)

For your first question, to make the bullets curve like that, change the angle by using cos(variable) and increment the variable every frame. Use -cos to make it start the other way. For example, in that image, the blue bullets might be using cos while the red ones use -cos so that they crisscross each other. I believe the bullets are also just being shot at 3 different angles.

For your second question, use 180-Obj_GetAngle(obj) for when the bullets bounce off the left and right, and use 360-Obj_GetAngle(obj) for when the bullets bounce off the top and bottom.

EDIT: Lol, ninja'd
EDIT: Lol, extraneous calculations for SetX and SetY that are completely unnecessary. :V
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Re: Danmakufu Q&A/Problem Thread II
« Reply #841 on: January 13, 2010, 04:03:10 PM »
For your second question, use 180-Obj_GetAngle(obj) for when the bullets bounce off the left and right, and use 360-Obj_GetAngle(obj) for when the bullets bounce off the top and bottom.

or just use -Obj_GetAngle(obj)

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #842 on: January 13, 2010, 04:09:43 PM »
EDIT: Lol, extraneous calculations for SetX and SetY that are completely unnecessary. :V
D'OH!
*facepalm*

Apparently, it is true that my mind makes everything unneccessarily complicated...


...but my version offers more flexibility on how exactly you want the bullet to flow, and you can do other awesome stuff with it. I am so gonna use a variation of this bullet in the project I am working on (not the one for the contest).  :V
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."

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #843 on: January 13, 2010, 06:59:55 PM »
#include_function |lib\ExpandedShotDatav4\shot_replace.dnh" before @Initialize
then ShotInit; in @Initialize ?

(I should really get to making that readme...)
:V Oh, I just had it capitalized incorrectly.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #844 on: January 14, 2010, 03:49:13 AM »
Sorry for double-post, but I can't say I'm sure if this would get noticed.
Code: [Select]
task redshot{
let red = Obj_Create(OBJ_SHOT);
Obj_SetPosition(red,GetX,GetY);
Obj_SetSpeed(red,0);
Obj_SetAngle(red,0);
ObjShot_SetGraphic(red,RED01);
wait(120);
Obj_SetAngle(red,atan2(GetPlayerY-Obj_GetY(red),GetPlayerX-Obj_GetX(red)));
Obj_SetSpeed(red,1);
}
The intended effect is to have the bullets pause for 2 seconds and then move directly towards the player. Instead, they just hang there (but it added so much stress, I'm making it part of the card. Who says mistakes are all bad?)

Re: Danmakufu Q&A/Problem Thread II
« Reply #845 on: January 14, 2010, 03:54:12 AM »
Your wait function is probably oddly defined, or you're missing yield; in your @MainLoop. Switch wait(120); with loop(120){yield;}, if both of those checks didnt do anything.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #846 on: January 14, 2010, 04:06:38 AM »
Your wait function is probably oddly defined, or you're missing yield; in your @MainLoop. Switch wait(120); with loop(120){yield;}, if both of those checks didnt do anything.

Huh, none of those worked...

Re: Danmakufu Q&A/Problem Thread II
« Reply #847 on: January 14, 2010, 04:07:39 AM »
poooooaaassstt sssscrrrraaaapppttt

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #848 on: January 14, 2010, 04:16:23 AM »
Code: [Select]
#TouhouDanmakufu
#Title[Assault Wall "Geisterwand"]
#Text[Boxed in by bullets!]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{

let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "system\PlaceholderBoss.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";

@Initialize{
SetLife(1000);
SetDamageRate(0,0);
SetTimer(90);
SetScore(1000);
SetMovePosition01(GetCenterX,GetCenterY-90,5);
LoadGraphic(imgBoss);
ShotInit;
CutIn(KOUMA,"Assault Wall "\""Geisterwand"\","",0,0,0,0);
mainTask;
}

@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}

@DrawLoop{

SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,64,64);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);

}

@BackGround{



}

@Finalize{

DeleteGraphic(imgBoss);

}
task mainTask{
//randomly choose a type of wall at the start
let walltype = rand_int(1,4);
wait(120);
yield;
//Cast Geisterwand Defense
Ghost;
loop{
alternative(walltype)
case(1){
blue;
}
case(2){
red;
}
case(3){
yellow;
}
case(4){
green;
}
others{yield}
wait(90);
walltype = rand_int(1,4);
yield;
}
}

task blue{
let startside = rand_int(1,3);
alternative(startside)
case(1){
CreateEnemyFromScript("BlueWall",0,rand_int(0,480),0,0,1);
}
case(2){
CreateEnemyFromScript("BlueWall",rand_int(0,448),0,0,0,2);
}
case(3){
CreateEnemyFromScript("BlueWall",448,rand_int(0,480),0,0,1);
}
others{}
yield;
}

task red{
let startside = rand_int(1,3);
alternative(startside)
case(1){
CreateEnemyFromScript("RedWall",0,rand_int(0,480),0,0,1);
}
case(2){
CreateEnemyFromScript("RedWall",rand_int(0,448),0,0,0,2);
}
case(3){
CreateEnemyFromScript("RedWall",448,rand_int(0,480),0,0,3);
}
others{}
yield;
}

task yellow{
let startside = rand_int(1,3);
alternative(startside)
case(1){
CreateEnemyFromScript("YlwWall",0,rand_int(0,480),0,0,1);
}
case(2){
CreateEnemyFromScript("YlwWall",rand_int(0,448),0,0,0,2);
}
case(3){
CreateEnemyFromScript("YlwWall",448,rand_int(0,480),0,0,1);
}
others{}
yield;
}

task green{
let startside = rand_int(1,3);
alternative(startside)
case(1){
CreateEnemyFromScript("GreenWall",0,rand_int(0,480),0,0,1);
}
case(2){
CreateEnemyFromScript("GreenWall",rand_int(0,448),0,0,0,2);
}
case(3){
CreateEnemyFromScript("GreenWall",448,rand_int(0,480),0,0,1);
}
others{}
yield;
}

sub Ghost{
CreateEnemyFromScript("maceFam",GetEnemyX,GetEnemyY,0,0,0);
CreateEnemyFromScript("maceFam",GetEnemyX,GetEnemyY,0,0,60);
CreateEnemyFromScript("maceFam",GetEnemyX,GetEnemyY,0,0,120);
CreateEnemyFromScript("maceFam",GetEnemyX,GetEnemyY,0,0,180);
CreateEnemyFromScript("maceFam",GetEnemyX,GetEnemyY,0,0,240);
CreateEnemyFromScript("maceFam",GetEnemyX,GetEnemyY,0,0,300);
}

function wait(w){
loop(w){yield;}
}

}

//Travels in a straight line and lays down a wall of bullets
//After 2 seconds, bullets will fly at whatever the player's position was when the bullet was planted
script_enemy BlueWall{

let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "Materials\Graphics\DMF_fam.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";
let frame = 0;
let startside = GetArgument;

@Initialize{
SetLife(500);
SetDamageRate(50,0);
LoadGraphic(imgFam);
ShotInit;
maintask;

}

@MainLoop{
SetCollisionA(GetX,GetY,16);
SetCollisionB(GetX,GetY,16);
yield;
}

@DrawLoop{
SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
SetGraphicRect(8,8,39,39);
DrawGraphic(GetX,GetY);
}

@Finalize{
DeleteGraphic(imgFam);
}

function wait(n){
loop(n){yield}
}

task maintask{
wall;
alternative(startside)
case(1){
SetMovePosition02(448,rand_int(0,480),90);
}
case(2){
SetMovePosition02(rand_int(0,448),480,90);
}
case(3){
SetMovePosition02(0,rand_int(0,480),90);
}
wait(90);
VanishEnemy;
}

task wall{
loop{
CreateShotA(1,GetX,GetY,0);
SetShotDataA(1,0,0,GetAngleToPlayer,0,0,0,BLUE01);
SetShotDataA(1,120,1,NULL,0,0,0,BLUE01);
FireShot(1);
wait(5);
yield;
}
}
}

//Travels in a straight line and lays down a wall of bullets
//After 2 seconds, bullets will fly directly at the player
script_enemy RedWall{

let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "Materials\Graphics\DMF_fam.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";
let frame = 0;
let startside = GetArgument;

@Initialize{
SetLife(500);
SetDamageRate(50,0);
LoadGraphic(imgFam);
ShotInit;
maintask;

}

@MainLoop{
SetCollisionA(GetX,GetY,16);
SetCollisionB(GetX,GetY,16);
yield;
}

@DrawLoop{
SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
SetGraphicRect(56,8,87,39);
DrawGraphic(GetX,GetY);
}

@Finalize{
DeleteGraphic(imgFam);
}

function wait(n){
loop(n){yield;}
}

task maintask{
wall;
alternative(startside)
case(1){
SetMovePosition02(448,rand_int(0,480),90);
}
case(2){
SetMovePosition02(rand_int(0,448),480,90);
}
case(3){
SetMovePosition02(0,rand_int(0,480),90);
}
wait(90);
VanishEnemy;
}

task wall{
loop{
redshot;
wait(5);
yield;
}
}

task redshot{
let red = Obj_Create(OBJ_SHOT);
Obj_SetPosition(red,GetX,GetY);
Obj_SetSpeed(red,0);
Obj_SetAngle(red,0);
ObjShot_SetGraphic(red,RED01);

while(!Obj_BeDeleted(red)){
wait(120);
Obj_SetAngle(red,atan2(GetPlayerY-Obj_GetY(red),GetPlayerX-Obj_GetX(red)));
Obj_SetSpeed(red,1);
yield;
}
}
}

//Moves in a straight line and leaves a wall of bullets
//Bullets left by YlwWall do not move, ever
script_enemy YlwWall{

let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "Materials\Graphics\DMF_fam.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";
let frame = 0;
let startside = GetArgument;

@Initialize{
SetLife(500);
SetDamageRate(50,0);
LoadGraphic(imgFam);
ShotInit;
maintask;

}

@MainLoop{
SetCollisionA(GetX,GetY,16);
SetCollisionB(GetX,GetY,16);
yield;
}

@DrawLoop{
SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
SetGraphicRect(152,8,183,39);
DrawGraphic(GetX,GetY);
}

@Finalize{
DeleteGraphic(imgFam);
}

function wait(n){
loop(n){yield}
}

task maintask{
wall;
alternative(startside)
case(1){
SetMovePosition02(448,rand_int(0,480),90);
}
case(2){
SetMovePosition02(rand_int(0,448),480,90);
}
case(3){
SetMovePosition02(0,rand_int(0,480),90);
}
wait(90);
VanishEnemy;
}

task wall{
loop{
ylwshot;
wait(5);
yield;
}
}

task ylwshot{
let ylw = Obj_Create(OBJ_SHOT);
Obj_SetPosition(ylw,GetX,GetY);
Obj_SetSpeed(ylw,0);
Obj_SetAngle(ylw,0);
ObjShot_SetGraphic(ylw,YELLOW01);
wait(120);
yield;
}
}

//Travels in a straight line and leaves a wall of bullets
//After 2 seconds, bullets explode into randomly angled lasers
script_enemy GreenWall{

let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "Materials\Graphics\DMF_fam.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";
let frame = 0;
let startside = GetArgument;

@Initialize{
SetLife(500);
SetDamageRate(50,0);
LoadGraphic(imgFam);
ShotInit;
maintask;

}

@MainLoop{
SetCollisionA(GetX,GetY,16);
SetCollisionB(GetX,GetY,16);
yield;
}

@DrawLoop{
SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
SetGraphicRect(104,8,135,39);
DrawGraphic(GetX,GetY);
}

@Finalize{
DeleteGraphic(imgFam);
}

function wait(n){
loop(n){yield;}
}

task maintask{
wall;
alternative(startside)
case(1){
SetMovePosition02(448,rand_int(0,480),90);
}
case(2){
SetMovePosition02(rand_int(0,448),480,90);
}
case(3){
SetMovePosition02(0,rand_int(0,480),90);
}
wait(90);
VanishEnemy;
}

task wall{
loop{
greenshot;
wait(5);
yield;
}
}

task greenshot{
let lasangle = rand_int(0,359);
let green = Obj_Create(OBJ_SHOT);
Obj_SetPosition(green,GetX,GetY);
Obj_SetAngle(green,0);
ObjShot_SetGraphic(green,GREEN01);
ObjShot_SetDelay(green,0);
while(!Obj_BeDeleted(green)){
wait(120);
loop(5){
CreateLaser01(Obj_GetX(green),Obj_GetY(green),2,lasangle,20,5,GREEN21,0);
lasangle = rand_int(0,359);
}
ObjShot_FadeDelete(green);
}
}
}

//Geisterwand Mace Shield
script_enemy maceFam{

let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "Materials\Graphics\GeisterwandSprite.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";
let dir = GetArgument;
let r = 50;
let spin = GetArgument+87;
let frame = 0;

@Initialize{
SetLife(1);
SetDamageRate(0,0);
LoadGraphic(imgFam);
ShotInit;
maintask;

}

@MainLoop{
SetCollisionA(GetX,GetY,16);
SetCollisionB(GetX,GetY,16);
yield;
}

@DrawLoop{
SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,spin);
SetGraphicRect(0,0,30,31);
DrawGraphic(GetX,GetY);

spin+=5;

}

@Finalize{
DeleteGraphic(imgFam);
}

task maintask{
yield;
move;
}

task move{
loop{
//shoot direction of movement and 30 degrees off every 15 frames
if(frame == 7){
CreateShot01(GetX,GetY,3,dir+90,WHITE12I,0);
frame = 0;
}
SetMovePosition03(GetEnemyX+3*r*cos(dir),GetEnemyY+3*r*sin(dir),20,10);
dir+=5;
frame++;
yield;
}
}

function wait(n){
loop(n){yield;}
}
}
Here's the whole thing. EDIT: Forgot the .png at the end of the filename.
Updated. GreenWall is supposed to shoot lasers in 5 random directions after 2 seconds.
« Last Edit: January 14, 2010, 05:50:08 AM by AweStriker Nova »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #849 on: January 14, 2010, 02:14:41 PM »
I don't know if this is the source of the problem, but it very well could be:

In your task, you create a variable to refer to the object id.

The name of this variable is red. Why is this a problem?
Quote
task red{
<snip>
   }
You define a variable that has the same name as a defined task. Defining two different things under the same name usually causes problems. I suggest to change every instance of red inside your redshot task to something else, like obj or gooseberry or something, maybe this will fix the problem, maybe it won't, but it is defeinitely worth a try.  ;)
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."

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread II
« Reply #850 on: January 14, 2010, 03:23:33 PM »
Thank you so much, at first I try -angle in Y but it don't bounce. Now it bounce perfectly.


Fetch()tirade

  • serial time-waster
Re: Danmakufu Q&A/Problem Thread II
« Reply #851 on: January 15, 2010, 03:05:15 AM »
I'm trying to make lasers spawn lasers. So I'd create two different ones using CreateLaserblah(1,blah) twice and then use AddShot, right?

Question 1: The first one would be fired from a specific point, so the x and y are covered, but what about the second? What would I put in there?

Question 2: I'm what I'm actually attempting involves having the lasers that come from the first lasers do the same (make more lasers) over and over again, and when they do so, they disappear. Would I just have to create as many CreateLasers it takes to reach the end of the screen, or could I make a loop for that?

Re: Danmakufu Q&A/Problem Thread II
« Reply #852 on: January 15, 2010, 05:14:52 AM »
I'm trying to make lasers spawn lasers. So I'd create two different ones using CreateLaserblah(1,blah) twice and then use AddShot, right?

Question 1: The first one would be fired from a specific point, so the x and y are covered, but what about the second? What would I put in there?

Question 2: I'm what I'm actually attempting involves having the lasers that come from the first lasers do the same (make more lasers) over and over again, and when they do so, they disappear. Would I just have to create as many CreateLasers it takes to reach the end of the screen, or could I make a loop for that?
Answer 1: To make the Laser spawn from the "master laser" just put 0,0 for X and YAnswer 2: I would actually ascent the id and frames after creation for that...ascent(i in 1..how many you want){CreateLaserA(1,blah)   AddShot(10*i,1,i,0);CreateLaserA(i,blah)l

Re: Danmakufu Q&A/Problem Thread II
« Reply #853 on: January 15, 2010, 05:52:07 AM »
Sorry for the Double Post,
For some reason, the scripts decides to skip @BackGround, I can not get it to show up! I know the image loads because I can put the code in DrawLoop and it shows up.
http://www.mediafire.com/?jjmritjkz55  Sorry for putting the code like this, code box or quote box do not want to work for me for some reason

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #854 on: January 15, 2010, 05:55:52 AM »
If you don't add SetScore, danmakufu doesn't register it as a spell card, and it skips @BackGround.

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #855 on: January 15, 2010, 05:59:22 AM »
If you don't add SetScore, danmakufu doesn't register it as a spell card, and it skips @BackGround.
seriously?! wtf...  Im sorry that was a rude comment to make, thank you
« Last Edit: January 15, 2010, 02:54:29 PM by Demonbman »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #856 on: January 15, 2010, 04:46:41 PM »
Pfff, don't worry about it. Everybody went through that. When I was a newbie in Dnh I was breaking my mind why my background didn't show up. I compared a spellcard included with mine and just started deleting the lines 1 by 1. After 30min of trial & error I ended up in @initialize with SetScore.

:V You got to love those good old days.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #857 on: January 15, 2010, 04:50:52 PM »
Wow. I stumbled upon the same problem a few days ago and came to the conclusion that I'd just have to make a stage script for every boss with an animated background...

...guess that won't be neccessary.  :V

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."

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #858 on: January 15, 2010, 05:40:15 PM »
Although! I am not sure how to eliminate the message of spell card bonus when a spell is captured. Only thing I can think of is upon Finalize, store the bonus in a variable, fail the card and implement the bonus manually. I don't want to do this.

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #859 on: January 15, 2010, 05:45:18 PM »
The way I would see how you would do that would make a variable = true; then, in MainLoop, if the player dies, set it to false, and in the finalize, if(variable = true){AddScore(bonus);}

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #860 on: January 15, 2010, 06:14:44 PM »
I don't know if this is the source of the problem, but it very well could be:

In your task, you create a variable to refer to the object id.

The name of this variable is red. Why is this a problem?You define a variable that has the same name as a defined task. Defining two different things under the same name usually causes problems. I suggest to change every instance of red inside your redshot task to something else, like obj or gooseberry or something, maybe this will fix the problem, maybe it won't, but it is defeinitely worth a try.  ;)

Didn't work, although I have no idea why I was using an object-bullet for yellow when I could have used a stationary CreateShot01.

Hey, I found the problem! The enemies were being Vanished before the instructions could be carried out!
« Last Edit: January 15, 2010, 06:48:33 PM by AweStriker Nova »

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #861 on: January 15, 2010, 06:49:54 PM »
Did another small test run;

If I copy your redshot task in a minimalist boss script and use it, the bullet works just fine (although I don't know if you wanted the bullets to re-aim at the player every 121 frames).

I'll tinker around a little more to see where the problem might be...


Edit: I think it just might be possible to fix the problem by replacing the wait(120) with a loop(120){yield; }. Danmakufu might just be stupid enough to not remember the wait function after the enemy during whose script it was defined was destroyed. If so, it would naturally either give you an error message or just cancel the task where the error through the undefined function occured.
« Last Edit: January 15, 2010, 06:56:59 PM by Iryan »
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."

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #862 on: January 15, 2010, 06:52:34 PM »
The way I would see how you would do that would make a variable = true; then, in MainLoop, if the player dies, set it to false, and in the finalize, if(variable = true){AddScore(bonus);}
I mean the really crappy text that pops up. It isn't a graphic either so you can't just black it.

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #863 on: January 15, 2010, 06:55:43 PM »
I mean the really crappy text that pops up. It isn't a graphic either so you can't just black it.

What if you blanc out the font.png ?

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #864 on: January 15, 2010, 06:57:37 PM »
Now that my bullets work, I'll be doing some graphics and editing in a couple more types.

But now the graphics unexpectedly cut out! AGH!

(Oh, how I fixed it: I changed every instance of Wait 90 in the movetask to Wait 210, and made them unhittable.)

EDIT: Ah, here we go. The new White type (All other types work properly) is giving me problems:
Code: [Select]
//Travels in a straight line and lays down a wall of bullets
//WhiteWall fires lasers perpendicular to the path
script_enemy WhiteWall{

let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "Materials\Graphics\DMF_faml.png";
#include_function "lib\ExpandedShotDatav4\shot_replace.dnh";
let frame = 0;
let startside = GetArgument;

@Initialize{
SetLife(500);
SetDamageRate(50,0);
LoadGraphic(imgFam);
ShotInit;
maintask;

}

@MainLoop{
yield;
}

@DrawLoop{
SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
SetGraphicRect(8,8,39,39);
DrawGraphic(GetX,GetY);
}

@Finalize{
DeleteGraphic(imgFam);
}

function wait(n){
loop(n){yield}
}

task maintask{
wall;
alternative(startside)
case(1){
SetMovePosition02(448,rand_int(0,480),90);
}
case(2){
SetMovePosition02(rand_int(0,448),480,90);
}
case(3){
SetMovePosition02(0,rand_int(0,480),90);
}
wait(210);
VanishEnemy;
}

task wall{
loop(18){
white;
wait(5);
yield;
}
}

task white{
let angle = GetAngle;
let wht = Obj_Create(OBJ_SHOT);
Obj_SetPosition(wht,GetX,GetY);
Obj_SetSpeed(wht,0);
ObjShot_SetGraphic(WHITE01);
Obj_SetAngle(wht,0);
ObjShot_SetDelay(wht,0);
while(!Obj_BeDeleted(wht)){
wait(120);
CreateLaserA(1,Obj_GetX(wht),Obj_GetY(wht),500,8,WHITE47,10);
SetLaserDataA(1,0,angle+90,0,0,0,0);
CreateLaserA(2,Obj_GetX(wht),Obj_GetY(wht),500,8,WHITE47,10);
SetLaserDataA(2,0,angle-90,0,0,0,0);
SetLaserDataA(1,20,angle+90,0,0,500,angle+90);
SetLaserDataA(2,20,angle+90,0,0,500,angle-90);
FireShot(1);
FireShot(2);
Obj_Delete(wht);
}
}
}

White is defined after Green in the code from earlier.
« Last Edit: January 15, 2010, 08:35:06 PM by AweStriker Nova »

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Danmakufu Q&A/Problem Thread II
« Reply #865 on: January 15, 2010, 09:15:16 PM »
Not necessarily a question, but Danmakufu slows down when a certain number of object effects are drawn. It may take quite a few in number, but after you do backgrounds/spell patterns/ special effects, and all the other proper things you need to do to make a custom game, the number of spare object effects and actual bullets you can use without slowing the frame rate down to 45/40 fps is severely limited. After looking into the Touhou games with the same exact effects, I couldn't help but think that the Danmakufu game engine needs some tuning up.
I mean, try doing this in Danmakufu.
Doing something like that would make it run at 50fps, at the very most, and if you make it as simple as possible. Just try experimenting with the little white box-stars by turning the bullets into points. You'll see it slow down just from the player "obsorbing" them.  Can't something be done about this? A newer game engine perhaps?

Magical Girl Satori~

  • obviously i am magical..
  • loljk im not i totally fooled you
Re: Danmakufu Q&A/Problem Thread II
« Reply #866 on: January 15, 2010, 09:50:58 PM »
How can you get Danmakufu to work on windows 7?

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #867 on: January 15, 2010, 10:03:34 PM »
How can you get Danmakufu to work on windows 7?
There's a separate thread for this.

As an actual question, I seem to be failing to understand how Created Laser As and Created Laser Bs are supposed to be deleted.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #868 on: January 15, 2010, 10:08:41 PM »
SetShotKillTime(ID, time after creation);
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."

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #869 on: January 15, 2010, 10:17:08 PM »
Oh, I forgot about that function!