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

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #390 on: March 07, 2010, 07:19:04 PM »
Auuuugh.

Well, yeah. I did a typo in my advice. It would have had to be ObjEffect_SetAlpha(spark,255);, without the "Render". And even then, even though it would have been an actual command, it probably wouldn't have worked properly. Use Azure's code.

...I seriously need to reread the advice I give.  :X
That isn't a command either.
Obj_SetAlpha(obj,255);

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

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #391 on: March 07, 2010, 07:25:04 PM »
That isn't a command either.
Obj_SetAlpha(obj,255);
brb punching myself in the face
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."

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread v3
« Reply #392 on: March 07, 2010, 07:37:16 PM »
This was implied in the previous posts, but just to avoid confusion: Obj_SetAlpha doesn't work with object effects, just shots and lasers. That's why I said the ObjEffect_SetVertexColor method.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #393 on: March 07, 2010, 08:31:31 PM »
Ascents are written in Paranthesis, not brackets, so Blue Showdown is right

ascent(b in -5..6){

should fix your problem

Surprisingly, that didn't work. In fact, the text of the error is...
---------------------------
ScriptError「C:\Users\AweStriker\Downloads\th_dnh\script\AweScript\CollapseCavern.txt」
---------------------------
"}"が必要です(349行目)

      loop{

         CreateShotA(1,rand_int(GetClipMinX,GetClipMaxX),GetClipMinY,10);

         SetShotDataA_XY(1,0,rand(-1,1),0,0,0.07,0,3
~~~
---------------------------
OK   
---------------------------
which is exactly the same error I got the first time. HM

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #394 on: March 07, 2010, 08:35:31 PM »
Code: [Select]
   task collapseroutine{
      let shotchoice = [52, 155, 164, 207]
      loop{
         CreateShotA(1,rand_int(GetClipMinX,GetClipMaxX),GetClipMinY,10);
         SetShotDataA_XY(1,0,rand(-1,1),0,0,0.07,0,3,shotchoice[rand_int(0,3)]);
         FireShot(1);
         wait(30);
      }
   }
Quote
      let shotchoice = [52, 155, 164, 207] ;

Missing a seimcolon there.
« Last Edit: March 07, 2010, 08:37:17 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."

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #395 on: March 07, 2010, 09:47:44 PM »
Code: [Select]
   task collapseroutine{
      let shotchoice = [52, 155, 164, 207]
      loop{
         CreateShotA(1,rand_int(GetClipMinX,GetClipMaxX),GetClipMinY,10);
         SetShotDataA_XY(1,0,rand(-1,1),0,0,0.07,0,3,shotchoice[rand_int(0,3)]);
         FireShot(1);
         wait(30);
      }
   }
Missing a seimcolon there.

Fixed, but the fans here just hang in midair. What's wrong in the SetShotData?
Code: [Select]
task earthfans{

let angle = GetAngleToPlayer;

ascent(a in 3..8){

ascent(b in -5..6){

CreateShotA(1,GetX,GetY,5);

SetShotDataA(1,0,1,angle+90+10*b,0,0,0,37);

SetShotDataA(1,20*a,0,angle+rand_int(-5,5),0,0,0,37);

SetShotDataA(1,90-10*a,1,NULL,0,0,0,37);

FireShot(1);

CreateShotA(1,GetX,GetY,5);

SetShotDataA(1,0,1,angle-90+10*b,0,0,0,37);

SetShotDataA(1,20*a,0,angle+rand_int(-5,5),0,0,0,37);

SetShotDataA(1,90-10*a,1,NULL,0,0,0,37);

FireShot(1);

}

}

}[/size][/font]

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #396 on: March 07, 2010, 09:55:26 PM »
Well...

When a assumes values ranging from 3 to 7, then the second parameter of the SetShotData commands, that is the time after creation that the change will take place, will look like this:

0;

60; 80; 100; 120; 140;

60; 50; 40; 30; 20;

As you can see, the effects of the third SetShotData apply earlier that the effects of the second, meaning that the bullets are left with a speed and an acceleration of zero.

Edit: Fixed typoes. Posting 10 minutes before going to bed makes me type stupid things, even when I actually know better... T.T
« Last Edit: March 08, 2010, 01:06:53 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."

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #397 on: March 07, 2010, 10:58:10 PM »
Well that's no good, I need the third SetShotData lines to occur simultaneously.

...so if I change the spread velocity of the bullets to 2... and then... wait, these are all being spawned simultaneously. I need a constant in the third line.

And now it works fine!

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #398 on: March 10, 2010, 02:18:52 AM »
Anyone know how the CtC Yukari's teleportation effect works? I remember it vaguely but I don't have CtC anymore so I cant look at it myself.
<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.

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread v3
« Reply #399 on: March 10, 2010, 11:04:54 AM »
Move Boss instanly and then

Concentration01(30);

=w=b

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #400 on: March 10, 2010, 12:52:28 PM »
Please tell me you're joking... I was pretty sure there was a fancier effect than that. :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.

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread v3
« Reply #401 on: March 10, 2010, 02:22:53 PM »
Hmm, if you asking for her effect like in this one (CtC stage 4). It is Concentration01(30).
I just notice that they add white line for addition gap effect for teleportation too.

Taken from Phantasm Romance, Daiyousei teleportation movement.
Code: [Select]
Concentration01(30);
flg=0;
wait(30);
SetMovePosition02(cenX+movepos[move],rand(80,120),1);
wait(30);
flg=1;
Concentration01(30);

Did I miss something?

Re: Danmakufu Q&A/Problem Thread v3
« Reply #402 on: March 10, 2010, 05:50:26 PM »
If I had to guess, I'd say two CreateLaserA's with delay==SetShotKillTime, and Explosion01 or Concentration01(30) depending on if you want the circle to expand or contract (in addition to other effects like SetEnemyMarker(false), SetX, SetY and an invisible sprite).

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #403 on: March 11, 2010, 06:27:43 AM »
Awww, it really is just default effects? How saddening. I thought the CtC team was really awesome and made their own effect for it. Oh well, thanks.
<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 v3
« Reply #404 on: March 11, 2010, 06:34:19 AM »
How saddening.

Saddening doesn't even begin to describe CtC code.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread v3
« Reply #405 on: March 11, 2010, 02:36:02 PM »
Saddening doesn't even begin to describe CtC code.

Is it that it's so incomprehensible no one can steal it or so unoptimized that it runs way too slowly on anything less than a high-end PC? Or both?

Re: Danmakufu Q&A/Problem Thread v3
« Reply #406 on: March 11, 2010, 04:37:19 PM »
More advanced stage enemy problem!

Code for an enemy in a stage script is as follows:

Code: [Select]
script_enemy_main
{//Slave-having enemy
let count=0;
let cx=GetCenterX();
let imgEnemy=GetCurrentScriptDirectory~"img\Enemy.png";
let imgAngle=0;
let shotAngle=0;
let id = GetArgument;

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

task TMove {
wait(400);
VanishEnemy;
}

@Initialize
{
SetLife(500);
SetGraphicRect(1,1,32,32);
SetMovePosition03(GetCenterX+(-(GetX-GetCenterX)+600), GetY + 800, 30, 1);

if(id) {
SetCommonData("Enemy01LeftX", GetX);
SetCommonData("Enemy01LeftY", GetY);
} else {
SetCommonData("Enemy01RightX", GetX);
SetCommonData("Enemy01RightY", GetY);
}

SetCommonData("Enemy01Side", GetArgument);
ascent(i in 0..4) {
CreateEnemyFromScript("Familiar", GetX, GetY, 0, 0, i*90);
}
TMove;
}

@MainLoop
{
    SetCollisionA(GetX, GetY, 16);
        SetCollisionB(GetX, GetY, 16);
if(id) {
SetCommonData("Enemy01LeftX", GetX);
SetCommonData("Enemy01LeftY", GetY);
} else {
SetCommonData("Enemy01RightX", GetX);
SetCommonData("Enemy01RightY", GetY);
}
yield;
}

@Finalize
{//読みこんだファイルを削除
CreateItem(ITEM_SCORE, GetX + rand(-10,10), GetY + rand(10,10));
}

@DrawLoop
{//描画
SetTexture(imgEnemy);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,imgAngle);
DrawGraphic(GetX(),GetY());
SetRenderState(ADD);
SetGraphicAngle(0,0,-imgAngle);
DrawGraphic(GetX(),GetY());
imgAngle+=4;
if(imgAngle>360){imgAngle=0;}
}
}

script_enemy Familiar {
let ImgFam = GetCurrentScriptDirectory ~ "img\Enemy.png";
let imgAngle=0;
let angle = GetArgument;
let id = false;

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


    @Initialize {
        SetLife(100);
        SetScore(0);
        SetDamageRateEx(100, 100, 50, 50);

        LoadGraphic(ImgFam);
        SetTexture(ImgFam);
SetGraphicRect(1,1,32,32);

id = GetCommonData("Enemy01Side");

        TRotate;
        TFire;
    }

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

@DrawLoop
{//描画
SetTexture(ImgFam);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,imgAngle);
DrawGraphic(GetX(),GetY());
SetRenderState(ADD);
SetGraphicAngle(0,0,-imgAngle);
DrawGraphic(GetX(),GetY());
imgAngle+=4;
if(imgAngle>360){imgAngle=0;}
}

  @Finalize
{//読みこんだファイルを削除
CreateShot01(GetX, GetY, 2, angle, RED01, 10);
CreateShot01(GetX, GetY, 2, angle+30, RED01, 10);
CreateShot01(GetX, GetY, 2, angle-30, RED01, 10);
CreateItem(ITEM_SCORE, GetX + rand(-10,10), GetY + rand(10,10));
}

// rotate around the boss
    task TRotate {
let eX = 0;
let eY = 0;
loop {
if(id) {
eX = GetCommonData("Enemy01LeftX");
eY = GetCommonData("Enemy01LeftY");
} else {
eX = GetCommonData("Enemy01RightX");
eY = GetCommonData("Enemy01RightY");
}
SetX(eX + cos(angle) * 50);
SetY(eY + sin(angle) * 50);
yield;
angle += 1.5;
}
}

    task TFire {
        loop {
CreateShot01(GetX, GetY, 2, angle, RED01, 10);
            wait(40);
        }
    }
}

This is supposed to create one enemy with four slave enemies rotating around it. I have a test state script with just the one enemy, and it does do this - but as soon as the master enemy is killed, the game crashes and force-quits. Is there some kind of garbage collection I should be doing in here?

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread v3
« Reply #407 on: March 11, 2010, 04:39:22 PM »
More advanced stage enemy problem!

Code for an enemy in a stage script is as follows:

Code: [Select]
script_enemy_main
{//Slave-having enemy
let count=0;
let cx=GetCenterX();
let imgEnemy=GetCurrentScriptDirectory~"img\Enemy.png";
let imgAngle=0;
let shotAngle=0;
let id = GetArgument;

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

task TMove {
wait(400);
VanishEnemy;
}

@Initialize
{
SetLife(500);
SetGraphicRect(1,1,32,32);
SetMovePosition03(GetCenterX+(-(GetX-GetCenterX)+600), GetY + 800, 30, 1);

if(id) {
SetCommonData("Enemy01LeftX", GetX);
SetCommonData("Enemy01LeftY", GetY);
} else {
SetCommonData("Enemy01RightX", GetX);
SetCommonData("Enemy01RightY", GetY);
}

SetCommonData("Enemy01Side", GetArgument);
ascent(i in 0..4) {
CreateEnemyFromScript("Familiar", GetX, GetY, 0, 0, i*90);
}
TMove;
}

@MainLoop
{
    SetCollisionA(GetX, GetY, 16);
        SetCollisionB(GetX, GetY, 16);
if(id) {
SetCommonData("Enemy01LeftX", GetX);
SetCommonData("Enemy01LeftY", GetY);
} else {
SetCommonData("Enemy01RightX", GetX);
SetCommonData("Enemy01RightY", GetY);
}
yield;
}

@Finalize
{//読みこんだファイルを削除
CreateItem(ITEM_SCORE, GetX + rand(-10,10), GetY + rand(10,10));
}

@DrawLoop
{//描画
SetTexture(imgEnemy);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,imgAngle);
DrawGraphic(GetX(),GetY());
SetRenderState(ADD);
SetGraphicAngle(0,0,-imgAngle);
DrawGraphic(GetX(),GetY());
imgAngle+=4;
if(imgAngle>360){imgAngle=0;}
}
}

