Author Topic: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry  (Read 124155 times)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #990 on: January 24, 2016, 11:12:05 AM »
What you're looking for is delaying the looping code for the circular spawn by adding a "wait" for 1 frame or more. See the following:

Will spawn 36 bullets in a circle instantly.
Code: [Select]
loop(36) {
CreateShotA1(x+r*cos(dir),y+r*sin(dir),v,dir,type,delay);
dir+=360/36;
}

Will spawn 36 bullets in a circle, but each bullet spawns with 1-frame delay (at 60fps).
Code: [Select]
loop(36) {
CreateShotA1(x+r*cos(dir),y+r*sin(dir),v,dir,type,delay);
dir+=360/36;
yield;   // Added a yield for 1-frame delay
}
I typed only variables because you decide the rest. r = radius.

You probably want to use the 2nd one if I judge your post. The more frame-delay, the slower the circle is formed.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #991 on: January 24, 2016, 04:00:58 PM »
Tried it out, and it's not really what I'm looking for...

Referring to Satellite Himawari again. See how the places where the bullets spawn kind of circle around Patchouli, instead of creating one, singular ring at the same time? That's what I'm looking for.

Sorry if I'm being bothersome, I just can't get this to work at all...
Lunatic 1CCs: PCB, IN, PoFV, HSiFS
Extra: All except PC-98.

Oh hey look I can do DNH scrips.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #992 on: January 24, 2016, 04:57:03 PM »
Tried it out, and it's not really what I'm looking for...

See how the places where the bullets spawn kind of circle around Patchouli, instead of creating one,
And that is exactly achieved with delaying the loop for spawning such a circle per frame.
[attach=1]


You know, you might want to actually show us some code in pastebin, so we can see what you're doing. This is going nowhere to be honest.
« Last Edit: January 24, 2016, 05:06:22 PM by Helepolis »

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #993 on: January 24, 2016, 04:58:10 PM »
Tried it out, and it's not really what I'm looking for...

Referring to Satellite Himawari again. See how the places where the bullets spawn kind of circle around Patchouli, instead of creating one, singular ring at the same time? That's what I'm looking for.

Sorry if I'm being bothersome, I just can't get this to work at all...

