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

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #480 on: August 08, 2011, 03:51:23 AM »
Hey, can someone decent with math/trig take a look at this and see where I'm going wrong? Pastebin

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #481 on: August 08, 2011, 07:44:22 AM »
...You can extrapolate angular velocity and speed needed for how you wrote the first equation, but it's much easier to figure out when you ditch the center of the circle entirely. For your point to constantly be traveling on the outside of a circle, it'll be traveling along the circumference. For the point to reach the same point it started from, it'll have to turn 360 degrees. In other words, the entire length of the circumference. Therefore, think of the circumference of a circle like a line that your point is moving across.

2*π*r is the circumference of a circle. For a point traveling 1pixel per frame and increasing angle by 1per frame, it will get all the way around a circle with a circumference of 360 pixels in 360 frames. If the speed doubles, both the circumference and frames taken doubles. If the angular velocity doubles, the circumference and frames taken are halved. Therefore, if the time (frames) it takes for the point to go around the circle regardless of radius is constant, then use
a=2*π*r*s/360

But, if the angular velocity of the point is constant, then because circumference and time taken in this case is the same measurement, we have
a=2*π*r*s/360
-> a=t*s/360
-> t=a*360/s

I'm going to guess though that you'd want the first, considering you threw in the radius and probably want an even expansion rather than the laser rotating super fast and then slowing down as the circle expands. First is more like Subterranean Rose.
« Last Edit: August 08, 2011, 07:48:30 AM by Drake »

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #482 on: August 08, 2011, 07:59:39 AM »
I have already seen it but I don't understand the part on vertex xD

:|

In that case, I hope someone who knows French on this board can help you out =/
« Last Edit: August 08, 2011, 08:11:30 AM by Helepolis »

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #483 on: August 15, 2011, 02:34:22 AM »
Code: [Select]
task DrawStarRank
{
let obj=Obj_Create(OBJ_EFFECT);
let xpos = 0 + 32*csr;

ObjEffect_SetTexture(obj,Star);

ObjEffect_SetRenderState(obj,ALPHA);
ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLEFAN);
ObjEffect_SetLayer(obj,8);

ObjEffect_CreateVertex(obj,4);
ObjEffect_SetVertexUV(obj,0,xpos,0);
ObjEffect_SetVertexUV(obj,1,32,0);
ObjEffect_SetVertexUV(obj,2,32,32);
ObjEffect_SetVertexUV(obj,3,0,32);

//ObjEffect_SetVertexXY(obj,0,-256,-256);
//ObjEffect_SetVertexXY(obj,1,256,-256);
//ObjEffect_SetVertexXY(obj,2,256,256);
//ObjEffect_SetVertexXY(obj,3,-256,256);

ObjEffect_SetVertexXY(obj,0,-16,-16);
ObjEffect_SetVertexXY(obj,1,16,-16);
ObjEffect_SetVertexXY(obj,2,16,16);
ObjEffect_SetVertexXY(obj,3,-16,16);

loop{
Obj_SetPosition(obj,530,385);
ObjEffect_SetScale(obj,2,2);
yield;
}
//Obj_Delete(obj);
}

This object works, but I can't change the image in-game, ii's possible to change an Effect Object graphic?
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #484 on: August 15, 2011, 02:45:49 AM »
Just call ObjEffect_SetTexture again and reset their XYs and UVs.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #485 on: August 15, 2011, 09:31:19 AM »
Maybe explain a bit more the possibilities of effect objects Mewkkyuuri =.=. Your half-done help isn't really explaining the potential possibilities.

Teff007 you could do this two ways:

- Create a while(!Obj_BeDeleted) inside your task and modify the influence the SetVertex/SetUV in there with certain functions/delays etc.
- Make your let obj=Obj_Create a global variable. This allows you to set the Vertex/UV or anything related to the object from anywhere in your script. Makes it extremely flexible if you wish to alter the effect object inside another task.

Edit:
If you really wish to change the texture of the object, you could use the above method as well. If the sprite has the same dimensions, you could simply call the texture. If the image is a part of a sprite animation, then you need to fiddle around with the UV coordinates by changing them through your desired method.