script_enemy Familiar {
let ImgFam = GetCurrentScriptDirectory ~ "img\Enemy.png";
let imgAngle=0;
let angle = GetArgument;
let id = false;

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


    @Initialize {
        SetLife(100);
        SetScore(0);
        SetDamageRateEx(100, 100, 50, 50);

        LoadGraphic(ImgFam);
        SetTexture(ImgFam);
SetGraphicRect(1,1,32,32);

id = GetCommonData("Enemy01Side");

        TRotate;
        TFire;
    }

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

@DrawLoop
{//描画
SetTexture(ImgFam);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,imgAngle);
DrawGraphic(GetX(),GetY());
SetRenderState(ADD);
SetGraphicAngle(0,0,-imgAngle);
DrawGraphic(GetX(),GetY());
imgAngle+=4;
if(imgAngle>360){imgAngle=0;}
}

  @Finalize
{//読みこんだファイルを削除
CreateShot01(GetX, GetY, 2, angle, RED01, 10);
CreateShot01(GetX, GetY, 2, angle+30, RED01, 10);
CreateShot01(GetX, GetY, 2, angle-30, RED01, 10);
CreateItem(ITEM_SCORE, GetX + rand(-10,10), GetY + rand(10,10));
}

// rotate around the boss
    task TRotate {
let eX = 0;
let eY = 0;
loop {
if(id) {
eX = GetCommonData("Enemy01LeftX");
eY = GetCommonData("Enemy01LeftY");
} else {
eX = GetCommonData("Enemy01RightX");
eY = GetCommonData("Enemy01RightY");
}
SetX(eX + cos(angle) * 50);
SetY(eY + sin(angle) * 50);
yield;
angle += 1.5;
}
}

    task TFire {
        loop {
CreateShot01(GetX, GetY, 2, angle, RED01, 10);
            wait(40);
        }
    }
}

