Author Topic: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)  (Read 269169 times)

Chuckolator

  • ex-perfecter, good times
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #390 on: December 26, 2012, 07:10:25 AM »
Is there any way to play with frameskip like the real games? I wouldn't be surprised if I was getting 20FPS at some points, and 1/2 frameskip would make it tolerable.
Aiming to perfect every stage in Touhou. loljk don't care anymore You can find my perfects here or here.
Best perfects so far include UFO 6, MoF 4 and IN 6A.

formerly known as Seiga Kaku

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #391 on: December 26, 2012, 08:18:29 AM »
It's right there in the config.exe.

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

Chuckolator

  • ex-perfecter, good times
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #392 on: December 26, 2012, 06:14:35 PM »
how did I not see that before <_<
Aiming to perfect every stage in Touhou. loljk don't care anymore You can find my perfects here or here.
Best perfects so far include UFO 6, MoF 4 and IN 6A.

formerly known as Seiga Kaku

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #393 on: December 31, 2012, 08:43:55 PM »
Okay. Danmakufu... CRASH REPORT!

Attached is the Wine Backtrace! I will post the player script ASAP.

Background: I have a player script that changes forms when you press the C button. Each individual form has different shots, bombs, etc. However, two of the possible forms currently do not have a set bomb (it is not even called) and all of the bombs use the same .png file for their shots. The crash occurs when bombing in a different form twice. That means, bomb in one form, change to another form, then bomb in that form, then bomb in that form again. I do not know the cause, but it is not the incorrect Obj_Effect syntax (I have tested this already, and the usage of Obj_SetSpeed/Angle/Position with effect objects is not the cause of the crash).

All and any help would be appreciated if possible.

http://pastebin.com/NGdes41Q
« Last Edit: December 31, 2012, 10:44:33 PM by Sparen »

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #394 on: January 02, 2013, 06:01:29 AM »
I've been following this tutorial
http://www.youtube.com/watch?v=B1Ok4kkhY38

And came across a problem. The image will not load. I tried tweaking everything, but the image for the boss just doesn't appear.
http://pastebin.com/QyEBfkcN

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #395 on: January 02, 2013, 06:29:53 AM »
GetCurrentScriptDirectory ~ ("script   utorialzeke1.png") probably doesn't exist unless you did something really weird making directories. It's likely "script   utorialzeke1.png" (as an absolute path) or GetCurrentScriptDirectory ~ "zeke1.png" (as a relative path).

Also wait(60); yield; is just wait(61) or loop(61){ yield; }

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

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #396 on: January 02, 2013, 07:07:00 AM »
ah, that fixed it. Thanks!  :derp:

Atfyntify

  • Danmakufu worshipper
  • I worship Danmakufu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #397 on: January 02, 2013, 08:25:02 AM »
http://pastebin.com/EYFxgz4T

I have a problem with the sprite animation there o3o

can anyone help?
I CAN'T WAIT FOR TOUHOU 14!

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #398 on: January 02, 2013, 10:27:08 AM »
You never defined f, silly.

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

Atfyntify

  • Danmakufu worshipper
  • I worship Danmakufu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #399 on: January 02, 2013, 11:34:49 AM »
You never defined f, silly.
Oh haha, dumb problem. Fixed. thanks drake. c:
Oh wait its not exactly fixed yet. ._.
http://pastebin.com/1H3rNCHs

I have a problem with the Superbullet. .n.
welp I'm still new at writing scripts lol
« Last Edit: January 02, 2013, 11:50:47 AM by Atfyntify »
I CAN'T WAIT FOR TOUHOU 14!

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #400 on: January 02, 2013, 01:10:30 PM »
You forget to include your function file and to call it in @Initialize.  :)

Byronyello

  • "The Western Non-Otaku That Respects and Likes Touhou"
  • I guess that'd be my title in a Touhou game...
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #401 on: January 02, 2013, 03:38:37 PM »
I've been wondering, how would you create a pentagram, in order to reflect Sanae's types of spells? Actual code is unnecessary, unless it helps with explaining it. Thanks in advance.
(Strike-through indicates a clear)
Hard Clears: EoSD, PCB, IN, MoF, SA, UFO, TD, DDC.
Lunatic Clears: Someday, perhaps.
Extra Clears: EoSD, PCB, PCB Phantasm, IN, MoF, SA, UFO, TD, DDC.

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #402 on: January 02, 2013, 04:30:50 PM »
The easiest manner to create a pentagram is to find the 5 points and then to rely them (ther order is 1,3,5, and 4). Besides,you can use invisible familiars for this. For a regular pentagram, finding the points is easy, you just have to use sine and cosine and add 360/5 each times.  :)
« Last Edit: January 02, 2013, 04:33:08 PM by Lunasa Prismriver »

