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

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #450 on: November 27, 2009, 04:30:18 PM »
You guys don't need to make a new item script, I already made one argargagargragar

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

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: Danmakufu Q&A/Problem Thread II
« Reply #451 on: November 30, 2009, 12:06:13 AM »
Okay, I'm still relatively new at this, so...
Could someone show me how to create patterns similar to Rumia's Demarcation or Suwako's Mishaguji-Sama? That kind of stuff, yeah.

Re: Danmakufu Q&A/Problem Thread II
« Reply #452 on: November 30, 2009, 02:38:33 AM »
Okay, I'm still relatively new at this, so...
Could someone show me how to create patterns similar to Rumia's Demarcation or Suwako's Mishaguji-Sama? That kind of stuff, yeah.

Creating things similar to Demarcation requires some knowledge of how the CreateShotA series of functions works:

CreateShotA(id, x-position, y-position, delay);
SetShotDataA(id, frame, speed, angle, turn speed, acceleration, minimum/maximum speed, graphic);
FireShot(id);

What SetShotDataA does is tell the bullet what it will do once it's fired. The "frame" parameter is especially important. For example, take the following code:

Code: [Select]
ascent(i in 0..20) {
CreateShotA(i, GetX, GetY, 10);
SetShotDataA(i, 0, 2, GetAngleToPlayer+i*18, 0, 0, 2, RED11);
SetShotDataA(i, 60, 2, GetAngleToPlayer+i*18-90, -1, 0, 2, RED11);
SetShotDataA(i, 90, 2, NULL, 0, 0, 2, RED11);
FireShot(i);
}

Twenty bullets are created at the boss's position. The first SetShotDataA function tells the bullets to fire in a circle as soon as they're created with a speed of 2. Sixty frames later, the bullets will begin turning, and thirty frames after that (frame 90 after shooting), the bullets will travel at whatever angle they had at the time.

To make it look similar to Rumia's Demarcation, simply create another ascent loop, but in the second SetShotDataA function, change the -90 and -1 to +90 and 1, respectively. This will create a mirrored ring of bullets that will intersect with the other one.

Does that help? I can go into SetShotDataA in more detail if you'd like.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread II
« Reply #453 on: November 30, 2009, 02:58:57 AM »
Creating things similar to Demarcation requires some knowledge of how the CreateShotA series of functions works:

CreateShotA(id, x-position, y-position, delay);
SetShotDataA(id, frame, speed, angle, turn speed, acceleration, minimum/maximum speed, graphic);
FireShot(id);

What SetShotDataA does is tell the bullet what it will do once it's fired. The "frame" parameter is especially important. For example, take the following code:

Code: [Select]
ascent(i in 0..20) {
CreateShotA(i, GetX, GetY, 10);
SetShotDataA(i, 0, 2, GetAngleToPlayer+i*18, 0, 0, 2, RED11);
SetShotDataA(i, 60, 2, GetAngleToPlayer+i*18-90, -1, 0, 2, RED11);
SetShotDataA(i, 90, 2, NULL, 0, 0, 2, RED11);
FireShot(i);
}

Twenty bullets are created at the boss's position. The first SetShotDataA function tells the bullets to fire in a circle as soon as they're created with a speed of 2. Sixty frames later, the bullets will begin turning, and thirty frames after that (frame 90 after shooting), the bullets will travel at whatever angle they had at the time.

To make it look similar to Rumia's Demarcation, simply create another ascent loop, but in the second SetShotDataA function, change the -90 and -1 to +90 and 1, respectively. This will create a mirrored ring of bullets that will intersect with the other one.

Does that help? I can go into SetShotDataA in more detail if you'd like.
This also applies to Misyaguzi-sama, doesn't it?

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #454 on: November 30, 2009, 03:09:56 AM »
Yes, but a few angle changes and only the last two Sets are used.

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

