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

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #420 on: July 31, 2009, 08:37:52 PM »
I'm in despair! I'm trying to make a conversation work, but I keep being told something is wrong with SetChar.
I have loaded the graphic and stored in a variable of the right name, so nothing is wrong there.

It looks like this now:

script_enemy_main has:
let Kurumi = (GetCurrentScriptDirectory~"img\Kurumi Big.png");

Initialize has:
LoadGraphic(Kurumi);

And the rest is:

Code: [Select]
if(frame==120){
SetChar(LEFT,Kurumi);
SetGraphicRect(LEFT,0,0,130,200);
MoveChar(LEFT,FRONT);
TextOutA("\c[GREEN]I'm just here to test stuff.");
}
Yet, every time something seems to be wrong with SetChar. What could it be?
« Last Edit: July 31, 2009, 08:41:08 PM by puremrz »
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #421 on: July 31, 2009, 08:38:47 PM »
@ puremrz,
You have to create dialogues in events, not enemies. (not sure if this is correct). That is how I did it in my game. Like:

To call: CreateEventFromScript("nameoftheevent");

Code: [Select]
script_event nameoftheevent{
      declare vars here

       initialize{
            load stuff here
       }

       mainloop {
             talking goes here
       }

       finalize {
              delete stuff goes here
       }
}

You can call the event inside the enemy script. So that is not a problem. Also the ( ) around decleration of Kurumi is not needed.

-------------------------
General comment: Is it me or is working with:

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

Much easier to handle tasks and routines? I was firstly also working with if(frame==bla){fire bla} etc. However the overview becomes pretty bad with more complex patterns. When I learned this function from examples I started using it forever.

« Last Edit: July 31, 2009, 08:46:30 PM by Helepolis »

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #422 on: July 31, 2009, 08:46:16 PM »
Ah, I've been looking through afro to see how conversations work. But I can't find out how you made one script summon another.

Edit: Gah, you edited yourself while I was posting D:
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #423 on: July 31, 2009, 08:50:10 PM »
The boss is created within Afrostage.txt

Which calls the Afroboss.txt with the plural list of spellcards, and you will notice: AfroDialogue01.txt in there which is called first.

It is kind of chain linking but this is only required when you create a stage. You don't need a stage unless you want to change the background. You need to have a script_event  and CreateEvent function, that is all.

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #424 on: July 31, 2009, 09:35:59 PM »
Can you post a sample file of the minimum required data to make one person say one line of text?
The amount of data in Afro is confusing, I can no longer see what information I need and what I don't need. Does it HAVE to be multiple files, or is there a possibility you can put the talk in the same txt as the happenings before and after the talk?
I tried so much, and Danmakufu crashed in every possible way while I was busy. That's why I need a clean file with only the necessary data in it, so I can see what went wrong all those times.
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Danmakufu Q&A/Problem Thread
« Reply #425 on: July 31, 2009, 10:33:33 PM »
Minimum required is nothing more than a plural script and one dialogue script.

This inside your plural:
#ScriptPathData
#ScriptPath[.\Dialogue01.txt]
#ScriptPath[.\Nonspell01.txt]
#ScriptPath[.\SpellCard01.txt]


Dialogue01.txt
Code: [Select]
script_enemy_main{

    let boss = GetCurrentBlabla

@Initialize{
SetLife(1);
SetDamageRate(1,1);
LoadGraphic(boss);
CreateEventFromScript("talk");
}

@MainLoop{
if(GetEventStep==1){AddLife(-10);}
yield;
}
@DrawLoop{
SetTexture(boss);
SetAlpha(255);
        etc etc...
DrawGraphic(GetX, GetY);
}

    @BackGround
    {

    }
}

script_event talk{
let CSD = GetCurrentScriptDirectory;
let FACE = CSD ~ "<<pathname>>";

@Initialize{
LoadGraphic(FACE);
}
@MainLoop{
SetChar(LEFT,FACE);SetGraphicRect(LEFT,0,0,128,256);
MoveChar(LEFT,FRONT);
TextOutA("\c[RED]Testing bla bla bla");
SetStep(1);
}
@Finalize{
DeleteGraphic(stuff);
}
}

What happens here is when you load your plural file it will call the Dialogue01 first. Which will simply show your boss popping up and inmediately activate the event because it calls for CreateEvent. This Dialogue acts like a dummy spellcard which will wait untill the dialogue reaches SetEventStep 1. This will trigger the -10 life in the MainLoop killing the dummy spellcard and instantly calling the next line in the plural script.