Atfyntify

  • Danmakufu worshipper
  • I worship Danmakufu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #403 on: January 03, 2013, 08:09:18 AM »
You forget to include your function file and to call it in @Initialize.  :)
Hmm I don't exactly get what you mean? I do have @Initialize. And what function file? o:
sorry for asking these questions lol I'm still sorta new at writing scripts
I CAN'T WAIT FOR TOUHOU 14!

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #404 on: January 03, 2013, 11:20:36 AM »
Forgot all what I said in my previous post. I misread your code :ohdear:
 
Your supershot function is full of typo :
Code: [Select]
task Superbullet(x,y,v,dir,graphic,delay){
                       let obj - obj_create(OBJ_SHOT);
               Obj_SetPosition(obj,3,5);
               Obj_SetSpeed(obj,0.9);
               Obj_SetAngle(obj,54);
               Obj Shot_Setgraphic(obj,AQUA01);
               Obj Shot_SetDelay(obj,30);
          } 
You've put "-" instead of "=" at "let obj".
The two last lines have a useless space between Obj and Shot.
You forget the capital at SetGraphic and Obj_Create.
Your task is asking for arguments but you're not using them. So here a better code  ;) :
Code: [Select]
task Superbullet(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);
          } 
I hope I help you.  :)
« Last Edit: January 03, 2013, 12:17:17 PM by Lunasa Prismriver »

Byronyello

  • "The Western Non-Otaku That Respects and Likes Touhou"
  • I guess that'd be my title in a Touhou game...
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #405 on: January 03, 2013, 03:03:34 PM »
The easiest manner to create a pentagram is to find the 5 points and then to rely them (ther order is 1,3,5, and 4). Besides,you can use invisible familiars for this. For a regular pentagram, finding the points is easy, you just have to use sine and cosine and add 360/5 each times.  :)

Hmm. That's what I did, just not with invisible familiars. I'll give it another try and see what happens. Oh, and: "you just have to use sine and cosine and add 360/5 each times" isn't helpful. If I didn't know what you meant, I'd be wondering 'use sine and cosine how?' and 'add 360/5 to what?'.
(Strike-through indicates a clear)
Hard Clears: EoSD, PCB, IN, MoF, SA, UFO, TD, DDC.
Lunatic Clears: Someday, perhaps.
Extra Clears: EoSD, PCB, PCB Phantasm, IN, MoF, SA, UFO, TD, DDC.

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #406 on: January 03, 2013, 03:42:47 PM »
Yeah, I'll explain this more.
Since I'm not very good at english, here a little scheme for explain the idea how find the coordinates of the five points.
[attach=1]

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #407 on: January 03, 2013, 09:05:10 PM »
http://pastebin.com/H0t0sASK

I keep getting an error saying
"script_enemy_main<complete gibberish in square symbols>"
I have all of my brackets and quotes in order. What did I mess up on? I finished working on adding movement patterns.

never mind, I spotted it, I forgot to place a bracket

Actually that didn't fix it.... darn it.
« Last Edit: January 03, 2013, 09:30:35 PM by Captainragequit »

Alicirno

  • Seer of Heart
  • Paruparuparu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #408 on: January 03, 2013, 09:52:41 PM »
Code: [Select]
task movement{
loop{
SetMovePosition01(GetCenterX -100,120,5);
wait(120);
SetMovePosition01(GetCenterX +100,120,5);
wait(120);
yield;
}

to
Code: [Select]
task movement{
loop{
SetMovePosition01(GetCenterX -100,120,5);
wait(120);
SetMovePosition01(GetCenterX +100,120,5);
wait(120);
}
}
There was a bracket missing at the end of the movement task. It worked after I added it. I removed an unnecessary yield; (I'm not sure where you put the extra bracket)

Also, doing
Code: [Select]
wait(30);
yield;
is basically telling the script to do
Code: [Select]
wait(31);

Atfyntify

  • Danmakufu worshipper
  • I worship Danmakufu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #409 on: January 04, 2013, 08:29:45 AM »
Forgot all what I said in my previous post. I misread your code :ohdear:
 
Your supershot function is full of typo :
Code: [Select]
task Superbullet(x,y,v,dir,graphic,delay){
                       let obj - obj_create(OBJ_SHOT);
               Obj_SetPosition(obj,3,5);
               Obj_SetSpeed(obj,0.9);
               Obj_SetAngle(obj,54);
               Obj Shot_Setgraphic(obj,AQUA01);
               Obj Shot_SetDelay(obj,30);
          } 
You've put "-" instead of "=" at "let obj".
The two last lines have a useless space between Obj and Shot.
You forget the capital at SetGraphic and Obj_Create.
Your task is asking for arguments but you're not using them. So here a better code  ;) :
Code: [Select]
task Superbullet(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);
          } 
I hope I help you.  :)



