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

Vincent_Prismriver

  • Phantom passing by
  • Just an Italian silly guy
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #600 on: February 25, 2013, 08:32:42 PM »
Hi there! (I'm a new member)
I've got a question.

Since I'm still a newbie about Danmakufu, I've watched DoubleVla's tutorial about making a Custom Player Script, just a few minutes ago (But I already know the basics of the Spell Cards).
I've typed everything correctly, closed all the brackets (or at least I hope so) but when i select my custom player, the engine give me an error message.

Here's my code: http://pastebin.com/ksHjScU5

I really can't get what is the problem, I checked everything many times.
Could someone please help me?

(I hope I've written the message correctly, due to English not being my first language... this is also my first post here)

EDIT 22:41

Here's the Error Message I get:


I don't know what to do ?_?
« Last Edit: February 25, 2013, 09:42:35 PM by Vincent_Prismriver »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #601 on: February 25, 2013, 09:31:58 PM »
Within the test.txt file, you must put the '.\' before the '..\' so that Danmakufu knows to begin its directory within the script's location before moving up tiers. The fix is simple:
Code: [Select]
    #include_function ".\..\function_cutin.txt";
    #include_function ".\..\FxnList.txt"

Thanks. I wish that this kind of info was easier to find.

@Vincent: Please post an image of the error message. If there is a line number given, then look at the section in question.
« Last Edit: February 25, 2013, 09:39:05 PM by Sparen »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #602 on: February 26, 2013, 12:15:12 AM »
The logical OR operator is ||, not |space|. That's all.

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

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #603 on: February 26, 2013, 01:58:14 AM »
Can there be object bullets effect objects in stages?
Every time I try it doesn't work...
« Last Edit: February 26, 2013, 02:29:54 AM by Qwertyzxcv »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #604 on: February 26, 2013, 02:10:53 AM »
Can there be object bullets in stages?
Every time I try it doesn't work...

It should technically work if you're trying to do a PC-98-ish or EoSD-ish bullets from the screen. Please state what you tried, how you called the bullets, and any error messages. Start with the task, then go for how it was called.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #605 on: February 26, 2013, 02:29:28 AM »
It should technically work if you're trying to do a PC-98-ish or EoSD-ish bullets from the screen. Please state what you tried, how you called the bullets, and any error messages. Start with the task, then go for how it was called.
Ok, they aren't actually bullets. I meant to say effect objects...xD

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #606 on: February 26, 2013, 02:53:38 AM »
Ok, they aren't actually bullets. I meant to say effect objects...xD

Explain what you are trying to to and show the code used. Also:
http://dmf.shrinemaiden.org/wiki/Nuclear_Cheese%27s_Drawing_Tutorial

For most of the stuff, you can probably dump it in either @DrawLoop or @BackGround.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #607 on: February 26, 2013, 02:56:17 AM »
Qwerty: If by "it doesn't work" you mean "it crashes", Danmakufu often has issues with drawing on the first frame of a stage script.

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 #608 on: February 26, 2013, 03:00:47 AM »
Qwerty: If by "it doesn't work" you mean "it crashes", Danmakufu often has issues with drawing on the first frame of a stage script.

I.E. the first thing you should do is wait(#);
From Danmaku Dodging for Dummies:
Code: [Select]
  task Stage{
    wait(1); //Required to be here, greater than 0.

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #609 on: February 26, 2013, 02:25:15 PM »
Hello again, I got a new problem yay!

Like Vincent_Prismriver, I also watched the DoubleVla's tutorial and like him I had an error when it comes to Custom Player Script as well, it seem's that my bullets don't show up, I can hear the SFX of the shooting but I can't see the bullets.

I'm not on my true computer where everything is saved so I can't really show how my code turned out, but is there some common error when you create a Custom Player Script?
";" is my enemy.
Hated by many, loved by few.
Frustrating because you forget it but to attached to not want it.
The cause of many errors, but still it has it's own charm.
";" is my enemy, yet it is my best friend.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #610 on: February 26, 2013, 04:00:48 PM »
Hello again, I got a new problem yay!

Like Vincent_Prismriver, I also watched the DoubleVla's tutorial and like him I had an error when it comes to Custom Player Script as well, it seem's that my bullets don't show up, I can hear the SFX of the shooting but I can't see the bullets.

I'm not on my true computer where everything is saved so I can't really show how my code turned out, but is there some common error when you create a Custom Player Script?
Since you're saying your bullets don't appear but it does run the sound it means that this might be a graphical issue.
- Check whether you correctly declared the dimensions for the player bullet
- Check whether you loaded the graphics required for the player bullets

When you're on your true PC, please post pastebin log.


Code: [Select]
task Stage{
    wait(1); //Required to be here, greater than 0.
Be careful that not everybody who uses the wait function will understand that. In this case you need to use a 'yield'.

To elaborate on Drake's post about Danmakufu not liking drawing on first frame. It is quite easy. Don't call Effect Objects in @initialize or during initializations of the script. If you're scripting mainloop style, you might want to start out with a 'yield' as first line. If you're task based scripting, then make sure that before your effect object gets called to add a Yield;
« Last Edit: February 26, 2013, 04:07:53 PM by Helepolis »

Vincent_Prismriver

  • Phantom passing by
  • Just an Italian silly guy
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #611 on: February 26, 2013, 05:47:13 PM »
Quote
The logical OR operator is ||, not |space|. That's all.

Only that? Oh my, I feel so embarassed right now ^///^
Thanks for the help, but now I have another problem.  :getdown:

The shot works fine, but now the problem is with the player's sprite. I don't understand where is the error.

Error Picture:


Custom Player Script Code:
http://pastebin.com/F8F6UWTJ

The Sprite I want to use (I don't want animations or anything):

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #612 on: February 26, 2013, 07:10:18 PM »
Huh? If you don't want any animations or anything you might as well remove the entire  if(GetKeyState(VK_LEFT)==KEY_PUSH) || GetKeyState(VK_LEFT)==KEY_HOLD) {  section. So your drawloop becomes this:

Code: [Select]
@DrawLoop{
SetTexture(Ntex);
SetAlpha(255);
        SetGraphicAngle(0,0,0);
SetGraphicScale(1,1);
SetGraphicRect(0,0,64,64);
DrawGraphic(GetPlayerX,GetPlayerY);
}

You can delete the entire animation code with the if/else statements.
« Last Edit: February 26, 2013, 07:19:57 PM by Helepolis »

Vincent_Prismriver

  • Phantom passing by
  • Just an Italian silly guy
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #613 on: February 26, 2013, 07:26:35 PM »
So, I removed all the unnecessary parts, and my DrawLoop is like that.
But when I've opened Danmakufu to test it out, here comes another error message.



What the hell...? ;_;
« Last Edit: February 26, 2013, 07:37:47 PM by Vincent_Prismriver »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #614 on: February 26, 2013, 07:36:45 PM »
i have never seen that before ever

please pastebin your script, this is unprecedented serious affair

EDIT: google says there might be an incompatibility with your graphics card, please post that too if you know what it is

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

Vincent_Prismriver

  • Phantom passing by
  • Just an Italian silly guy
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #615 on: February 26, 2013, 07:43:09 PM »
EDIT: I restarted my computer. Now it works fine, I can open the program.
At least if it happens again, I'll know what to do.

But the issue about my custom player character hasn't been solved yet.
If I play a script the sprite... like... doesn't appear.
There's only the hitbox if I focus.

Code: http://pastebin.com/iCf4pxLt

Screen:

This sure is strange... the character sprite doesn't appear on the screen, but it does in the HUD (I've set the same sprite)


Actually, I've encountered this problem before, so I thought I should've added those animation lines (which were useless as a result)
« Last Edit: February 26, 2013, 08:01:57 PM by Vincent_Prismriver »

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #616 on: February 26, 2013, 08:46:15 PM »
Since you're saying your bullets don't appear but it does run the sound it means that this might be a graphical issue.
- Check whether you correctly declared the dimensions for the player bullet
- Check whether you loaded the graphics required for the player bullets

When you're on your true PC, please post pastebin log.

http://pastebin.com/jWr0U1QB

I tried decreasing  the bullet to less pixels but still nothing, there's the link to my code.
";" is my enemy.
Hated by many, loved by few.
Frustrating because you forget it but to attached to not want it.
The cause of many errors, but still it has it's own charm.
";" is my enemy, yet it is my best friend.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #617 on: February 26, 2013, 09:39:43 PM »
http://pastebin.com/jWr0U1QB

I tried decreasing  the bullet to less pixels but still nothing, there's the link to my code.

Code: [Select]
goodshot(GetPlayerX, GetPlayerY, 15, 270, WHITE01, 5);You're calling your object shot, but giving it a WHITE01 as graphics while your own bullet is defined as ID 01 (I think you need to make it 1, not 01)

Code: [Select]
ShotData { id = 1 rect=(0,0,111,111) render=ALPHA alpha=255 }
---
goodshot(GetPlayerX, GetPlayerY, 15, 270, 1, 5);

Change your ID to 1. And give your goodshot graphic parameter a '1'. This should fix it.


Code: http://pastebin.com/iCf4pxLt
You didn't define any rect in your @DrawLoop? Please scroll up to see my previous post :V
« Last Edit: February 26, 2013, 09:43:33 PM by Helepolis »

JCTechnic

  • Hikkikomori Jesus
  • Goran no suponsaa no teikyou de okurishimasu
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #618 on: February 26, 2013, 10:31:59 PM »
Code: [Select]
goodshot(GetPlayerX, GetPlayerY, 15, 270, WHITE01, 5);You're calling your object shot, but giving it a WHITE01 as graphics while your own bullet is defined as ID 01 (I think you need to make it 1, not 01)

Code: [Select]
ShotData { id = 1 rect=(0,0,111,111) render=ALPHA alpha=255 }
---
goodshot(GetPlayerX, GetPlayerY, 15, 270, 1, 5);

Change your ID to 1. And give your goodshot graphic parameter a '1'. This should fix it.

Ups sorry but, I forgot I edited the code before to try and work around the error, but to no avail.
I edited the code back to it's original state with everything you said but still nothing, maybe it's something quite obvious that I just don't know about :/

http://pastebin.com/jWr0U1QB

^Edited
";" is my enemy.
Hated by many, loved by few.
Frustrating because you forget it but to attached to not want it.
The cause of many errors, but still it has it's own charm.
";" is my enemy, yet it is my best friend.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #619 on: February 26, 2013, 11:08:06 PM »
I've figured out the effect object thing...it was some other error.  :derp:

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #620 on: February 26, 2013, 11:15:41 PM »
Ups sorry but, I forgot I edited the code before to try and work around the error, but to no avail.
I edited the code back to it's original state with everything you said but still nothing, maybe it's something quite obvious that I just don't know about :/

http://pastebin.com/jWr0U1QB

^Edited

Line 58:
Code: [Select]
else if
You have an error there. I think that's why it says you need a {

Also, I think the Player Shot Data needs a capital P.

#PlayerShotData
« Last Edit: February 26, 2013, 11:18:24 PM by Sparen »

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #621 on: February 26, 2013, 11:41:36 PM »
Code: [Select]
else if
You have an error there. I think that's why it says you need a {
else if does not cause an error.

Ups sorry but, I forgot I edited the code before to try and work around the error, but to no avail.
I edited the code back to it's original state with everything you said but still nothing, maybe it's something quite obvious that I just don't know about :/

You are missing a final bracket to close off script_player_main (you missed a } bracket right after the yield; in the wait function). And as Sparen mentioned, you need #PlayerShotData, with a capital P.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #622 on: February 27, 2013, 01:11:00 AM »
How do I create a CreateShotA object bullet?

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #623 on: February 27, 2013, 01:19:34 AM »
How do I create a CreateShotA object bullet?
You can't. CreateShotA bullets are treated the same way as CreateShot01 bullets, only with additional ways to control them after they are fired. Object bullets, while you can manipulate them in much the same way (only with even MORE things you can do with them), are created differently and are treated differently by the system than CreateShotA bullets.

In short, you can't fire object bullets with any of the CreateShot functions.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #624 on: February 27, 2013, 01:25:15 AM »
As said, you can't exactly do that in 0.12 since you aren't given control over objects created using the CreateShot series and the like. You can create a structure that works similarly, but for all intended purposes it works much simpler by just writing the object bullet from scratch unless the behaviour is really simple. But if you're looking for the same "build-a-bullet" sort of things then don't bother trying to copy CreateShotA.

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 #625 on: February 27, 2013, 01:26:32 AM »
You can't. CreateShotA bullets are treated the same way as CreateShot01 bullets, only with additional ways to control them after they are fired. Object bullets, while you can manipulate them in much the same way (only with even MORE things you can do with them), are created differently and are treated differently by the system than CreateShotA bullets.

In short, you can't fire object bullets with any of the CreateShot functions.

On this issue, angular velocity is basically, Obj_SetAngle(obj, Obj_GetAngle(obj)+XXX) in the while !BeDeleted statement. Acceleration is if(Obj_GetSpeed(obj) >/< (depends) Max/min speed){Obj_SetSpeed(obj, Obj_GetSpeed+XXX)}

Basically, you can do everything else as you want to. The only issues are x and y accelerations and x and y velocities.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #626 on: February 27, 2013, 01:29:42 AM »
Ok, I meant the parameters, of SetShotDataA, mainly curving...because I want indestructable curving bullets that are set in the shot, not in the object bullet. :)
« Last Edit: February 27, 2013, 01:32:10 AM by Qwertyzxcv »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #627 on: February 27, 2013, 01:31:19 AM »
Ok, I meant the parameters, of SetShotDataA, mainly curving...because I want indestructable curving bullets. :)

It's stated in the tutorial how to give angular velocity to an object bullet. Just make sure not to go too overboard~ Sometimes having bullets return from the bottom of the screen can result in death.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #628 on: February 27, 2013, 01:37:19 AM »
It's stated in the tutorial how to give angular velocity to an object bullet. Just make sure not to go too overboard~ Sometimes having bullets return from the bottom of the screen can result in death.
Well, does that mean I have to recreat the bullet into an object bullet?
Or can I add a paramter?
 

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #629 on: February 27, 2013, 01:59:50 AM »
Well, does that mean I have to recreat the bullet into an object bullet?
Or can I add a paramter?

It's already an object bullet, right? You can do whatever you want. Obj_Delete(obj) can be used to clear stuff.