This way it looks like your boss stops talking and starts attacking. I hope that was clear enough.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: Danmakufu Q&A/Problem Thread
« Reply #426 on: July 31, 2009, 10:49:00 PM »
What does GetKeyState(VK_USER) do, and what is a user-defined key?

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #427 on: July 31, 2009, 10:54:18 PM »
It defaults to C, but I can't recall if you can change it or not.

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

puremrz

  • Can't stop playing Minecraft!
Re: Danmakufu Q&A/Problem Thread
« Reply #428 on: August 01, 2009, 08:37:13 AM »
Minimum required is nothing more than a plural script and one dialogue script.

This inside your plural:
#ScriptPathData
#ScriptPath[.\Dialogue01.txt]
#ScriptPath[.\Nonspell01.txt]
#ScriptPath[.\SpellCard01.txt]


Dialogue01.txt
Code: [Select]
script_enemy_main{

    let boss = GetCurrentBlabla

@Initialize{
SetLife(1);
SetDamageRate(1,1);
LoadGraphic(boss);
CreateEventFromScript("talk");
}

@MainLoop{
if(GetEventStep==1){AddLife(-10);}
yield;
}
@DrawLoop{
SetTexture(boss);
SetAlpha(255);
        etc etc...
DrawGraphic(GetX, GetY);
}

    @BackGround
    {

    }
}

script_event talk{
let CSD = GetCurrentScriptDirectory;
let FACE = CSD ~ "<<pathname>>";

@Initialize{
LoadGraphic(FACE);
}
@MainLoop{
SetChar(LEFT,FACE);SetGraphicRect(LEFT,0,0,128,256);
MoveChar(LEFT,FRONT);
TextOutA("\c[RED]Testing bla bla bla");
SetStep(1);
}
@Finalize{
DeleteGraphic(stuff);
}
}

What happens here is when you load your plural file it will call the Dialogue01 first. Which will simply show your boss popping up and inmediately activate the event because it calls for CreateEvent. This Dialogue acts like a dummy spellcard which will wait untill the dialogue reaches SetEventStep 1. This will trigger the -10 life in the MainLoop killing the dummy spellcard and instantly calling the next line in the plural script.

This way it looks like your boss stops talking and starts attacking. I hope that was clear enough.


Thank you, I finally got it working after some minor problems. Now I'm one step closer to making a full game :3
All left now is to make the graphics (no problem there, I can draw :P), learn how to make 3d backgrounds, make my own playable character, and to finally understand the reflecting bullet business. ^^;
Full Danmakufu game "Juuni Jumon - Summer Interlude" is done!
By the same person who made Koishi Hell 1,2 (except this game is serious)
Topic: http://www.shrinemaiden.org/forum/index.php/topic,9647.0.html

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #429 on: August 01, 2009, 07:47:36 PM »
is there anything special about the first 8 spells of an extra stage boss? 9 is survival and 10 is a build-up card, but i just cant find the special things of those before that.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #430 on: August 01, 2009, 08:05:17 PM »
Recently a lesser survival card shows up, but if MoF it was 8th and in SA it was 5th.

Extra midbosses have 3 spellcards.

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

Infy♫

  • Demonic★Moe
  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #431 on: August 01, 2009, 08:33:00 PM »
not counting pcb

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #432 on: August 03, 2009, 01:32:21 AM »
Okay, I know I've asked for this before, but when I tested the code I was given, it never worked the way it was supposed to.


I need some code that makes objects home in on enemies gradually some time after they're fired, like the built-in ReimuA. As I said, I asked for this before, and someone gave me code for it, but I just tested it and it didn't home in at all. It angled a bit, but that's all it did- no homing. It's all this figuring out exactly which direction to move in that gets me. I have some idea how to do it, but right now, as I try, I keep getting confused as I think about it...

Re: Danmakufu Q&A/Problem Thread
« Reply #433 on: August 03, 2009, 01:39:24 AM »

Primula

  • EARL TYPE 222
