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

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #720 on: December 17, 2011, 08:49:29 AM »
Yes, it's a circle of radius [smallest dimension of graphic] / 2, or 3, or at least something close to that. Bullets themselves cannot be resized, though. If you define an object bullet and use another render object to draw it, it doesn't affect the hitbox. If you use a laser to stretch it though, then danmakufu calculates a new hitbox as it does for all lasers.
Just as i thought. So i can "define" the hitbox/bullet size relation by changing the fraction of rectangle the actual bullet's image takes. Like if i wanna make a bullet with a bigger hitbox i have to make it smaller than the rectangle defined in shotdata. Oh man. This should be mentioned in basic tutorials once it's going into loading user bullets, cause it's danmaku-critical. Remember, the first thing i've done is like loading a graphic for a blullet with a rect equal to it's image, and then was confused why all my bullets are so easy to dodge? ??? Also i think i have to make some test script just for testing the hitboxes.

And the fact you actually cant resize user bullets after being loaded kinda sucks. I have idea of a pattern based on bullet size (and it's hitbox too) change and just putting an effect object over wont work. The only solution i see - is to split size changing in some steps and load them as separate ids. That's ridiculous, but kinda might work.

And how actually laser hitboxes work? How do functions like ObjLaser_SetLength, ObjLaser_SetWidth and size of a graphic used affect it?
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #721 on: December 17, 2011, 09:07:52 AM »
If you really want to you can use SetCollisionB as a makeshift bullet collision. It's kind of roundabout but it works, I guess.

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

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #722 on: December 17, 2011, 09:25:04 AM »
Hahaha. Like spreading enemy's hibox all over the place. That makes some sense though, so i'll try it. Thanx for advice ;)

UPD: I've actually made some simple script wich shows how hitbox size relates to visible bullet size depending on bullet graphic rectangle.
Download script 11 kb.



I think this might be usefull for noobs just entering custom shots management.

And now i've gotta redo all shotdata for my game and as a consequence of that - modify some patterns :fail:
« Last Edit: December 17, 2011, 08:47:58 PM by MMX »
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #723 on: December 17, 2011, 11:12:30 PM »
nevermind...
« Last Edit: December 17, 2011, 11:45:48 PM by Yuuka »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #724 on: December 18, 2011, 12:00:20 AM »
Quote
http://pastebin.com/7NgrMLy0

- I can't tell if SetAction is failing because that isn't linked.
- Your first SetShotData is telling the bullet to go 60 pixels per frame at 1.5 degrees, turning 1 degree per frame, accelerating at 20 pixels per frame until it hits 70 pixels per frame. That is definitely not anything close to what you probably want.
- You second SetShotData is actually set to activate before the first one so I don't know why it's below it. It's telling the bullet to go 10 pixels right and 30 pixels down per frame, accelerating at 20 pixels right per frame and 1.5 pixels down per frame until it reaches 15 pixels right and 35 pixels down per frame. This is still not anything close to something that makes sense.
- Your AddShot is trying to add a bullet with the ID of 134 to the first bullet, but you don't have a bullet with the ID of 134. Error would happen here.
- rand(0,0) will return 0.
- You actually managed to not even give the right amount of arguments for CreateShot01. Both of them. Error would happen.
- Your CreateShot02 isn't even finished and misspells "GetX". Error would happen.
- Your frame==480 section has an extra close bracket that would also make the script error.
- DrawBoss isn't even a function and even if it were DrawGraphic it would error because nothing is set up before you call it. Error.
- Both SetAction(ACT_MOVE,0) in your DrawLoop have no semicolon. Error.
- You don't have a closing bracket for script_enemy_main which I can only assume is the extra bracket mentioned above.