It sounds complicated but if you start out with basic tests, you will understand it quickly. See what works best for you.
« Last Edit: August 15, 2011, 09:33:29 AM by Helepolis »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #486 on: August 15, 2011, 07:27:35 PM »
I highly suggest NOT setting XYs and UVs over and over without deleting an object. If you plan for this object to persist for long periods of time, try to find a better way. Danmakufu 0.12m seems to have a bug in its engine that makes subsequent changes to XY and UV vertices take longer and longer for each call. It's not noticeable if you do it only a hundred times, but if you set 4 UV and XY coordinates every frame, for example, it will only take a few minutes or so for the slow down to become very noticeable. Deleting and recreating the effect object is a valid workaround though.
<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.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #487 on: August 15, 2011, 07:58:25 PM »
I highly suggest NOT setting XYs and UVs over and over without deleting an object. If you plan for this object to persist for long periods of time, try to find a better way. Danmakufu 0.12m seems to have a bug in its engine that makes subsequent changes to XY and UV vertices take longer and longer for each call. It's not noticeable if you do it only a hundred times, but if you set 4 UV and XY coordinates every frame, for example, it will only take a few minutes or so for the slow down to become very noticeable. Deleting and recreating the effect object is a valid workaround though.

Huh? Is that so? For my ballerina boss, I am actually faking the animation of the boss using effect objects where the UV is reset using a variable to "cycle" through the animation frames.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #488 on: August 16, 2011, 04:49:11 PM »
I'm talking about stuff like a score counter that updates every frame instead of checking when the score changes, for example. Your ballerina boss will probably delete itself before it becomes a problem, especially if it deletes and recreates itself after every attack.
<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.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #489 on: August 16, 2011, 08:40:35 PM »
Hi guys,
I tried searching the forum for my problem but it didn't work so here it is:
When I start Danmakufu on my laptop it crashes immediately with the error message that it just doesn't work right. I tried to run it with Applocale just the way I do on my pc (it works perfectly there) but I don't know what else I have to do.
Both systems are Win7 Ultimate 64-Bit, they are identical, except the hardware.
Would be nice if someone replies quickly because I wanted to script some spellcards on a journey tomorrow (well I still can do that, but I cannot test them).

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #490 on: August 16, 2011, 08:47:11 PM »
Would be nice if someone replies quickly because I wanted to script some spellcards on a journey tomorrow (well I still can do that, but I cannot test them).
Please refrain from saying such things. Help is not a demand, it is a request. And it will come when people read and reply.

When I start Danmakufu on my laptop it crashes immediately with the error message that it just doesn't work right. I tried to run it with Applocale just the way I do on my pc (it works perfectly there) but I don't know what else I have to do.
Both systems are Win7 Ultimate 64-Bit, they are identical, except the hardware.
Is the error msg from Danmakufu? or the Windows error msg saying "this program stopped responding." Either way, that just doesn't sound right. It still sounds like an applocal problem to me. Have you actually reinstalled Applocal or Danmakufu? Have you tried a clean danmakufu install?


Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #491 on: August 16, 2011, 08:59:23 PM »
Is the error msg from Danmakufu? or the Windows error msg saying "this program stopped responding." Either way, that just doesn't sound right. It still sounds like an applocal problem to me. Have you actually reinstalled Applocal or Danmakufu? Have you tried a clean danmakufu install?
It was the windows error message, however, reinstalling solved it, thanks.

TheTeff007

  • Best Touhou 2015!
  • So much cuteness...!
    • Youtube Channel
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #492 on: August 17, 2011, 10:32:35 PM »
Quote
Teff007 you could do this two ways

You can call me Teff.


What I'm intending to do is to change a Image drawn over the Frame according to the current spellcards captured, I'm not on my computer right now, but I try what you said at the moment.

Also, another two questions:

1.- CommonData, I know how to use it decently now, but is there a way to add values to the CommonData?

Say : if (GotSpellCardBonus){SetCommonData("Rank", CURRENT VALUE + 1); }

That's what I'm intending to do, to add one value with each spellcard captured.

2.- @DrawTopObject. I have seen it in a few scripts, but I dunno what it does except for being another drawing sintaxis. Any explanations?