I replaced what I wrote with yours, but I get this error :(
I CAN'T WAIT FOR TOUHOU 14!

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #410 on: January 04, 2013, 10:06:40 AM »
You must put arguments like this :
Code: [Select]
Superbullet(GetX,GetY,2,GetAngleToPlayer,AQUA22,10);
http://pastebin.com/H0t0sASK

I keep getting an error saying
"script_enemy_main<complete gibberish in square symbols>"
I have all of my brackets and quotes in order. What did I mess up on? I finished working on adding movement patterns.

never mind, I spotted it, I forgot to place a bracket

Actually that didn't fix it.... darn it.

In movement task, you forget a "}".
« Last Edit: January 04, 2013, 10:11:37 AM by Lunasa Prismriver »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #411 on: January 05, 2013, 12:08:39 AM »
@Atfyntify

Are you using Japanese Locale? Looks like Chinese to me. The error messages won't make much sense unless you are using Japanese Locale, and that may hamper future translation of the error messages.

Just a suggestion.

Byronyello

  • "The Western Non-Otaku That Respects and Likes Touhou"
  • I guess that'd be my title in a Touhou game...
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #412 on: January 05, 2013, 03:22:44 AM »
Yeah, I'll explain this more.
Since I'm not very good at english, here a little scheme for explain the idea how find the coordinates of the five points.
[attach=1]
Eh.. I already knew what you meant. I was just saying that when you're exaplaining it to others, you won't want to say: "use sine and cosine and add 360/5 each times". I say this because I imagine a lot of people who can't use Google properlyneed help won't know what sine/cosine even do, never mind how to use them in the context of a game.

Anyway, I'm wondering how one would go about finding the path that the familiar(s) would have to take? Off the top of my head:
Code: [Select]
// assume we have a 'wait' task, a 'sqrt' function and a 'spawnBullet' function.
task TMoveFamiliar
{
//This is where the familarA = Obj_Create(OBJ_EFFECT) etc. goes.
//The radius of the 5 points from the boss is 100 pixels.

//Not sure whether this is the correct syntax for creating empty arrays... :P
let xPositions = [];
let yPositions = [];
let angles = [];
let distanceToNext[];
let radius = 100;

ascent(i in 0..5)
{
xPositions[i] = GetX+radius*cos(144*i);
yPositions[i] = GetY+radius*cos(144*i);
if(i!=5)
{
angles[i] = atan2(yPositions[i+1]-yPositions[i], xPositions[i+1]-xPositions[i]);
distanceToNext[i] = sqrt((xPositions[i]-xPositions[i+1])^2+(yPositions[i]-yPositions[i+1])^2);
} else {
angles[i] = atan2(yPositions[0]-yPositions[i], xPositions[0]-xPositions[i]);
distanceToNext[i] = sqrt((xPositions[i]-xPositions[0])^2+(yPositions[i]-yPositions[0])^2);
}
}

let starCreateTime = 120; //time it takes to make the star in frames.
ascent(i in 0..5)
{
SetAngle(angles[i]);
SetSpeed(distanceToNext[i]/(starCreateTime/5));
wait(starCreateTime/5);
spawnBullet(args);
}
}
Do you think this would work?

Also, I realise that all of the values in the 'distanceToNext' array will be the same, by virtue of being a regular pentagram. I'll clean it up when I'm properly coding it.
(Strike-through indicates a clear)
Hard Clears: EoSD, PCB, IN, MoF, SA, UFO, TD, DDC.
Lunatic Clears: Someday, perhaps.
Extra Clears: EoSD, PCB, PCB Phantasm, IN, MoF, SA, UFO, TD, DDC.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #413 on: January 05, 2013, 05:59:56 AM »
You can do it without any fancy arrays, but yeah that's it. Each next line in the star is 144 degrees in the circle, so each chord that makes up the star is going to have the same length. There's a way to get the value other ways, but notice the chord from 72 degrees to -72 degrees in the previous picture makes a vertical line, and both are clearly the same distance from the zero-angle/origin. Since sin(72) is the vertical distance from the origin, just double it to get the chord length for the unit circle. Then you can multiply by the radius of the circle.
Because the star begins straight, you only add half the "turning" angle to get your first angle. You can see the turning angle is 144 (but you can figure it out as 360 - 36 + 180).

The code would be like:
Code: [Select]
task star{
   let radius = 100;
   let chord = sin(72)*2*radius;
   let fam = Obj_Create(OBJ_EFFECT);
   Obj_SetPosition(fam, GetEnemyX, GetEnemyY - 100);
   let time = 150;
   ascent(i in 0..5){
      Obj_SetSpeed(fam, chord/(time/5));
      Obj_SetAngle(fam, 72 + i*144);
      loop(time/5){ yield; }
   }
   Obj_Delete(fam);
}
Of course the actual bullets part is missing, but you can do that a few different ways.

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

Pepperized

  • Youmunerd
  • I'm not very good at danmaku.
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #414 on: January 05, 2013, 05:41:41 PM »
Trying to run a stage script that executes enemy scripts.

I'm getting an error message saying script_enemy_main(bunch'a moonrunes)