Well, I didn't want to give you the entire thing, but w/e
Code: [Select]
while(!Obj_IsDeleted(objBoss){
    loop(2){
        CreateShotA1(ObjMove_GetX(objBoss) + 60*cos(angleT), ObjMove_GetY(objBoss) + 60*sin(angleT), 1, angleT, 1, 0);
        angleT += 360/2;
    }
    angleT+=2.6; //angle to increment each time. Should not divide into 360
    wait(2);
}

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #994 on: January 24, 2016, 05:19:59 PM »
Well, I didn't want to give you the entire thing, but w/e
Code: [Select]
while(!Obj_IsDeleted(objBoss){
    loop(2){
        CreateShotA1(ObjMove_GetX(objBoss) + 60*cos(angleT), ObjMove_GetY(objBoss) + 60*sin(angleT), 1, angleT, 1, 0);
        angleT += 360/2;
    }
    angleT+=2.6; //angle to increment each time. Should not divide into 360
    wait(2);
}

Oh my lord, it worked! Thank you so very much!!
The problem was, I wasn't increasing the value of angleT... The moment I put "angleT++;" in @MainLoop, it magically started working. :getdown:
Lunatic 1CCs: PCB, IN, PoFV, HSiFS
Extra: All except PC-98.

Oh hey look I can do DNH scrips.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #995 on: January 24, 2016, 06:10:20 PM »
I've been looking through Danmakufu's default system functions and messing with them, and I've hit a problem.
Where do I tell a script to use a different pause script to the default?
Is a specific kind of script needed? (e.g. stage/package)

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #996 on: January 24, 2016, 08:01:46 PM »
I've been looking through Danmakufu's default system functions and messing with them, and I've hit a problem.
Where do I tell a script to use a different pause script to the default?
Is a specific kind of script needed? (e.g. stage/package)

Use this function: http://dmf.shrinemaiden.org/wiki/Private_System_Functions#SetPauseScriptPath

I put it in @Initialize of my System file.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #997 on: January 28, 2016, 06:49:16 PM »
EDIT: Alright, nevermind. Figured it out myself...
« Last Edit: January 28, 2016, 07:22:56 PM by iVAwalys »
Lunatic 1CCs: PCB, IN, PoFV, HSiFS
Extra: All except PC-98.

Oh hey look I can do DNH scrips.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #998 on: January 29, 2016, 03:31:52 PM »
iVAlways: I think it'd be a good idea to leave the question up and edit in how you answered it for the sake of others scrolling / searching this thread looking for answers.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #999 on: January 29, 2016, 08:38:15 PM »
Help please.
How should I connect two objects (for example: GetObjectDistance( obj1, obj2 ); when both of objects are in different loops?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #1000 on: January 29, 2016, 09:49:36 PM »
Use CommonData to get all the parametters about the objects you need?

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #1001 on: January 30, 2016, 02:24:51 AM »
Help please.
How should I connect two objects (for example: GetObjectDistance( obj1, obj2 ); when both of objects are in different loops?
See my post last page:
https://www.shrinemaiden.org/forum/index.php/topic,16584.msg1230565.html#msg1230565

The answer is essentially, define the variables that store the object IDs in a scope accessible by both loops. If your loops create your objects and assign it some behavior, do like I write in that post where you wrap the "behavior" task in a function that returns the new object.

Again, the level of detail changes depending on your actual problem. How many objects? Are they created and deleted often?

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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #1002 on: January 30, 2016, 08:31:04 AM »
See my post last page:
https://www.shrinemaiden.org/forum/index.php/topic,16584.msg1230565.html#msg1230565

The answer is essentially, define the variables that store the object IDs in a scope accessible by both loops. If your loops create your objects and assign it some behavior, do like I write in that post where you wrap the "behavior" task in a function that returns the new object.

Again, the level of detail changes depending on your actual problem. How many objects? Are they created and deleted often?

I did completly what you write on that post (before that). But problem is loop. I need a ring of bullets. That means:
Code: [Select]
function ObjectA(){
    ascent( i in 0..10){ // for example creating rings, but naturally this will wrong, because id will not return
        let objA = ObjSomething_Create();
    }
    // initialize objA
    task DoStuffA(objA){
        while(!Obj_IsDeleted(objA)){
            // running object behaviour
            yield;
        }
    }
    DoStuffA(objA);
    return objA;
}
that's why I made than this
Code: [Select]
task TShot{
   ascent(i in 0..10){
      let obj = ObjectA(); //Creating rings, but id is again in the loop.
   }
}
Is it possible to get this id out or something like that?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #1003 on: January 30, 2016, 09:19:54 AM »
Maybe I'm wrong but if I understand, in your function you create a ring of 10 bullets and then, in the task, you repeat 10 time the same ring of bullets?
If you want just a ring of bullet, you don't need one of the two ascent I think. Of maybe I just don't understand what you want to do...

Or if you really want to use the two ascent, can you do something like that?

Code: [Select]
function ObjectA(){
    let objA = ObjSomething_Create();
    // initialize objA
    task DoStuffA(objA){
        while(!Obj_IsDeleted(objA)){
            // running object behaviour
            yield;
        }
    }
    DoStuffA(objA);
    return objA;
}
and then, if the task
Code: [Select]
task TShot{
   ascent(i in 0..10){
      ascent(j in 0..10){
         let obj = ObjectA(); //Creating rings, but id is again in the loop.
      }
   }
}
You do the function's ascent with ascent (i in 0..10) and then, the task's ascent with ascent (j in 0..10).

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #1004 on: January 30, 2016, 09:33:50 AM »
Maybe I'm wrong but if I understand, in your function you create a ring of 10 bullets and then, in the task, you repeat 10 time the same ring of bullets?
If you want just a ring of bullet, you don't need one of the two ascent I think. Of maybe I just don't understand what you want to do...

Oh, Sorry my English is not clear?
I want to connect two objects (like for example GetObjectDistance(obj1,obj2) ), but both objects are in different loop making rings. With SetCommonData (as you said before) I have no imagination how could I do that.