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

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #810 on: March 27, 2013, 06:26:44 PM »
What error? Can you post a screenshot? Does your script work as intended as long as you don't have the extra condition? Is the script you're trying exactly the same as the one you just posted but with || GetTimer < number added to each condition?

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

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #811 on: March 27, 2013, 06:40:57 PM »
What error? Can you post a screenshot? Does your script work as intended as long as you don't have the extra condition? Is the script you're trying exactly the same as the one you just posted but with || GetTimer < number added to each condition?


*head desk* oh sure now it wants to work. lols

Anyway on to a bigger problem I have. I don't know how to make somehting like Sakuya's time stop in her cards on EoSD. How would someone go about that?
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.


Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #813 on: March 27, 2013, 08:07:26 PM »
TimeStop(lengthinframes, 1, 1, 1)


...how the hell did I miss that? lols thx now I can pretty much finish my timeout. =)
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

Qwertyzxcv

  • yas
  • k!
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #814 on: March 27, 2013, 08:55:34 PM »
Sorry, that's definitely my bad. index is a keyword in DNH where index(x,y) does the same as x[y]. I switched around my tested variable names for clarity and forgot about it.
So, how do I fix it?

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #815 on: March 27, 2013, 10:06:30 PM »
Change index to a different variable name.

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #816 on: March 27, 2013, 10:22:17 PM »
working on non spells. I have the shots bouncing off the left and right walls but can't seem to figure out how to get them to bounce off  of the Min Y. Any help would be appreciated. =D


EDIT: also having this problem:

Code: [Select]