Re: Danmakufu Q&A/Problem Thread
« Reply #434 on: August 03, 2009, 02:14:11 AM »
Code: [Select]
#TouhouDanmakufu
#Title[Random Insanities,"Mindless Knowledge"]
#Text[Ehhh]
#Image[]
#BackGround[IceMountain]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
    let BossImg = "script\ExRumia\img\ExRumia.png";
    let BossCutIn = GetCurrentScriptDirectory~"img\RumiaCutin.png";
    let frame = -120;

    @Initialize {
        SetLife(350);
        SetTimer(60);
        SetDamageRate(10, 0);
        SetScore(3333333.33);
        CutIn(KOUMA, "Random Insanities"\""Mindless Knowledge"\", "", 0, 0, 0, 0);

}

  @MainLoop {
      if(frame == 60) {
         speed = 2;
         loop(5) {
            CreateShot01(GetX, GetY, speed, GetAngleToPlayer+10, RED01, 10);
            CreateShot01(GetX, GetY, speed, GetAngleToPlayer, RED01, 10);
            CreateShot01(GetX, GetY, speed, GetAngleToPlayer-10, RED01, 10);
            speed += 0.2;
            }
         frame = 0;

        }
        frame++;
    }   

    @DrawLoop {

       SetTexture(BossImage);
       SetGraphicRect(0, 0, 64, 64);
       DrawGraphic(GetX, GetY);
      
    }

    @Finalize {
        DeleteGraphic(ImgBoss);
    }
}
}

I've been trying to do a bullet pattern that does
        
   / l \
  /  l  \
 /   l   \
/    l    \

and tried to use other scripts as bases..But the script keeps crashing.
« Last Edit: August 03, 2009, 02:16:18 AM by Vappie »

Re: Danmakufu Q&A/Problem Thread
« Reply #435 on: August 03, 2009, 02:23:54 AM »
You didn't declare the variable "speed".



My turn for a question I suppose. So I'm making a player script bomb, which works all fine and well until it finishes. I have "End;" declared at the end of the "run" task, which according to the player script tutorial, should end the spellcard. It does, along with the whole player script, causing Danmakufu to crash. So if I take out "End" at the end of my bomb task, once I bomb, I'm never allowed to bomb again. Ever. Even if I die.