[I apologize for any typo, I'm in a hurry :V]
Small Teaser of my upcoming project~

No need to call me Teff007. Teff will do just as well~

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #493 on: August 17, 2011, 10:36:42 PM »
SetCommonData("X", GetCommonData("X") + Y);

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

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #494 on: August 18, 2011, 05:49:11 AM »
I'm talking about stuff like a score counter that updates every frame instead of checking when the score changes, for example. Your ballerina boss will probably delete itself before it becomes a problem, especially if it deletes and recreates itself after every attack.
Oh like that. Well yea. My function only runs for like 1 non-card and after that it is just regular boss animation handling in the DrawLoop. Interesting fact to know.

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #495 on: August 21, 2011, 03:05:10 AM »
I apoligize if this may annoy anyone but could someone please try to explain danmakufu. I've read all the tutorials, printed them out, looked at he faq and i can't even make the simplest attack. Plz don't link to other topics are say something bad. If your not answering, plz don't post...

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #496 on: August 21, 2011, 03:32:47 AM »
Ok, now you are just sad. What are you even trying to create? You aren't specifying anything at all. If you're having a problem, at least tell us what the problem is. End of fucking statement.

[tso]Uhh no we don't treat people this way, timeout for you[/tso]
« Last Edit: August 21, 2011, 06:47:40 AM by helvetica »

CK Crash

  • boozer
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #497 on: August 21, 2011, 04:15:24 AM »
Quote
i read everything but dunno how anything derpaderp

Make a folder called MyBoss or something in the scripts folder of your copy of danmakufu. Make an img folder in there. Save the below script as a txt file in your new folder. Test it, and it should be a boss that self-destructs after a few seconds. Mess around with CreateShot01(x,y,speed,angle,graphic,delay) and stick it in MainTask to make shots. Use the wiki to learn new functions.

http://pastebin.com/3yxEV6N5   
« Last Edit: August 21, 2011, 08:20:46 AM by Helepolis »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #498 on: August 21, 2011, 06:52:08 AM »
Lucas, I don't think using tasks in a beginner example is good idea. Generally, a beginner's script just has a bunch of stuff in @MainLoop chock full of ifs and loops with no subs or functions. Basically, the least amount of programming concepts you can possibly introduce while still making varying attacks.

I apoligize if this may annoy anyone but could someone please try to explain danmakufu. I've read all the tutorials, printed them out, looked at he faq and i can't even make the simplest attack. Plz don't link to other topics are say something bad. If your not answering, plz don't post...

You're quite right about your post annoying people. I'm sure you didn't intend to come off like this but saying "If your not answering, plz don't post..." makes you sound really conceited. As Mewkyuu said, you could have at least pointed at a specific part you're having trouble with because I don't think we have any psychics around here. Considering you said you tried all the tutorials and are still don't seem to understand enough to produce a script, I can try guessing though:

 * Are you having trouble running Danmakufu without crashing?
 * Are you having trouble making a script that doesn't cause an error message to appear?
 * Are you having trouble understanding how variables or control statements work?
 * Are you having trouble understanding how changing stuff in one of Danmakufu's functions (like CreateShot01) changes how it works when run?

As a side note, I'd like to point out that making a game is a lot harder than it sounds. It's really easy to underestimate the amount of effort it takes to even make a simple game. Also, programming/scripting is not for everyone. It demands that you think in a way that is different than normal (which might explain why stereotypically, programmers are given certain personality traits) and some people have a hard time thinking that way.

EDIT:
Also, this is the simplest attack possible:
Code: [Select]
#TouhouDanmakufu
#Title[Simplest Attack Possible]
#ScriptVersion[2]

script_enemy_main {
    @Initialize {
        SetLife(1);
    }

    @MainLoop {
        CreateShot01(GetX, GetY, 3, 90, RED01, 10);
    }
}
It's also impossible to beat because the boss does not have a hitbox. If you don't know why or how something works in here, point it out. I'll try explaining.
« Last Edit: August 21, 2011, 07:05:16 AM by Blargel »
<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.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #499 on: August 21, 2011, 08:22:07 AM »
I am still unhappy that regular members of RikaNitori still do not put large blocks of code in pastebin links.


Naeten Scarlet

  • The Vampire that Control Dimensional Borders
  • Mu~ -?^?-
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #500 on: August 21, 2011, 06:38:54 PM »
Mmm... I'm getting this mistake:

---------------------------
ScriptError「E:\danmaku related stuff\Danmakufu~\th_dnh\script\Umi no Charlotte\UmiSpell01.txt」
---------------------------
SetShotDataAの対象にはできません(347行目)

            SetShotDataA(1,0,1,dir,0.2,0,1,AQUA31);            FireShot(1);            CreateShotA(2,GetEnemyX+20*cos(dir),GetEnemyY+20*sin(dir)
~~~
---------------------------
Aceptar   
---------------------------

Here's the script: http://pastebin.com/3DaRtEDi
*Insert signature that shows an awesome shikieiki-sama sign*

Schezo

  • en-counse
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #501 on: August 21, 2011, 10:17:02 PM »
I'll have to get home to test this but one thing I'd like to point out is you have a bit of redundancy in your script:

                        wait(120);
                        yield;
 
you already declared a function that is looping yields for you. So you are really yielding 121 times or frames at this point in the script. I don't think that's what you want and it makes it easier to synch if you use 0's and 5's.

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #502 on: August 22, 2011, 05:05:12 AM »
Quote
[00:00] <~Naut> what did the error message say again?
[00:00] <~Naut> oh hm
[00:00] <~Drake> not able to, setshotdataa target
[00:00] <~Drake> (verb)
[00:01] <~Drake> well it loops
[00:01] <~Drake> but it fires the shots so it should free up
[00:05] <~Naut> he creates lasers with ID 1
[00:05] <~Naut> they are not fired
[00:05] <~Naut> shot tries to use id 1 but the laser already has it
[00:05] <~Naut> -> kunai task
[00:05] <~Drake> wait what
[00:06] <~Drake> ugh
[00:06] <~Drake> i saw object bullet and figured that was the whole task
[00:06] <~Drake> the laser isn't even fired
[00:06] <~Drake> lol
[00:06] <~Naut> mhm.

Yeah, free up the shot ID by either getting rid of the laser in your kunai task or changing its ID.

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

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #503 on: August 26, 2011, 10:57:36 PM »
I keep getting the "th_dnh has stopped working" whether i'm using applocale or not.

There was another download somewhere that i was able to use without troubles (due to some edits or whatever with it) but i cant seem to find it.
I had a teacher who used to play radiohead during class once.

ONCE.

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #504 on: August 26, 2011, 11:07:41 PM »
During a script or on startup? For the latter, have you tried starting the game through the config.exe? Tried deleting your script_index.dat?

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

Cabble

  • Ask me about my Cat.
  • Not unwilling to shank you.
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #505 on: August 26, 2011, 11:15:22 PM »
On Startup. I just tried starting through config and it worked though, thanks
I had a teacher who used to play radiohead during class once.

ONCE.

Uzumaki_tenma

  • JAOOOOOOOOO!!!!!!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #506 on: August 27, 2011, 03:02:50 AM »
Uhm sry for the question:

What can I do to make an enemy moves its position? (I don't know how to do it, and I always put in @Initialize "SetMovePositionHermite(cx,120,-90,290,0,0,100);" )

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #507 on: August 27, 2011, 03:05:19 AM »
Assuming you already have cx defined as a variable, that should work, I think.

Edit: You can also use any of the following:
SetMovePosition01(destinationX, destinationY, VelocityOfMovement);
SetMovePosition02(destinationX, destinationY, FramesToMove);
SetMovePosition03(destinationX, destinationY, weight, maxSpeed);

Uzumaki_tenma

  • JAOOOOOOOOO!!!!!!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #508 on: August 27, 2011, 04:11:23 AM »
No, the problem supposes:

http://pastebin.com/nXhnDcES    Large blocks of code goes into pastebin.com -Hele

I mean, in a certain moment the character might appears and move to the center of the screen, but I don't know how to do it...

P.S. this is an incomplete script, there's an event for Marisa and Sanae too.
« Last Edit: August 27, 2011, 08:59:12 AM by Helepolis »

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 #509 on: September 07, 2011, 07:19:24 AM »
I'm confused about how CreateLaserC works. Instead of shooting the laser straight from the boss, it always shoots like the laser image is rotated 90 degrees. Another strange part is that only the very middle of the horizontal laser hits the player. I know I'm probably doing something wrong.


Code: [Select]
CreateLaserC(1,GetX,GetY,150,8,3,0);
SetLaserDataC(1,0,3,90,0,0,3);
SetLaserDataC(1,30,3,180,0,0,3);
FireShot(1);
« Last Edit: September 07, 2011, 07:20:56 AM by Ozzy »