if(Obj_GetX(obj)>GetClipMaxX) {
                     Obj_SetAngle(obj, atan2(GetPlayerY - Obj_GetY(OBJ_SHOT), GetPlayerX - Obj_GetX(OBJ_SHOT));
                     Obj_SetX(obj,  Obj_GetX(obj) - 0.1);
              }


I am wanting to have my bullets aim towards the player after bouncing off the side walls but it is giving me an error as I try to test it. an ideas?


EDIT EDIT: nvm...I feel bad for missing what I did wrong but I still need help boundcing them off the ceiling.
« Last Edit: March 27, 2013, 11:41:49 PM by Marisa Kirisame »
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

Maths ~Angelic Version~

  • Aspiring Mathematician of Brilliant Laziness
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #817 on: March 28, 2013, 12:22:24 AM »
If you want the bullets to bounce off the ceiling "normally" (mimicking a reflection), the new angle has to be -Obj_GetAngle(obj), not 180-Obj_GetAngle(obj).

PhantomSong

  • The Ghost Living through Everyday Life.
  • Eh, it doesn't matter.
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #818 on: March 28, 2013, 02:33:37 AM »
ER... I can't pay attention... But uhm when I use Laser C the curving looks bad... is there anyway to fix that?
« Last Edit: March 28, 2013, 02:35:13 AM by PhantomSong »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #819 on: March 28, 2013, 02:52:20 AM »
ER... I can't pay attention... But uhm when I use Laser C the curving looks bad... is there anyway to fix that?

Please elaborate on 'looks bad.' Are you referring to it thinning out to the point you can't see it until you've been speared? Pixel issues where it's not smooth?

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #820 on: March 28, 2013, 06:06:40 AM »
ER... I can't pay attention... But uhm when I use Laser C the curving looks bad... is there anyway to fix that?

Some people here on MoTK has made shotsheets containing "better" curving laser graphics, if that would help.

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #821 on: March 28, 2013, 12:36:27 PM »
ok something weird's going on. I was finishing up a spell and it was testing ok until I added the 8th wave to it. now it won't play at all and Iam getting this:

[attach=1]

can someone help me figure out what's going on?

The code is here (I know it's long)

http://pastebin.com/VhA4jGdR
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

gtbot

  • Master of ScreenSplit
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #822 on: March 28, 2013, 12:40:31 PM »
You're missing a closing bracket for @MainLoop.

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #823 on: March 28, 2013, 12:45:15 PM »
You're missing a closing bracket for @MainLoop.

*tries*

*head hits wall*

Thanks. I looked it over about 90 times and I guess somehow missed it.
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #824 on: March 28, 2013, 03:46:08 PM »
Better to keep it in mind for everybody,  script_enemy_main errors are 99% of the time {  }  related errors.

Blargel and I even made a flow chart for it. http://www.shrinemaiden.org/forum/index.php/topic,4155.msg186037.html#msg186037

Try to first check that next time. Helps one also improve in backtracking errors. Of course if you really don't know what the hell is going on feel free to post :V

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #825 on: March 28, 2013, 10:33:47 PM »
This might seem not relevant. But...
What exactly is SetCommonData and GetCommonData?
I have been wondering this question. I've even tried to search it up.
Currently a normal player

Nuclear Cheese

  • Relax and enjoy the danmaku.
    • My homepage
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #826 on: March 28, 2013, 11:13:10 PM »
script_enemy_main errors are 99% of the time {  }  related errors.

This is not limited to script_enemy_main.  Or Danmakufu, really - the only reason it's worse for us in Danmakufu is because we (mostly) can't understand the error messages it pops up.


This might seem not relevant. But...
What exactly is SetCommonData and GetCommonData?
I have been wondering this question. I've even tried to search it up.

CommonData allows you to set up named values that are shared between all scripts currently running in Danmakufu.  SetCommonData defines one of these (giving it a name and a value), whereas GetCommonData retrieves the value of one given its name.
GetCommonDataDefault is pretty useful too, since it allows you to specify a default value that will be returned if the specified name has yet to be defined.
This can be used to pass values, say, from a stage script to the enemies spawned by the stage, allowing it to tell them certain parameters for their behavior (such as a difficulty level, for instance).  Another possible use would be to coordinate multiple objects to have them all act at the same moment (at that moment, set a common data to a certain value - the other objects will then read this value and act on when it updates).

Another awesome thing that can be done with these is via SaveCommonData and LoadCommonData - these allow you to save off and then later reload persistent values in between play sessions.  This can be used to store things like unlocks, spellcard attempt and capture counts, etc.

Disclaimer: I don't remember ever trying it, but I'm a bit suspicious about how common data might interact with replays.  Tread lightly (at the least, you may want to check if you're in a replay, and not call SaveCommonData in that case).


On an unrelated note - did my more recent post help you out with your player script?
to quote Naut:
"I can see the background, there are too many safespots."
:V

Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #827 on: March 28, 2013, 11:40:38 PM »
Ahh that helped.
The player script homing bullets are function well.
Only problem is that if you stay to the top left of the boss.
The right homing bullets would turn right, it doesn't hit the boss,when it is bigger than 0, it will start to turn left. It looks really weird.
It kind of looks like an infinity sign.
Otherwise, I can start making the bombs. And hopefully the rest of the game.
Currently a normal player

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #828 on: March 29, 2013, 06:45:36 AM »
This is not limited to script_enemy_main.  Or Danmakufu, really - the only reason it's worse for us in Danmakufu is because we (mostly) can't understand the error messages it pops up.
Mostly you don't need to in order to hunt down the basic errors. A line number is often given or the part of the code where it breaks down. I am sure you don't need to read any of the Japanese error message to figure out where it went wrong. Of course, what went wrong, is reported in the JP text and probably makes your life easier if you know/can read.

The real danger with line numbers is when #Include_function is used. You will be returned line numbers which aren't in the original file where #include is called. This is also one of the reasons to program step by step. After writing a new object bullet or part of code -> Test. Many new people try to script 5000000 lines and then test it out, running into thousands of errors. That just doesn't work.

And afaik we also even got a translated error message thread. No idea where that one is. Edit: It is in the same thread I linked :V
« Last Edit: March 29, 2013, 06:54:45 AM by Helepolis »

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #829 on: March 29, 2013, 05:20:58 PM »
Ok i have pretty much everything worked out for my time out. I just need help making two large stationary knives the rotate on command. Any assistance would be appreciated.
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #830 on: March 29, 2013, 09:27:51 PM »
...Yet another object effect question.

Code: [Select]
  task Option(ID){
    let objoption=Obj_Create(OBJ_EFFECT);
    let optionx = 30;
    let optiony = 15;
    Obj_SetAlpha(objoption,200);
    ObjEffect_SetTexture(objoption,img_kogasa);
    ObjEffect_SetRenderState(objoption,ALPHA);
    ObjEffect_SetPrimitiveType(objoption,PRIMITIVE_TRIANGLEFAN);
    ObjEffect_CreateVertex(objoption,4);       
    ObjEffect_SetVertexUV(objoption,0,210,162);    // four coordinates of orb on spritesheet
    ObjEffect_SetVertexUV(objoption,1,226,162);    //Assuming 0:LXTY, 1:RXTY, 2:RXBY, 3:LXBY
    ObjEffect_SetVertexUV(objoption,2,226,178);   //L,eft R,ight T,op B,ottom. Hope correct.
    ObjEffect_SetVertexUV(objoption,3,210,178);//DONE
    while(!Obj_BeDeleted(objoption)){
      optionx = GetPlayerX+optionxrad*cos(optioncount+90*ID);
      optiony = GetPlayerY+optionyrad*sin(optioncount+90*ID);
      /*ObjEffect_SetVertexXY(objoption,0,Obj_GetX(objoption)-8,Obj_GetY(objoption)-8);
      ObjEffect_SetVertexXY(objoption,1,Obj_GetX(objoption)+8,Obj_GetY(objoption)-8);
      ObjEffect_SetVertexXY(objoption,2,Obj_GetX(objoption)+8,Obj_GetY(objoption)+8);
      ObjEffect_SetVertexXY(objoption,3,Obj_GetX(objoption)-8,Obj_GetY(objoption)+8);*/
      ObjEffect_SetVertexXY(objoption,0,optionx-8,optiony-8);
      ObjEffect_SetVertexXY(objoption,1,optionx+8,optiony-8);
      ObjEffect_SetVertexXY(objoption,2,optionx+8,optiony+8);
      ObjEffect_SetVertexXY(objoption,3,optionx-8,optiony+8);
      Obj_SetPosition(objoption, optionx, optiony);
      ObjEffect_SetAngle(objoption, 0, 0, Obj_GetAngle(objoption)+1);
      if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD){
        //Focused option shot below
        if(count%6 == 3){
          CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 15, 270, 2, 1, 18);
          CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 8, 270, 2, 3, 23);
}
      }else{
        if(count%8 == 4){
          CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 15, 270, 2, 1, 18);
          CreatePlayerShot01(Obj_GetX(objoption), Obj_GetY(objoption), 8, 270, 2, 3, 23);
        }
      } //closes the if else
      yield;
    }
  }