This is supposed to create one enemy with four slave enemies rotating around it. I have a test state script with just the one enemy, and it does do this - but as soon as the master enemy is killed, the game crashes and force-quits. Is there some kind of garbage collection I should be doing in here?

Have it so that the slaves also die if the main enemy is killed, you're getting an error because if the master dies, the slaves go to an impossible location, which is nowhere.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #408 on: March 11, 2010, 05:30:19 PM »
Have it so that the slaves also die if the main enemy is killed, you're getting an error because if the master dies, the slaves go to an impossible location, which is nowhere.

Right, I figured it might be something like that. There a quick function for this, or do I need to have the master communicate its death to the slaves via Common Data?

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread v3
« Reply #409 on: March 11, 2010, 07:40:27 PM »
Right, I figured it might be something like that. There a quick function for this, or do I need to have the master communicate its death to the slaves via Common Data?

http://dmf.shrinemaiden.org/wiki/index.php?title=Enemy_Script_Functions#VanishEnemy

in the mainloop of each slave, have an if statement that says like, if(MasterAlive == 0){VanishEnemy;}

MasterAlive needs to be a common data. and just set MasterAlive to 0, in the master's finalize.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #410 on: March 11, 2010, 11:19:23 PM »
Is it that it's so incomprehensible no one can steal it or so unoptimized that it runs way too slowly on anything less than a high-end PC? Or both?