Uhhh, any ideas, or do I have to post the script? End isn't declared anywhere else in the script, and is inside the spell card's braces, inside the "run" task (as per Stuffman's tutorial, as far as I can see). Any reason why the whole player script (and thus Danmakufu) would crash? I took a look at other player scripts and I'm supposedly following the same format.

Also, don't get me started on how annoying it was that I forgot to capitalize the "c" in @SpellCard. The problems that caused me were endless.

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #436 on: August 03, 2009, 02:31:38 AM »
http://touhou.wikia.com/wiki/Touhou_Danmakufu:_Object_Bullets

First example.

Oh wow, I had no idea that existed... It works, but there's a slight problem- it doesn't really home in that much. Rather, it aims. Basically, if you're at a position where the shots will go behind the enemy before its turn makes it go into the enemy, it most likely WON'T hit the enemy at all...

Re: Danmakufu Q&A/Problem Thread
« Reply #437 on: August 03, 2009, 02:33:15 AM »
Increase the max traverse angle.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #438 on: August 03, 2009, 02:37:11 AM »
Please post the script, Naut. The only thing that makes sense currently is if you managed to call End outside of the spell. It might be repeating the function somehow, causing the player script to end.

Or PM me because I already know who you're making.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #439 on: August 03, 2009, 02:38:33 AM »
Anybody who follows my YouTube account should know who I'm making, but whatever.

Expect a PM.

Sent.
« Last Edit: August 03, 2009, 02:43:28 AM by Naut »

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #440 on: August 03, 2009, 02:48:28 AM »
Increase the max traverse angle.

Problem with that is that it needs to get pretty high before it'll get fixed that way, and by that time, it doesn't look pretty "gradual" anymore. Darn it. I've tried changing the traverse angle partway through the movement, but for some reason, it doesn't seem to take effect then. :/

EDIT: Nevermind, it takes effect, but it's still really slow to work to be useful. Hmm... I need more ideas on how I could tackle this...

EDIT2: Oh cool, I finally fixed it. Yay.
« Last Edit: August 03, 2009, 02:52:19 AM by pikaguy900 »

Re: Danmakufu Q&A/Problem Thread
« Reply #441 on: August 03, 2009, 02:53:21 AM »
maxTraverse+=number;
number+=0.01;


??


Yay.

Nimono

  • wat
Re: Danmakufu Q&A/Problem Thread
« Reply #442 on: August 03, 2009, 02:59:19 AM »
maxTraverse+=number;
number+=0.01;


??


Yay.

Not even that helps at high speeds. For some reason, none of this really works well when the speed is set higher than 6 and I try to have some delay in the homing. That is, make it home in AFTER it goes out a bit. Now, if I take out that delay, it'll most likely work exactly as I want it...

EDIT: Fixed now, it's just as I want it. Yay :D
« Last Edit: August 03, 2009, 02:05:29 PM by pikaguy900 »

Primula

  • EARL TYPE 222
Re: Danmakufu Q&A/Problem Thread
« Reply #443 on: August 03, 2009, 03:07:09 AM »
Ah, thanks Naut for mentioning the speed part, I also dug deeper into the other script to see what I also missed.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #444 on: August 03, 2009, 04:12:04 AM »
Well, it's not just the End function. I used a different method that I always use and it still doesn't work. I did notice that the graphic doesn't actually lose any alpha value, even though it says to.

Also I updated your spritesheet because it was terrible lol. You're never supposed to open a 32-bit image with transparency in Paint, man.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #445 on: August 03, 2009, 04:28:00 AM »
This is why I use black.png as my background. Graphics aren't my thing, yo.

Also, you've noticed my other problem (though wasn't as serious, so I've left it alone until now):

Obj_SetAlpha doesn't fucking do anything.

Not the first time this has happened, either. Switching between Alpha and Additive blending doesn't change whether or not SetAlpha works either, it just blends them all together with 255 alpha, or draws one on top of the other, respectively. The other case I hinted towards was that the function doesn't affect my fucking frog dot explosions either. Piss me off.

On another note, I can't get the animation data to work for the snake shots, the image just doesn't appear (however, if I just set a rect, it does! Fancy that!?). Anybody got an example shot data sheet that I can take a look at that uses animation data, 'cause the ones I've been using aren't proving useful, evidently.

Code: [Select]
ShotData{
id=4
render=ADD
alpha=160
angular_velocity=0
animation_data={4, 25, 162, 35, 222}
animation_data={4, 38, 162, 49, 222}
animation_data={4, 52, 162, 63, 222}
animation_data={4, 66, 162, 77, 222}
}

Goddamn I'm running in to some heavy problems with player characters.

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #446 on: August 03, 2009, 04:31:09 AM »
Code: [Select]
ShotData{
   id=4
   render=ADD
   alpha=160
   angular_velocity=0
   AnimationData{
      animation_data={4, 25, 162, 35, 222}
      animation_data={4, 38, 162, 49, 222}
      animation_data={4, 52, 162, 63, 222}
      animation_data={4, 66, 162, 77, 222}
      }
   }
lawl

Also I've been messing around with it and I really can't tell what's wrong. For all intensive purposes, it's totally fine.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #447 on: August 03, 2009, 04:36:28 AM »
Code: [Select]
ShotData{
   id=4
   render=ADD
   alpha=160
   angular_velocity=0
   AnimationData{
      animation_data={4, 25, 162, 35, 222}
      animation_data={4, 38, 162, 49, 222}
      animation_data={4, 52, 162, 63, 222}
      animation_data={4, 66, 162, 77, 222}
      }
   }
lawl



Also I've been messing around with it and I really can't tell what's wrong. For all intensive purposes, it's totally fine.

Fuck this shit, anybody else wanna have a go at this faggotry?

http://www.mediafire.com/?nqmnkihtndt

Add "End;" right after "loop(360){yield;}" in the "run" task, at the bottom of the script to see Danmakufu crash six seconds after you press x. Leave it alone to never bomb more than once. Also, please have a look at how Obj_SetAlpha DOES NOTHING OH GOD WHAT NOW.
« Last Edit: August 03, 2009, 04:43:46 AM by Naut »

Drake

  • *
Re: Danmakufu Q&A/Problem Thread
« Reply #448 on: August 03, 2009, 04:47:42 AM »
Remove the spaces between the numbers, maybe. It says something's wrong with the tokens.

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

Re: Danmakufu Q&A/Problem Thread
« Reply #449 on: August 03, 2009, 04:52:27 AM »
Yeah, I put in the wrong braces. Should be (), not {}. Well good, at least that problem has a known solution, and is now fixed. But the End problem is destroying me, with the SetAlpha problem being the salt in my open wounds.