Basically, I have four options that are *supposed* to rotate around the player in an elliptical path. The positioning is correct, since the shots were created at the correct location, but the graphics float towards the lower left corner, and are only close to the player when in the top left corner of the screen.

This ObjEffect_SetVertexXY problem has probably been answered before. However, I've tweaked it many times and it refuses to work correctly.

If anyone can provide an answer, I'd be truly grateful.

Sorry for posting something that has probably been answered already.

Edit: If the problem has to do with the ID, then I can fix that when it comes to the XY coordinates. However, everywhere I look, there's a different way to use XY.

I'm going to dig around for Drake's last answer to my questions and see if that answers it.
« Last Edit: March 29, 2013, 09:29:26 PM by Sparen »

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #831 on: March 29, 2013, 10:12:04 PM »
Ok i have pretty much everything worked out for my time out. I just need help making two large stationary knives the rotate on command. Any assistance would be appreciated.
Shot objects, learn them. Read the intermediate tutorial. You cannot accomplish this without manipulating objects.


Quote
However, everywhere I look, there's a different way to use XY
No there isn't. If it's doing anything other than creating the basic structure of the rendered effect, they're doing it wrong. The solution to the problem is the same I've given to you twice before. Your XYs should be set once, before the running loop, at (-8, -8), (8, -8), (8, 8), (-8, 8). That's it.

- Obj_SetAlpha() doesn't work for effect objects. Loop through the vertices and use SetVertexColor.
- The order of coordinates of your UV vertices, when using FAN and STRIP with 4 vertices, don't matter as long as they match the order of your XYs. You can make your second vertex the 0th vertex and as long as it's the same in your XYs it won't change the image.
- ObjEffect_SetAngle(objoption, 0, 0, Obj_GetAngle(objoption)+1) shouldn't work because ObjEffect_SetAngle refers to the image's rotation while Obj_Get/SetAngle refers to the object's angle of velocity.
« Last Edit: March 29, 2013, 10:14:17 PM by Drake »

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 #832 on: March 29, 2013, 11:43:18 PM »
Thanks. Now a stupid question.

Obj_SetSpeed doesn't seem to work on Object Lasers. Is there any way to get around this and get lasers to move? Besides SetPosition, etc.