Re: Danmakufu Q&A/Problem Thread II
« Reply #455 on: November 30, 2009, 03:15:03 AM »
This also applies to Misyaguzi-sama, doesn't it?

Yes, it does.

Spoiler:
I haven't played MoF yet, so I had to go look it up. colonvee

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: Danmakufu Q&A/Problem Thread II
« Reply #456 on: November 30, 2009, 04:52:45 AM »
Creating things similar to Demarcation requires some knowledge of how the CreateShotA series of functions works:

CreateShotA(id, x-position, y-position, delay);
SetShotDataA(id, frame, speed, angle, turn speed, acceleration, minimum/maximum speed, graphic);
FireShot(id);

What SetShotDataA does is tell the bullet what it will do once it's fired. The "frame" parameter is especially important. For example, take the following code:

Code: [Select]
ascent(i in 0..20) {
CreateShotA(i, GetX, GetY, 10);
SetShotDataA(i, 0, 2, GetAngleToPlayer+i*18, 0, 0, 2, RED11);
SetShotDataA(i, 60, 2, GetAngleToPlayer+i*18-90, -1, 0, 2, RED11);
SetShotDataA(i, 90, 2, NULL, 0, 0, 2, RED11);
FireShot(i);
}

Twenty bullets are created at the boss's position. The first SetShotDataA function tells the bullets to fire in a circle as soon as they're created with a speed of 2. Sixty frames later, the bullets will begin turning, and thirty frames after that (frame 90 after shooting), the bullets will travel at whatever angle they had at the time.

To make it look similar to Rumia's Demarcation, simply create another ascent loop, but in the second SetShotDataA function, change the -90 and -1 to +90 and 1, respectively. This will create a mirrored ring of bullets that will intersect with the other one.

Does that help? I can go into SetShotDataA in more detail if you'd like.

Oh hey, it works. Thanks!

It's fine, you've said plenty. Actually, I already knew some of that ShotA stuff.
It's just that, you know. The knowledge and the application of processes (for lots of things in general) are usually very different things.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #457 on: November 30, 2009, 10:26:57 AM »
People underestimate the usage of CreateShotA. It is godly because it gives allmost all posibilities with parameters. If Object Bullets would have the same functions then object bullets would be godly. And same goes for createshotA, if it was complex programmable then it would be even more godly.

Unless your name is Blargel and insert custom complex functions into your game.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #458 on: November 30, 2009, 01:09:14 PM »
Unless your name is Blargel and insert custom complex functions into your game.

Actually I don't even need those complex custom functions I wrote to make objects behave like ShotAs. I can imitate whatever behavior I want with object bullets and tasks. :D

The only difference is, ShotA is easier to think with, but once someone gets used to controlling the behavior of an object bullet, you can easily surpass the flexibility of a ShotA.
<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.

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #459 on: November 30, 2009, 01:19:24 PM »
I have no idea what's wrong. Help me, onii-sama!

Code: [Select]
#TouhouDanmakufu[Player]
#ScriptVersion[2]
#Menu[Kaguya Houraisan]
#Text[Lunatic Princess. Designed by ChaoStar.]
#Image[.\KaguyaProfile.png]
#ReplayName[Short player name]