I have checked the { }s and they are fine.

Enemy
Code: [Select]
script_enemy_main{

let spin = 0;
let CSD = GetCurrentScriptDirectory;
let imgFam = CSD ~ "system\fam.png";



@Initialize{
SetLife(3000);
LoadGraphic(imgFam);
mainTask;
}

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

@DrawLoop{

SetTexture(imgFam);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,235,215);
SetGraphicScale(0.1,0.1);
SetGraphicAngle(0,0,spin);
DrawGraphic(GetX,GetY);
spin-=10


}

@BackGround{
}

@Finalize{
DeleteGraphic(imgFam);
}

task mainTask{
yield;
movement;
fire;
}

task fire{
loop{
let x = 0;
while(x<7){
CreateShot02(GetX,GetY,0.5,GetAngleToPlayer,0.02,3,RED01,0);
CreateShot02(GetX,GetY,0.5,GetAngleToPlayer+20,0.02,3,RED01,0);
CreateShot02(GetX,GetY,0.5,GetAngleToPlayer-20,0.02,3,RED01,0);
x++;
yield;
wait(2);

}
x = 0;
wait(30);
yield;
}
}

task movement{
loop{
SetMovePositionHermite(GetX+100,GetY,300,90,300,270,40);
wait(240);
SetMovePosition01(GetClipMaxX,GetY,2);
wait(240);
yield;
}
}

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

}

Stage
Code: [Select]
#TouhouDanmakufu[Stage1]
#Title[Stage1]
#Text[How to make stages in Danmakufu]
#Image[]
#Background[]
#BGM[]
#Player[FREE]
#ScriptVersion[2]

script_stage_main{

function Wait(let frames){
loop(frames){yield;}
}

function WaitForZeroEnemy{
while(GetEnemyNum != 0){yield;}
}

task stage{
Wait(120);
CreateEnemyFromFile(GetCurrentScriptDirectory~"enemy01.txt", GetCenterX-100, GetClipMinY, 0, 0, 0);
CreateEnemyFromFile(GetCurrentScriptDirectory~"enemy01.txt", GetCenterX+100, GetClipMinY, 0, 0, 0);
WaitForZeroEnemy;
CreateEnemyFromScript("enemy01", GetCenterX, GetCenterY, 0, 0, 0);
WaitForZeroEnemy;
CreateEnemyBossFromFile(GetCurrentScriptDirectory~"elenna.txt", 0, 0, 0, 0, 0);
WaitForZeroEnemy;
Wait(60);
Clear;
}

@Initialize{
stage;
}
@MainLoop{
yield;
}
@Background{

}
@Finalize{

}
}
Code: [Select]
Moedan Card Combinations
"If you cannot do any better than this replay during a serious run, I feel sorry for you." - Drake

;~;

Pepperized

  • Youmunerd
  • I'm not very good at danmaku.
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #415 on: January 05, 2013, 05:46:11 PM »
Well this is embaressing.

I had #TouhouDanmakufu[Stage1] instead of [Stage]