Not really. If you try a lot of my newer scritps (e.g. my really fucking annoying Mikaruge boss), I use CtC's sprite animation scripts. I wanted to try using the cut-in functions, too, but I don't get how the freaking thing works.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #411 on: March 12, 2010, 12:48:21 AM »
http://dmf.shrinemaiden.org/wiki/index.php?title=Enemy_Script_Functions#VanishEnemy

in the mainloop of each slave, have an if statement that says like, if(MasterAlive == 0){VanishEnemy;}

MasterAlive needs to be a common data. and just set MasterAlive to 0, in the master's finalize.
Got this implemented, but it still crashes upon master death about 20% of the time. Is there any way to do this that doesn't rely on the concurrency happening in the right order?

Code for the record:
Code: [Select]
script_enemy_main
{ //Slave-having enemy
let imgEnemy=GetCurrentScriptDirectory~"img\Enemy.png";
let imgAngle=0;
let shotAngle=0;
let id = GetArgument;

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

task TMove {
while(GetX < GetClipMaxX + 51 && GetX > GetClipMinX - 51) {
if(GetSpeed > 0.5) {
SetSpeed(GetSpeed - 0.05);
}
yield;
}
VanishEnemy;
}

@Initialize
{
SetLife(500);
SetGraphicRect(1,1,32,32);

if(id) {
SetCommonData("Enemy01LeftX", GetX);
SetCommonData("Enemy01LeftY", GetY);
SetCommonData("Enemy01LeftDead", false);
SetAngle(30);
SetSpeed(5);
} else {
SetCommonData("Enemy01RightX", GetX);
SetCommonData("Enemy01RightY", GetY);
SetCommonData("Enemy01RightDead", false);
SetAngle(150);
SetSpeed(5);
}

SetCommonData("Enemy01Side", GetArgument);
ascent(i in 0..4) {
CreateEnemyFromScript("Familiar", GetX, GetY, 0, 0, i*90);
}
TMove;
}

@MainLoop
{
    SetCollisionA(GetX, GetY, 16);
        SetCollisionB(GetX, GetY, 16);
if(id) {
SetCommonData("Enemy01LeftX", GetX);
SetCommonData("Enemy01LeftY", GetY);
} else {
SetCommonData("Enemy01RightX", GetX);
SetCommonData("Enemy01RightY", GetY);
}
yield;
}

@Finalize
{//読みこんだファイルを削除
if(id) {
SetCommonData("Enemy01LeftDead", true);
} else {
SetCommonData("Enemy01RightDead", true);
}
CreateItem(ITEM_SCORE, GetX + rand(-10,10), GetY + rand(10,10));
}

@DrawLoop
{//描画
SetTexture(imgEnemy);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,imgAngle);
DrawGraphic(GetX(),GetY());
SetRenderState(ADD);
SetGraphicAngle(0,0,-imgAngle);
DrawGraphic(GetX(),GetY());
imgAngle+=4;
if(imgAngle>360){imgAngle=0;}
}
}