script_player_main{

let CSD = GetCurrentScriptDirectory;

let imgPlayer = CSD ~ "KaguyaSheet.png";

let frodo = 0; //frodo is for frames.

let kirk = 0; //kirk is for count.

let ImpossibleRequest = 1;

  @Initialize{
LoadPlayerShotData(GetCurrentScriptDirectory~"Kaguya_shotdata.txt");
LoadGraphic(imgPlayer);
SetPlayerLifeImage(imgPlayer,45,34,59,47);
SetItemCollectLine(128);
SetSpeed(4.6, 1.8);
mainTask;

}

@MainLoop{
SetIntersectionCircle(GetPlayerX,GetPlayerY,0);
if(GetKeyState(VK_USER)==KEY_PUSH){ImpossibleRequest++; if(ImpossibleRequest==6){ImpossibleRequest=1;}}
yield;


}

@Missed{
}

@Spellcard{
}

@DrawLoop{
  SetTexture(imgPlayer);
SetGraphicRect(24,54,64,95);
  DrawGraphic(GetPlayerX(), GetPlayerY());
}

@Finalize{
}



task mainTask{
loop{
if(ImpossibleRequest==1){JewelBranch;} else if(ImpossibleRequest==2){FireCape;} else if(ImpossibleRequest==3){dostuff;} else if(ImpossibleRequest==4){dostuff;} else if(ImpossibleRequest==5){dostuff;}
yield;
}
}

task dostuff{
loop{
yield;
}
}

task JewelBranch;
loop{
redFire;
greenFire;
blueFire;
pinkFire;
yellowFire;
yield;
}

task redFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*3+270,2.6,1,1); kirk += 13;}}frodo++;
}


task greenFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*10+270,2.6,1,3); kirk += 3;}frodo++;
}


task blueFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*30+270,2.6,1,2); kirk += 3;}frodo++;
}

task pinkFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*90+270,2.6,1,4); kirk += 3;}frodo++;
}

task yellowFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,3,sin(kirk)*60+270,2.6,1,5); kirk += 1;}frodo++;
}

task fireLoveLaser{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,270,4,3,6);} frodo++;
}

task FireCape{
loop{
fireLoveLaser;
//fireball;
yield;
}
}










}

script_spell ScriptName{
  @Initialize{
  }
  @MainLoop{
  }
  @Finalize{
  }
}

http://i880.photobucket.com/albums/ac9/Zrathgar/Screenshot2009-11-30at81527AM.png
is the error

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Danmakufu Q&A/Problem Thread II
« Reply #460 on: November 30, 2009, 01:31:05 PM »
I spotted two errors:

One, your JewelBranch task had a ; instead of a {
Two, your redFire task has an extra }

The error was being caused because it couldn't find FireCape, and the reason it couldn't find FireCape is because you had two extra } compared to {.
<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.

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #461 on: November 30, 2009, 02:49:00 PM »
Grah. Now something unexpected happened, and I can't seem to figure it out. uuu~

http://i880.photobucket.com/albums/ac9/Zrathgar/Screenshot2009-11-30at94713AM.png

which came from:

Code: [Select]
#TouhouDanmakufu[Player]
#ScriptVersion[2]
#Menu[Kaguya Houraisanfailure]
#Text[Lunatic Princess. Designed by ChaoStar.]
#Image[.\KaguyaProfile.png]
#ReplayName[Short player name]


script_player_main{

let CSD = GetCurrentScriptDirectory;

let imgPlayer = CSD ~ "KaguyaSheet.png";

let frodo = 0; //frodo is for frames.

let kirk = 0; //kirk is for count.

let ImpossibleRequest = 1;

  @Initialize{
LoadPlayerShotData(GetCurrentScriptDirectory~"Kaguya_shotdata.txt");
LoadGraphic(imgPlayer);
SetPlayerLifeImage(imgPlayer,45,34,59,47);
SetItemCollectLine(128);
SetSpeed(4.6, 1.8);
mainTask;

}

@MainLoop{
SetIntersectionCircle(GetPlayerX,GetPlayerY,0);
if(GetKeyState(VK_USER)==KEY_PUSH){ImpossibleRequest++; if(ImpossibleRequest==6){ImpossibleRequest=1;}}
yield;


}

@Missed{
}

@Spellcard{
}

@DrawLoop{
  SetTexture(imgPlayer);
SetGraphicRect(24,54,64,95);
  DrawGraphic(GetPlayerX(), GetPlayerY());
}

@Finalize{
}



task mainTask{
loop{
if(ImpossibleRequest==1){JewelBranch;} else if(ImpossibleRequest==2){FireCape;} else if(ImpossibleRequest==3){dostuff;} else if(ImpossibleRequest==4){dostuff;}else if(ImpossibleRequest==5){dostuff;}
yield;
}
}

task dostuff{
loop{
yield;
}
}

task JewelBranch{
loop{
redFire;
greenFire;
blueFire;
pinkFire;
yellowFire;
yield;
}
}

task redFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*3+270,2.6,1,1); kirk += 13;}frodo++;
}


task greenFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%10==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*10+270,2.6,1,3); kirk += 3;}frodo++;
}


task blueFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%10==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*30+270,2.6,1,2); kirk += 3;}frodo++;
}

task pinkFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%10==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*90+270,2.6,1,4); kirk += 3;}frodo++;
}

task yellowFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%10==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,3,sin(kirk)*60+270,2.6,1,5); kirk += 1;}frodo++;
}

task fireLoveLaser{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,270,4,3,6);} frodo++;
}

task FireCape{
loop{
fireLoveLaser;
//fireball;
yield;
}

}



}

script_spell ScriptName{
  @Initialize{
  }
  @MainLoop{
  }
  @Finalize{
  }
}

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #462 on: November 30, 2009, 03:43:04 PM »
I don't know exactly what it is supposed to look like, but by skimming over you script, I noticed that you have included if(frodo%1==0) several times. Frodo being a variable that, as far as I can tell, has only integers as values, this condition is always true. Should the problem be that Kaguya fires too rapidly, it may stem from this.  :-\

If that's not the problem, please elaborate what exactly doesn't work as intended there so we can help you.
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."

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #463 on: November 30, 2009, 04:16:48 PM »
I don't know exactly what it is supposed to look like, but by skimming over you script, I noticed that you have included if(frodo%1==0) several times. Frodo being a variable that, as far as I can tell, has only integers as values, this condition is always true. Should the problem be that Kaguya fires too rapidly, it may stem from this.  :-\

If that's not the problem, please elaborate what exactly doesn't work as intended there so we can help you.

No. It operates correctly in the pre-alpha version, before I added the variables and such.

old script( can also be found in my scripts thread )
Code: [Select]
#TouhouDanmakufu[Player]
#ScriptVersion[2]
#Menu[Kaguya Houraisan]
#Text[Lunatic Princess. Designed by ChaoStar.]
#Image[.\KaguyaProfile.png]
#ReplayName[Short player name]


script_player_main{

let CSD = GetCurrentScriptDirectory;

let imgPlayer = CSD ~ "KaguyaSheet.png";

let frodo = 0; //frodo is for frames.

let kirk = 0; //kirk is for count.

  @Initialize{
LoadPlayerShotData(GetCurrentScriptDirectory~"Kaguya_shotdata.txt");
LoadGraphic(imgPlayer);
SetPlayerLifeImage(imgPlayer,45,34,59,47);
SetItemCollectLine(128);
SetSpeed(4.6, 1.8);
mainTask;

}

@MainLoop{
SetIntersectionCircle(GetPlayerX,GetPlayerY,0);
yield;


}

@Missed{
}

@Spellcard{
}

@DrawLoop{
  SetTexture(imgPlayer);
SetGraphicRect(24,54,64,95);
  DrawGraphic(GetPlayerX(), GetPlayerY());
}

@Finalize{
}



task mainTask{
loop{
redFire;
greenFire;
blueFire;
pinkFire;
yellowFire;
yield;
}


task redFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*3+270,2.6,1,1); kirk += 13;}}frodo++;
}


task greenFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*10+270,2.6,1,3); kirk += 3;}frodo++;
}


task blueFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*30+270,2.6,1,2); kirk += 3;}frodo++;
}

task pinkFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*90+270,2.6,1,4); kirk += 3;}frodo++;
}

task yellowFire{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,3,sin(kirk)*60+270,2.6,1,5); kirk += 1;}frodo++;
}