Code: [Select]
  task Laser(OrigX,OrigY,angle,ID){
    let obj_bluelaser = Obj_Create(OBJ_LASER);
    Obj_SetSpeed(obj_bluelaser, 5);
    ObjShot_SetGraphic(obj_bluelaser, ID);
    ObjShot_SetDamage(obj_bluelaser, 1.5);
    ObjShot_SetPenetration(obj_bluelaser, 2);
    ObjLaser_SetWidth(obj_bluelaser, 6);
    ObjLaser_SetLength(obj_bluelaser, 30);
    ObjLaser_SetSource(obj_bluelaser, false);
    Obj_SetPosition(obj_bluelaser, OrigX, OrigY);
    Obj_SetAlpha(obj_bluelaser, 130);
    Obj_SetAngle(obj_bluelaser, angle);
  }

Basically, it's not working correctly. The Obj_Set (Width/Length/Angle/Graphic/Position) works, but Obj_Set (Speed) doesn't. I think that Damage and Penetration work.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #833 on: March 30, 2013, 12:48:54 AM »
Is there a particular reason you need an object laser? Your current code doesn't do anything that requires a laser object as long as you have a longer more laserlike graphic. For that matter it doesn't seem to do anything that you couldn't do with CreatePlayerShot01.

I mean you could use SetPosition, but object lasers expand from 0 to full width. It's primarily meant for installation lasers, hence why SetSpeed doesn't work.

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 #834 on: March 30, 2013, 01:17:53 AM »
Is there a particular reason you need an object laser? Your current code doesn't do anything that requires a laser object as long as you have a longer more laserlike graphic. For that matter it doesn't seem to do anything that you couldn't do with CreatePlayerShot01.

I mean you could use SetPosition, but object lasers expand from 0 to full width. It's primarily meant for installation lasers, hence why SetSpeed doesn't work.

OK. Yeah, it's just for stretching the graphic, mostly. However, I want the width to be different, and that's the issue. I mean, I could try using an effect object, but that's probably going to mess up.

Edit: The shots work when I used effect objects. Question closed.
« Last Edit: March 30, 2013, 01:46:07 AM by Sparen »

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #835 on: March 30, 2013, 05:13:41 AM »
Shot objects, learn them. Read the intermediate tutorial. You cannot accomplish this without manipulating objects.


I know how to make and control with a shot object, my problem becomes making knives bigger than normal. the Laser objects don't have a graphic setting and the shot objects (at least from what I have read) can't change size form the original graphic.

That is where I need help. A laser object would be most ideal but I need to know how to set its graphic
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #836 on: March 30, 2013, 06:23:59 AM »
Exactly as you would a shot object. Laser objects are subclasses of shot objects. Sparen just posted an example of a setup.

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

Marisa Kirisame

  • "So what if she's a girl, da ze?"
  • Marisa X Alice for life
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #837 on: March 30, 2013, 08:58:32 PM »
Exactly as you would a shot object. Laser objects are subclasses of shot objects. Sparen just posted an example of a setup.

Thanks I finally have them made. I wasn't aware they could crossover like that for Laser object. Now if my rotation function would decide to work, I'd be happy. =)
"Ok I admit it. The endless night, corrupting the moon, hiding the human village and putting those funny little hats on statues; it's all Alice's fault. Now bitch, get out of the way!" -Marisa Kirisame from Touhou 8 Imperishable Night.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #838 on: March 30, 2013, 10:24:30 PM »
Thanks I finally have them made. I wasn't aware they could crossover like that for Laser object. Now if my rotation function would decide to work, I'd be happy. =)

If you say work on command, do you mean something like this?

Code: [Select]
script_enemy_main{
let callrotate = false;

//If using tasks and got a wait function ready

task maintask{
loop{

wait(200);
callrotate = true;
wait( x ) // How long rotation lasts?
callrotate = false;

}}

//(Inside the object)
while(!Obj_BeDeleted(ID)){

if(callrotate == true){
// Insert rotation code
}

yield;
}

Drake

  • *
Re: ※ Q&A/Problem Thread 6 ※ for OLD Danmakufu version (0.12m)
« Reply #839 on: March 30, 2013, 10:39:00 PM »
Settings flags like that would be actually useful in some contexts if you didn't end up setting callrotate at predetermined intervals. At that point you might as well just have
while(!Obj_BeDeleted(ID)){
   loop(x){ yield; }
   loop(200){
      // Insert rotation code
      yield;
   }
}

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