script_enemy Familiar {
let ImgFam = GetCurrentScriptDirectory ~ "img\Enemy.png";
let imgAngle=0;
let angle = GetArgument;
let id = false;

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


    @Initialize {
        SetLife(100);
        SetScore(0);
        SetDamageRateEx(100, 100, 50, 50);

        LoadGraphic(ImgFam);
        SetTexture(ImgFam);
SetGraphicRect(1,1,32,32);

id = GetCommonData("Enemy01Side");

        TRotate;
        TFire;
    }

    @MainLoop {
    SetCollisionA(GetX, GetY, 8);
        SetCollisionB(GetX, GetY, 8);
if(id) {
if(GetCommonData("Enemy01LeftDead")) {
VanishEnemy;
}
} else {
if(GetCommonData("Enemy01RightDead")) {
VanishEnemy;
}
}
       yield;
    }

@DrawLoop
{//描画
SetTexture(ImgFam);
SetColor(255,255,255);
SetRenderState(ALPHA);
SetGraphicAngle(0,0,imgAngle);
DrawGraphic(GetX(),GetY());
SetRenderState(ADD);
SetGraphicAngle(0,0,-imgAngle);
DrawGraphic(GetX(),GetY());
imgAngle+=4;
if(imgAngle>360){imgAngle=0;}
}

  @Finalize
{//読みこんだファイルを削除
CreateItem(ITEM_SCORE, GetX + rand(-10,10), GetY + rand(10,10));
}

// rotate around the boss
    task TRotate {
let eX = 0;
let eY = 0;
loop {
if(id) {
eX = GetCommonData("Enemy01LeftX");
eY = GetCommonData("Enemy01LeftY");
} else {
eX = GetCommonData("Enemy01RightX");
eY = GetCommonData("Enemy01RightY");
}
SetX(eX + cos(angle) * 50);
SetY(eY + sin(angle) * 50);
yield;
angle += 1.5;
}
}

    task TFire {
        loop {
CreateShot01(GetX, GetY, 1.5, angle+180, RED01, 10);
CreateShot01(GetX, GetY, 2, angle+180, ORANGE01, 10);
            wait(36);
        }
    }
}

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Danmakufu Q&A/Problem Thread v3
« Reply #412 on: March 12, 2010, 12:59:01 AM »
Use GetCommonDataDefault("name",defaultvalue); instead. It returns the value of the data like normal, but if it doesn't exist, then it returns the default value. Set the default value to be out of the playing field and it should work.