//task redFocus{
//if((GetKeyState(VK_SLOWMOVE) == KEY_PUSH || GetKeyState(VK_SLOWMOVE) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY+5,6,270,3,1,1);} else {redFire;}frodo++;
//}



}

script_spell ScriptName{
  @Initialize{
  }
  @MainLoop{
  }
  @Finalize{
  }
}

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Danmakufu Q&A/Problem Thread II
« Reply #464 on: November 30, 2009, 04:42:44 PM »
Hmm, I think I'm on to something again!


   task mainTask{
   loop{
   if(ImpossibleRequest==1){JewelBranch;} else if(ImpossibleRequest==2){FireCape;} else if(ImpossibleRequest==3){dostuff;} else if(ImpossibleRequest==4){dostuff;}else if(ImpossibleRequest==5){dostuff;}
   yield;
      }
   }

   task JewelBranch{
      loop{
   redFire;
   greenFire;
   blueFire;
   pinkFire;
   yellowFire;   
   yield;
      }
   }

The number of times the task JewelBranch runs per frame increases by 1 every frame. After a couple of seconds, the task JewelBranch is run several hundred times per frame, thus giving you the cluster of bullets and the extreme slowdown you're experiencing.

Or at least I believe so. Keep in mind that I am the loser who cannot run danmakufu because he hasn't bought a new PC yet.  :V


...and I still don't see the sense of a condition that reads if(true=true)...
« Last Edit: November 30, 2009, 04:59:07 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 II
« Reply #465 on: November 30, 2009, 04:51:13 PM »
I cannot run Danmakufu because it still crashes every time I try to load something.

Yes, I already tried running it through config.exe...
Yes, I have AppLocale...

And yet...

Also, I had a really odd spell card idea: A card based on the Bubbler LV3 from Cave Story.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #466 on: November 30, 2009, 04:52:27 PM »
Yeah, just get rid of the loop and yield in JewelBranch.

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

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #467 on: December 01, 2009, 12:23:17 AM »
Something's wrong; the Sanae player scripts refuse to show up during player selection...

Re: Danmakufu Q&A/Problem Thread II
« Reply #468 on: December 01, 2009, 01:21:39 AM »
Something's wrong; the Sanae player scripts refuse to show up during player selection...

Does the script you're trying to run say
Code: [Select]
#Player[REIMU,MARISA]near the top? If so, change everything inside the brackets to FREE -- that should fix it.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #469 on: December 01, 2009, 01:31:10 AM »
Actually, no, Sakuya showed up just fine.

(Turns out I should have thought of pressing left or right sooner  :-\)

Mounting Jaggis

  • It's a dinosaur rodeo!
  • Yeee haww!
Re: Danmakufu Q&A/Problem Thread II
« Reply #470 on: December 01, 2009, 09:29:56 AM »
Too lazy to check 50 pages, does anyone have the translation of the config? I want to know what everything else does. I can't seem to find one anywhere, not even on the wiki.
« Last Edit: December 01, 2009, 09:33:45 AM by Skye »


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 II
« Reply #471 on: December 01, 2009, 10:05:38 AM »
How do you check what player you're using in a script, mostly used for conditional dialogues...

using
GetPlayerType(_____)? and what do I put in the blank? menu name or replay name?
also, how about
GetPlayerScriptName()?
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Nimble

  • Broken English Fox
  • Rushing toward the bullet!
    • Viewmix
Re: Danmakufu Q&A/Problem Thread II
« Reply #472 on: December 01, 2009, 01:04:10 PM »
I using item spawning system like in 東方意地奴 ~ Touhou Ijiyatsu and got some ... funny problem.

If I cast spellcard (bomb) everything stop except of effect (include item) during casting. How can I stop them too?

ChaoStar

  • Dark History Boy