Woops
Moedan Card Combinations
"If you cannot do any better than this replay during a serious run, I feel sorry for you." - Drake

;~;

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #416 on: January 05, 2013, 07:19:24 PM »
Okay, a player script question.
My player script changes the character when you press C, and all of the characters have different bombs. If you are hit, you revert to a specific character. How can I alter it so that you deathbomb with the character you are in?

In script player main
Code: [Select]
  let veetype=0; //0=Veemon, 1=Exveemon 2=Lighdramon, 3=Fladramon, 4=Magnamon
In Initialize
Code: [Select]
    SetRebirthFrame(20); //Deathbomb time is a third of a second
    SetRebirthFrameReduction(0); //Make sure that death bomb time isn't reduced every deathbomb
In Main Loop
Code: [Select]
     if(GetKeyState(VK_USER)==KEY_PUSH){
      if(veetype < 4){
veetype++;
      }else{ //For Magnamon to ExVee
veetype = 1;
      }
    }
Code: [Select]
  @Missed {
    SetRebirthFrame(30);
    veetype = 0;
    SetSpeed(3.5,1);
  }
  @SpellCard {
    if(veetype==0){CutIn(KOUMA, "Three Ray Vee Blaster", img_cutinV);
      UseSpellCard("VeeBlaster", 0);
    }
    if(veetype==1){CutIn(KOUMA, "X Laser", img_cutinX);
      UseSpellCard("XLaser", 0);
    }
    if(veetype==2){CutIn(KOUMA, "Lightning Discharge", img_cutinL);
      UseSpellCard("LightningDischarge", 0);
    } //No pun intended
    if(veetype==3){CutIn(KOUMA, "Triple Flame Wave", img_cutinF);
      UseSpellCard("FlameWave", 0);
    }
    if(veetype==4){CutIn(KOUMA, "Holy Wipeout", img_cutinM);
      UseSpellCard("HolyWipeout", 0);
    }
  }
The above statements all control the deaths, bombs, and player forms. The question is, how do I alter it so that I can death bomb with the character in play? Or is there an "if(!"DEATHBOMB"){}" method? (there's OnBomb, but the player deathbombs after he has already been hit and the stuff has been executed.
« Last Edit: January 05, 2013, 07:21:24 PM by Sparen »

Lunasa Prismriver

  • Poltergeist Violinist
  • Himorogi, Burn in Violet
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #417 on: January 05, 2013, 09:53:54 PM »
Code: [Select]
@SpellCard{
 if(IsLastSpell == true){
  CutIn(KOUMA, "Last Spell Bomb", img_cutinL);
  UseSpellCard("Last Spell Bomb", 0);
 }else{
  CutIn(KOUMA, "Lightning Discharge", img_cutinL);
  UseSpellCard("LightningDischarge", 0);
 }
}

Other useful functions for players scripts : http://dmf.shrinemaiden.org/wiki/Character_Script_Functions_(0.12m)#IsLastSpell
« Last Edit: January 05, 2013, 10:05:59 PM by Lunasa Prismriver »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #418 on: January 05, 2013, 10:26:17 PM »
Well this is embaressing.

I had #TouhouDanmakufu[Stage1] instead of [Stage]

Woops
You also have spin-=10 without a semicolon. And please, next time put whole scripts and long segments of code into pastebin.

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

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #419 on: January 05, 2013, 11:05:16 PM »
Code: [Select]
@SpellCard{
 if(IsLastSpell == true){
  CutIn(KOUMA, "Last Spell Bomb", img_cutinL);
  UseSpellCard("Last Spell Bomb", 0);
 }else{
  CutIn(KOUMA, "Lightning Discharge", img_cutinL);
  UseSpellCard("LightningDischarge", 0);
 }
}

This code actually doesn't help at all; I'm not trying to have a separate bomb for normal spell and last spell (though that IsLastSpell will come in handy later on). By the time the spell is called, @MainLoop has already finished and the player has already changed player types. It will counter bomb with the default bomb rather than the bomb of the character that was just in play.

To give an example of what I am trying to do, imagine SAMarisaB(Patchy) but with different bombs, different speed,etc. for each form. Sort of like Puremrz' Juuni Jumon player character, except that you revert to a specific character upon death and can change types with a press of a button.

Also, what trigonometric functions would you use for the SetVertexXY values of an effect laser that always points at a certain degree angle and moves along with the player? The laser's width is 5 pixels.
« Last Edit: January 05, 2013, 11:09:57 PM by Sparen »