What are you doing.

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

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #725 on: December 18, 2011, 01:13:45 AM »
- I can't tell if SetAction is failing because that isn't linked.
- Your first SetShotData is telling the bullet to go 60 pixels per frame at 1.5 degrees, turning 1 degree per frame, accelerating at 20 pixels per frame until it hits 70 pixels per frame. That is definitely not anything close to what you probably want.
- You second SetShotData is actually set to activate before the first one so I don't know why it's below it. It's telling the bullet to go 10 pixels right and 30 pixels down per frame, accelerating at 20 pixels right per frame and 1.5 pixels down per frame until it reaches 15 pixels right and 35 pixels down per frame. This is still not anything close to something that makes sense.
- Your AddShot is trying to add a bullet with the ID of 134 to the first bullet, but you don't have a bullet with the ID of 134. Error would happen here.
- rand(0,0) will return 0.
- You actually managed to not even give the right amount of arguments for CreateShot01. Both of them. Error would happen.
- Your CreateShot02 isn't even finished and misspells "GetX". Error would happen.
- Your frame==480 section has an extra close bracket that would also make the script error.
- DrawBoss isn't even a function and even if it were DrawGraphic it would error because nothing is set up before you call it. Error.
- Both SetAction(ACT_MOVE,0) in your DrawLoop have no semicolon. Error.
- You don't have a closing bracket for script_enemy_main which I can only assume is the extra bracket mentioned above.

What are you doing.

I'm linking the actions too lib_anime_Marisa. I used DrawBoss as an experiment (I'm using the FLAN library Example). I'm typing in random codes for no apparent reason. I forgot to erase CreateShot02. ACT_MOVE,0 really doesn't need semicolons. I used it to modify Genmu and it works fine. Meh, for some reason i'm noly good at event scripts. This is my first time scripting in months now and I forgot most of the functions. Seems like i need to study more...  ( Oh yeah. I loaded the usershot data. Should i use it as include_function instead?
« Last Edit: December 18, 2011, 01:20:04 AM by Yuuka »
" Borders are Borders. They were meant to be manipulated and mistreated. "

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #726 on: December 18, 2011, 06:48:19 AM »
Does GetEventStep work in stage scripts? Every time I attempt to run a script with that in it, it gives me an error message with GetEventScript highlighted as the cause.

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #727 on: December 18, 2011, 07:49:34 AM »
Nope, OnEvent and GetEventStep only work in Enemy scripts.

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

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #728 on: December 18, 2011, 02:36:22 PM »
What does CreateEnemyFromFile do?
" Borders are Borders. They were meant to be manipulated and mistreated. "

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #729 on: December 18, 2011, 02:43:16 PM »
What does CreateEnemyFromFile do?

As written on the wiki:

Create a child enemy which behavior is defined in another file. Plural-script files can not be passed.
6 Parameters
    1) path of the enemy script (string)
    2) x-coordinate
    3) y-coordinate
    4) velocity
    5) direction
    6) user-defined argument

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #730 on: December 18, 2011, 03:02:34 PM »
Thank you.
" Borders are Borders. They were meant to be manipulated and mistreated. "

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #731 on: December 21, 2011, 11:03:34 PM »
Hey, I'm having problems with some effect objects that I'm making. I wanted these circles to act like Medicine's EX attacks from PoFV where they slow down (or in some cases speed up) the player. However, the player's movement inside the moving circles is a bit wonky, I'm not sure what's wrong. Here's the effect object:

http://pastebin.com/rffbq0LG

Thanks!

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #732 on: December 21, 2011, 11:27:25 PM »
Hey, I'm having problems with some effect objects that I'm making. I wanted these circles to act like Medicine's EX attacks from PoFV where they slow down (or in some cases speed up) the player. However, the player's movement inside the moving circles is a bit wonky, I'm not sure what's wrong. Here's the effect object:

http://pastebin.com/rffbq0LG

Thanks!
Hmm. Seems like you are trying to shift a player in direction oposite to wich it moves. I guess it's just SetPlayerX and Y functions negotiating player's movement by assigning an absolute value to it's position. I dunno what do you mean by "wonky", but i encountered the same issue with SetX, SetY in enemy script. Once called it will completely ignore current enemy's speed for some reason. Maybe you should do it the other way by completely overriding player's movement. Get player's focused and unfocused speeds by GetPlayerInfo assign them to vL and vH but with some decrease, and then move player in direction it needs to move like if(GetKeyState(VK_UP)!=KEY_FREE) { y-=vL } instead of +. That's just a suggestion. I havent tested it for real :blush:
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #733 on: December 22, 2011, 01:50:59 AM »
Hmm. Seems like you are trying to shift a player in direction oposite to wich it moves. I guess it's just SetPlayerX and Y functions negotiating player's movement by assigning an absolute value to it's position. I dunno what do you mean by "wonky", but i encountered the same issue with SetX, SetY in enemy script. Once called it will completely ignore current enemy's speed for some reason. Maybe you should do it the other way by completely overriding player's movement. Get player's focused and unfocused speeds by GetPlayerInfo assign them to vL and vH but with some decrease, and then move player in direction it needs to move like if(GetKeyState(VK_UP)!=KEY_FREE) { y-=vL } instead of +. That's just a suggestion. I havent tested it for real :blush:

Actually, you're suggestion was what I tried initially, only instead of completely overriding the player's movement, it actually added to it and sped it up, instead of slowing it down as intended. So I'm stumped now.

Here's the version with your suggestion: http://pastebin.com/RNsEA5Up

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #734 on: December 22, 2011, 02:05:18 AM »
EDIT: Actually I misread the text, but still. If the second one adds to the speed then the first one should work instead. If the first one ignores the actual player movement then the second one should work. Explain what "wonky" is and such. I would also suggest maybe halving the speeds (or some other multiple) to be certain that no player will start moving backwards.

If you really want to override the player's movement, turn the current method into a flagswitch...

let inarea = false;
while(!Obj_BeDeleted(obj)) {
     if(type == 2 && playerisinbox && ! inarea) { inarea=true; slowmove; }
}


And then change your actually-just-a-subroutine-task into an embedded (to modify the flag) looping task like

task slowmove {
     let x = GetPlayerX; let y = GetPlayerY;
     let vL = GetPlayerInfo(PLAYER_SPEED_LOW)/2;
     let vH = GetPlayerInfo(PLAYER_SPEED_HIGH)/2;
     while(playerstillinbox){
          dothings;
          positionplayer;
          yield;
    }
    inarea = false;
}


This way, as soon as you enter the box, the player position is given and then locked. In all the next frames afterwards it doesn't get any new player position, it only modifies the already-known position. So, there's no chance of accidental speedup.

« Last Edit: December 22, 2011, 02:45:44 AM by Drake »

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

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #735 on: December 22, 2011, 02:30:34 AM »
Sorry I didn't know how better to describe it. When the player moves diagonally within the field, the speed is for some reason lowered even more than it would be just moving up, down, right, or left. It's like the effect of the original slowmove task is double for diagonal movement. The "wonky" movement resulted when some players that had a high enough speed would end up going backwards when they attempted to move diagonally.

Edit:
Quote
If you really want to override the player's movement, turn the current method into a flagswitch...

let inarea = false;
while(!Obj_BeDeleted(obj)) {
     if(type == 2 && playerisinbox && ! inarea) { inarea=true; slowmove; }
}


And then change your actually-just-a-subroutine-task into an embedded (to modify the flag) looping task like

task slowmove {
     let x = GetPlayerX; let y = GetPlayerY;
     let vL = GetPlayerInfo(PLAYER_SPEED_LOW)/2;
     let vH = GetPlayerInfo(PLAYER_SPEED_HIGH)/2;
     while(playerstillinbox){
          dothings;
          positionplayer;
          yield;
    }
    inarea = false;
}


This way, as soon as you enter the box, the player position is given and then locked. In all the next frames afterwards it doesn't get any new player position, it only modifies the already-known position. So, there's no chance of accidental speedup.

Thanks a bunch! That's exactly what I was trying to do. It works perfectly now.
« Last Edit: December 22, 2011, 03:07:39 AM by Ozzy »

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #736 on: December 23, 2011, 02:15:34 AM »
How do you create Marisa's Master Spark? I'm using it in Yuuka's card, Flowering Breeze,"Master Spark"
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #737 on: December 23, 2011, 02:33:33 AM »
it'd be nice if you were to make something OTHER than copying spellcards...

It seems you just make a huge laser, with a bit more than usual delay.

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #738 on: December 23, 2011, 02:40:55 AM »
it'd be nice if you were to make something OTHER than copying spellcards...

It seems you just make a huge laser, with a bit more than usual delay.
Thank you! By the way, didn't Yuka had Master Spark first, till marisa stole it?
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #739 on: December 23, 2011, 02:42:26 AM »
What I mean is, that doesn't really give you a good enough excuse to just throw in Master Spark into a Yuuka fight, instead of making more pretty flower patterns. Well, this excuse isn't good enough for me, at least. (But, it IS she who used it first... But she only used it once.)

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #740 on: December 23, 2011, 02:51:12 AM »
I had an idea for a flower pattern. It was impossible too pull for me to pull off. Well here's how it starts out:

1. Yuka shoots curvy lasers in left and right

2.  The Curvy lasers leave out a bunch of familiars

3. The Familiars shoot a sunflower pattern danmaku

4. Yuka in the mean time shoots a perfect circle of bubbles.

5. The familiars delete themselves leaving behind billions of petals.

6. The petals freeze and does a Phantasm romance Sakuya Cheap.

7. Restart.

Since I have barely any experience with familiars ( Because they glitch up in danmakufu (The CTC one ) and they look dem ugly. if you know what I mean ). and I never task much, I really don't know. I'll just look in some example scripts from genmu.
" Borders are Borders. They were meant to be manipulated and mistreated. "

AJS

  • Danmakufu Scripter
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #741 on: December 27, 2011, 08:49:17 AM »
I finally got around to trying advice given to me earlier on this thread about making multi-layered backgrounds, but I seem to have encountered a problem.  I believe I followed the advice I was given, but I can only get one background to appear.  The second one doesn't appear on top.

Here's what I have for my @Background (I've already declared "bg" and "bg2" at the start of the script)

Code: [Select]
@BackGround{
SetTexture(bg);
SetGraphicRect(0,0,256,256);
SetGraphicScale(1.75,1.75);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);

SetTexture(bg2);
SetGraphicRect(0,0,256,256);
SetGraphicScale(1.75,1.75);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);
}

I'm trying to get "bg2" to appear on top of "bg", but it doesn't seem to be working.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #742 on: December 27, 2011, 12:09:51 PM »
Could you pastebin your entire script? Something tells me you are loading/defining your textures wrong. Hard to judge from just your background loop (which seems fine so far).

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #743 on: December 27, 2011, 07:46:55 PM »
How do you load Yuyuko's fan? To I need to task it or something?
" Borders are Borders. They were meant to be manipulated and mistreated. "

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #744 on: December 27, 2011, 08:42:59 PM »
How do you load Yuyuko's fan? To I need to task it or something?
Yuyuko's fan is an image which you need to draw using Effect Objects. If you're unknown with Effect Objects, you might want to first dive into. (Which is same principal for Master Spark etc).

AJS

  • Danmakufu Scripter
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #745 on: December 27, 2011, 08:49:55 PM »
Could you pastebin your entire script? Something tells me you are loading/defining your textures wrong. Hard to judge from just your background loop (which seems fine so far).
That may not be necessary, because I tested the script out again a few times with several other images for "bg2", and it worked out the way I intended.  It only doesn't work when I try to use this image for "bg2".  Could this perhaps be remedied by SetRenderState or SetAlpha, since the image is partially transparent?  I tried playing around with it a bit myself, but couldn't get anything to work.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #746 on: December 27, 2011, 10:30:05 PM »
It is a JPG. You might want to try BPM or PNG. As far as I know, Danmakufu doesn't like JPG.

JPG has no transparency, PNG has that. BPM only has it for pure black (0,0,0). I think there is your issue.
« Last Edit: December 27, 2011, 10:31:37 PM by Helepolis »

AJS

  • Danmakufu Scripter
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #747 on: December 28, 2011, 03:12:06 AM »
It is a JPG. You might want to try BPM or PNG. As far as I know, Danmakufu doesn't like JPG.

JPG has no transparency, PNG has that. BPM only has it for pure black (0,0,0). I think there is your issue.
Tinypic uploaded that image as a JPG, but I can assure you that the original image is in fact a PNG.  I've never tried BPM, though, and what you said about it sounds like it could be helpful, so I'll give that a try.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #748 on: December 28, 2011, 11:59:24 AM »
I don't remember tinypic forcing pictures into different formats. Either way, it sounds to me like a corrupted image in worst case. You can try to reupload it as PNG and I'll test it out by trying to load it in my script.

There is noway a singular image is going to fail to load unless:
- The image is corrupt
- The image is not true format (dodgy saving/corruption as well)
- Script mistakes/errors




Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #749 on: December 28, 2011, 05:00:51 PM »
You might want to try BPM or PNG.

I've never tried BPM, though, and what you said about it sounds like it could be helpful, so I'll give that a try.

It's BMP, not BPM.
<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.