Re: Danmakufu Q&A/Problem Thread II
« Reply #473 on: December 01, 2009, 03:02:39 PM »
Code: [Select]
#TouhouDanmakufu[Player]
#ScriptVersion[2]
#Menu[Kaguya Houraisan]
#Text[Lunatic Princess. Designed by ChaoStar.]
#Image[.\KaguyaProfile.png]
#ReplayName[Short player name]


script_player_main{

let CSD = GetCurrentScriptDirectory;

let imgPlayer = CSD ~ "KaguyaSheet.png";

let frodo = 0; //frodo is for frames.

let kirk = 0; //kirk is for count.

let ImpossibleRequest = 1;


  @Initialize{
LoadPlayerShotData(GetCurrentScriptDirectory~"Kaguya_shotdata.txt");
LoadGraphic(imgPlayer);
SetPlayerLifeImage(imgPlayer,45,34,59,47);
SetItemCollectLine(128);
SetSpeed(4.6, 1.8);
mainTask;

}

@MainLoop{
SetIntersectionCircle(GetPlayerX,GetPlayerY,0);
if(GetKeyState(VK_USER)==KEY_PUSH){ImpossibleRequest++; if(ImpossibleRequest==6){ImpossibleRequest=1;}}
yield;


}

@Missed{
}

@Spellcard{
}

@DrawLoop{
  SetTexture(imgPlayer);
SetGraphicRect(24,54,64,95);
  DrawGraphic(GetPlayerX(), GetPlayerY());
}

@Finalize{
}



task mainTask{
loop{
if(ImpossibleRequest==1){JewelBranch;} else if(ImpossibleRequest==2){FireCape;} else if(ImpossibleRequest==3){DragonNecklace;} else if(ImpossibleRequest==4){StoneBowl}else if(ImpossibleRequest==5){CowryShell;}
yield;
}
}

task dostuff{
loop{
yield;
}
}



task JewelBranch{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%1==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*3+270,2.6,1,1); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*10+270,2.6,1,3); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*30+270,2.6,1,2); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*90+270,2.6,1,4); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,3,sin(kirk)*60+270,2.6,1,5); kirk += 13;}frodo++;
}


task FireCape{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%3==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,8,rand_int(250,290),10,3,6); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*20+250,4.5,1,7); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,6,sin(kirk)*30+290,4.5,1,7); CreatePlayerShot01(GetPlayerX+rand_int(-30,30),GetPlayerY+rand_int(-30,30),1,270+rand_int(-10,10),4.5,1,6); kirk += 13;} frodo++;
}

task DragonNecklace{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%3==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY,7,sin(kirk)*30+250,2.8,5,8); CreatePlayerShot01(GetPlayerX,GetPlayerY,7,sin(kirk)*30+290,2.8,5,11); CreatePlayerShot01(GetPlayerX,GetPlayerY,9,atan2(GetEnemyY-GetPlayerY, GetEnemyX-GetPlayerX),2.8,5,9); CreatePlayerShot01(GetPlayerX,GetPlayerY,7,sin(kirk)*30+rand_int(200,340),2.8,5,10); kirk += 13;} frodo++;
}

task StoneBowl{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%3==0) {BuddhaBullet(GetPlayerX,GetPlayerY,2.5,270+kirk,2.5,255,13); BuddhaBullet(GetPlayerX,GetPlayerY,2.5,235+kirk,2.5,255,13); BuddhaBullet(GetPlayerX,GetPlayerY,2.5,190+kirk,2.5,255,13); BuddhaBullet(GetPlayerX,GetPlayerY,2.5,145+kirk,2.5,255,13); BuddhaBullet(GetPlayerX,GetPlayerY,2.5,100+kirk,2.5,255,13); BuddhaBullet(GetPlayerX,GetPlayerY,2.5,55+kirk,2.5,255,13); CreatePlayerShot01(GetPlayerX,GetPlayerY,2.5,10+kirk,2.5,255,13); BuddhaBullet(GetPlayerX,GetPlayerY,2.5,-35+kirk,2.5,255,13); kirk += 13;} frodo++;
}