Re: Danmakufu Q&A/Problem Thread v3
« Reply #413 on: March 12, 2010, 06:33:14 AM »
Use GetCommonDataDefault("name",defaultvalue); instead. It returns the value of the data like normal, but if it doesn't exist, then it returns the default value. Set the default value to be out of the playing field and it should work.
And this seems to have solved it. Much thanks!

Drake

  • *
Re: Danmakufu Q&A/Problem Thread v3
« Reply #414 on: March 12, 2010, 06:44:26 AM »
Note: I personally find it much, much easier to SCD game-wide common data on loading and just use GCD instead of GCDD because the extra parameter gets very confusing when reading and editing.

In this case GCDD would be used because it's only used in like one instance, but just saying.

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

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Danmakufu Q&A/Problem Thread v3
« Reply #415 on: March 12, 2010, 10:32:51 AM »
Are enemy/boss scripts considered INSIDE a stage or outside?

what I mean is... if you set a task/function or if you load a graphic or declare a variable in the stage script... can you call it from the enemy/boss script? or do you have to declare it in both?
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #416 on: March 12, 2010, 10:39:15 AM »
Even if the enemy script is in the same file as the stage script and called through CreateEnemyFromScript, variables declared in one script will not carry over to the other. You have to use Common Data for that one.
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."

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread v3
« Reply #417 on: March 12, 2010, 10:55:29 AM »
Are enemy/boss scripts considered INSIDE a stage or outside?

what I mean is... if you set a task/function or if you load a graphic or declare a variable in the stage script... can you call it from the enemy/boss script? or do you have to declare it in both?

When a graphic is loaded, it's loaded into memory so that anything can use it. When a graphic is deleted, likewise, nothing can use it anymore. This means you can load all the graphics and sound a stage is going to use in the stage itself. However if you use variables to hold the filepaths of the graphics and sound, those variables won't automatically carry over to other scripts.

For functions and variables that multiple things need to use, you should make them in a separate file and use #include_function in every script that needs them since they don't automatically carry over when you make them in a stage.
<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.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread v3
« Reply #418 on: March 12, 2010, 11:16:14 AM »
For functions and variables that multiple things need to use, you should make them in a separate file and use #include_function in every script that needs them since they don't automatically carry over when you make them in a stage.
One thing I want to note, because I encountered this annoying problem:

You cannot call the same #include_function twice in the same file, even if the file contains seperate scripts.

For example: I have a file with a spell card script that calls familiars. The script for these familiars are contained inside the file so that I can call them with CreateEnemyFromScript and so that I don't have more txt files lying around. Both the boss and the familiar script shall have a set of functions that I stored in a seperate file.
Calling #include_function on this seperate file in both scripts will make danmakufu ignore the second instance. To get around this problem, you can either have all the child scripts be contained in seperate files so you can call CreateEnemyFromFile instead, or you can duplicate the txt file that stores the functions and call #include_function once on the original and once on the copy.
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."

Re: Danmakufu Q&A/Problem Thread v3
« Reply #419 on: March 12, 2010, 09:38:04 PM »
Same problem as above has returned! Same code, and the enemy still causes a fatal game crash upon death on rare occasions. The trigger seems to be the enemy dying while at least one of its slaves is off the left edge of the screen. Any idea what could cause that?