task CowryShell{
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD) && frodo%3==0) {CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk)*10+270,6,1,14); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk+180)*10+270,6,1,15); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk+180)*30+270,2.5,1,2); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk+180)*35+270,2.5,1,2); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk+180)*40+270,2.5,1,2); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk+180)*45+270,2.5,1,2); CreatePlayerShot01(GetPlayerX,GetPlayerY-5,7,sin(kirk+180)*50+270,2.5,1,2);kirk += 13;} frodo++;
}

task BuddhaBullet(x,y,v,dir,damage,penetration,graphic){
let obj = Obj_Create(OBJ_SHOT);

Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
Obj_SetAngle(obj,dir);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetBombResist(obj,true);
ObjShot_SetDamage(obj, damage);
ObjShot_SetPenetration(obj, penetration);
while(!Obj_BeDeleted(obj)){
if((GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD)){
ObjShot_SetDamage(obj,1+picard);
picard += 0.1;

}


yield;

}
}


}

script_spell ScriptName{
  @Initialize{
  }
  @MainLoop{
  }
  @Finalize{
  }
}

There's an error with Picard on line 106, and I don't know what I did wrong~ Help me, onii-sama!

Re: Danmakufu Q&A/Problem Thread II
« Reply #474 on: December 01, 2009, 03:11:26 PM »
Doesn't look like you defined that variable anywhere.

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #475 on: December 01, 2009, 08:13:33 PM »
Whenever I try to use the Expanded Shot Replace script, it doesn't work properly. What might be wrong?

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread II
« Reply #476 on: December 01, 2009, 08:44:22 PM »
Whenever I try to use the Expanded Shot Replace script, it doesn't work properly. What might be wrong?

What is "not proper" ?

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #477 on: December 01, 2009, 08:48:35 PM »
Script fails...

Code: [Select]
#TouhouDanmakufu
#Title[Force Round]
#Text[Based on something I can't remeber the name of]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main{

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

@Initialize{
SetLife(1000);
SetTimer(40);
SetScore(1000);
SetMovePosition01(GetCenterX,GetCenterY,5);
LoadGraphic(imgBoss);
shotinit;
mainTask;
let xmax = 3;
}

@MainLoop{

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{
yield;
fire;
}

task fire{
let x = 0;
let dirmod = 0;
xmax++;
while(x<xmax){
homingshot(GetX+25*cos(GetAngleToPlayer+dirmod),GetY+25*sin(GetAngleToPlayer+dirmod),0,0,YELLOW214,0);
dirmod+=360/xmax;
x++;
}
x=0;
dirmod=0;
wait(45);
}

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

task homingshot(x,y,v,dir,graphic,delay){
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
Obj_SetAngle(obj,dir);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);

while(Obj_BeDeleted(obj)==false){
Obj_SetAngle(obj,atan2(GetPlayerY - Obj_GetY(obj), GetPlayerX - Obj_GetX(obj)));
ObjShot_SetGraphic(obj,YELLOW214);
Obj_SetSpeed(obj,1);
wait(30);
yield;
}
}
}
This pattern is supposed to produce slow-moving aimed large stars.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread II
« Reply #478 on: December 01, 2009, 09:03:34 PM »
First thing, move let xmax = 3; to where CSD and imgBoss are. Doesn't look to be the problem because it yields first, but still. Where/how exactly does it fail...?

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

AweStriker Nova

  • Star Sign "Thunder Constellation"
Re: Danmakufu Q&A/Problem Thread II
« Reply #479 on: December 01, 2009, 09:25:31 PM »
"#include_function(で(two kanji)するフ(more katakana)[file path](more japanese text)".

Can't find any of the other characters...
« Last Edit: December 01, 2009, 09:46:16 PM by AweStriker Nova »