Author Topic: ※ Danmakufu Q&A/Problem thread 3 ※  (Read 468993 times)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #240 on: July 23, 2016, 12:03:54 PM »
Quote
GetPlayerLife and ObjMove_GetX are both standard functions, so I don't understand why having them called in menu script is causing problems.
I think it's because these functions are not defined in the Package Script. Pause Menu is called in the Package and depend of it. Even if a Stage Script is runnig.
A lot of stage script functions are not defined i the package. I have the same issue. But you just need to remove all functions and task using these default function from your file and put it in another file.


Anyway, I have a question.
I want to make bullet that reflect on a round surface instead of on walls. I know how to calculate the angle after reflection on a wall but I have no idea for the reflection on a round surface.
Did someone know what math formula I need to use to know this final angle, depending on the initial angle?
« Last Edit: July 23, 2016, 12:05:31 PM by Lefkada »

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #241 on: July 23, 2016, 05:29:37 PM »
So I made a player script using Helepolis's tutorial, but it always has the same crash report even if I do it word for word.
The report reads as follows:
 ObjPrism_Create is not defined.
(ObjPrism_Createは未定義の識別子です)
G:/th_dnh_ph3/script/player/marisa/playermarisa.txt
playermarisa.txt line(行)=11


 let playerObj = ObjPrism_Create縺ッ譛ェ螳夂セゥ縺ョ隴伜挨蟄舌〒縺・;
 let hitboxObj = ObjPrism_Create縺ッ譛ェ螳夂セゥ縺ョ隴伜挨蟄舌〒縺・;
 let count = -1;
 let isFocus = false;
 
 // Shot Sheet
 let shotMarisa = CSD ~ "playershot.txt";
 
 // Texture Sheet
~~~
I don't understand why it won't work.

Conarnar

  • reeeeeeeeeeeeeeeeeee
  • aaaaaaaaaaaaaaaaaaa
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #242 on: July 23, 2016, 05:30:15 PM »
To make something bounce off of a non horizontal or vertical surface, you use the formula
Code: [Select]
360 - angle + 2 * surfacewhere angle is the angle of the object and surface is the angle of surface.

Since the object is bouncing off of a round surface, the angle of the surface would be the angle of the tangent line to the circle where the object is. That would be
Code: [Select]
angle + 90where 90 is the angle from the object to the center of the circle.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #243 on: July 23, 2016, 06:00:30 PM »
Thanks.
So, if I understand well, the code will be somethinng like this:

Code: [Select]
newangle = 360 - ObjMove_GetAngle(obj) + 2 * (atan2(ObjMove_GetY - CircleCenterY, ObjMove_GetX - CicleCenterX) + 90);I think the angle of the surface is the same as the angle between the point were the object colide with the circle and the center of this circle. Right?

edit: tested and it actually work. I'm not sure if it work really well but it work and the angle seems correct most of the time. Thanks a lot.
« Last Edit: July 23, 2016, 08:01:29 PM by Lefkada »

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #244 on: July 23, 2016, 10:59:19 PM »
So I made a player script using Helepolis's tutorial, but it always has the same crash report even if I do it word for word.
The report reads as follows:
 ObjPrism_Create is not defined.
Prim as in "Primitive"

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #245 on: July 24, 2016, 10:21:53 PM »
I'm working on a custom pause menu, but there are two things I can't get working.
  • Including a file of standard tasks and functions, I get an error saying ObjMove_GetX is not defined in the file I'm trying to have included.
  • Trying to get the player's current life, I get GetPlayerLife is not defined.

GetPlayerLife and ObjMove_GetX are both standard functions, so I don't understand why having them called in menu script is causing problems.



Also I've got a simple item that can execute some commands when you collect it, but since it only checks if the item is deleted the same event will happen if it falls off-screen. How can I check if the item has been collected by the player?

Code: [Select]
task LifeItem(x,y){
let obj = CreateItemU1(1,x,y,0);
while(!Obj_IsDeleted(obj)){yield;}
PlaySE(shot1);
LifeFragment += 3;
}

You may think of pause menus as being categorized as the same as package scripts. You should assume that there is no such thing as an object that can use ObjMove_ series of functions.
That said, anything with ObjMove_ is considered as not a usable function. Similarly, since there is no such thing as a player, GetPlayerLife is not defined.

You may want to split your general-use tasks and functions #include file into another file for use in stages, along with the original file. Just remember to include the new file in all of your stages / singles / etc.

By the way, one way is that you can constantly keep track of the player's life using common data. It's kind of an annoying thing to do, but it's one simple workaround.



If you constantly keep track of the object's y-coordinate inside your while(!ObJ_IsDeleted(obj)) { } loop, you can have conditional behaviour based on your variable that represents the y-coordinate. That way you won't constantly hear the sound or have the life fragment count raised when it shouldn't be raised.

Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #246 on: July 25, 2016, 02:09:16 AM »
So I made a player script using Helepolis's tutorial, but it always has the same crash report even if I do it word for word.
The report reads as follows:
 ObjPrism_Create is not defined.
(ObjPrism_Createは未定義の識別子です)
G:/th_dnh_ph3/script/player/marisa/playermarisa.txt
playermarisa.txt line(行)=11


 let playerObj = ObjPrism_Create縺ッ譛ェ螳夂セゥ縺ョ隴伜挨蟄舌〒縺・;
 let hitboxObj = ObjPrism_Create縺ッ譛ェ螳夂セゥ縺ョ隴伜挨蟄舌〒縺・;
 let count = -1;
 let isFocus = false;
 
 // Shot Sheet
 let shotMarisa = CSD ~ "playershot.txt";
 
 // Texture Sheet
~~~
I don't understand why it won't work.

It's ObjPrim, not ObjPrism.  :]

Question was already answered few posts above, please read the new posts fully before posting selectively. -Hele
« Last Edit: July 25, 2016, 06:58:23 AM by Helepolis »
foo = foldl $ flip ($)
Highest difficulty 1CCed for each game, by shot type in the original order. (-: never 1CCed on any difficulty, or never used; E: easy, N: normal, H: hard, L / U: lunatic / unreal.)
EoSD [NNNE] PCB [EE--N-] IN [NEEE + Ex Border] PoFV [Mystia N, Mystia E no charge] MoF [EN--H- + Ex Marisa B] SA [N-----] UFO [----EN] TD [NENE] DDC [EE-EHE + Ex Marisa B & Sakuya A] LoLK [PD --N- Legacy ---N] EE [N- + Ex Yabusame] EMS [N-- + Ex Yabusame] RMI [NHN + Ex YaoSuku]
Avelantis (demo) Easy YuukiB 426,077,200

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #247 on: August 03, 2016, 03:46:37 AM »
Hello again, and thank you for the help on my previous problem! Now I have a problem that I've been throwing myself at for hours but can't seem to figure out... I'm trying to make a bullet pattern that functions like the "wave" portion of Border of Wave and Particle (where the bullets are connected and wobble, not the part where they seem to go separate), but with an extra wobbly wave to it. Ideally, the pattern would produce 5 curved partitions that rotate, then stop and wobble/have another wave go through them before rotating again. I've managed to get curves that reverse direction and other interesting effects, but not what I'm looking for. I have two different tries of this task code; below is the more recent and cleaner version of the code (the other one involves an alternative case used as a timer that really messes things up, so I scrapped it).

Code: [Select]
task LostWaves{
    let angleT = rand(0, 360);
    let objcount = 18;
    loop{
        loop(5){
let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2, angleT, 45, 5);
            angleT += 360/5;
wait(0.001);
        }
        angleT += sin(objcount) * 8;
if(objcount > 36){
objcount = 18;
angleT += cos(objcount) * 8;
}else{
objcount++;
}
        yield;
    }
}

This code makes the curved lines rotate and change direction (or it did at some point... now it just makes a break in the lines...), which is close but not quite. Does anyone have any ideas?

Thanks in advance!

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #248 on: August 03, 2016, 01:14:07 PM »
Could you perhaps draw out an example of what you're looking for? I can't really envision what you want here. Drawing something should be accurate enough since you're probably aware the individual bullets in the pattern all just move in a straight line anyways.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #249 on: August 03, 2016, 05:45:07 PM »
@ Sami-Fire:
I was about to type out an explanation of BoWaP and link you to Sparen's tutorial on it here (http://sparen.github.io/ph3tutorials/ph3u1l11a.html), but looking at his code it seems you've already done so. (also it's better explained there)
The reason it doesn't change direction is here:
Code: [Select]
        angleT += sin(objcount) * 8;
        if(objcount > 36){ // Note here
            objcount = 18;
            angleT += sin(objcount) * 8;
        }else{
            objcount++;
        }

The issue is that the sin function takes values 0 to 360 to give a value of 1 to -1 and back to 1. sin(18) gives a(n approximate) value of 0.3
0.3 * 8 is 2.4. This is really small, however it does add up. the gap that appears occaisionally is just the difference between angles changing back to sin(18)*8 from sin(36)*8.

This is also why it doesn't reverse direction. the sine function takes 0-90 to get from 1 to 0, 0 to -1, etc. so 0-18 doesn't have much of an effect.
It's late for me and i'm afraid this style of code is sort of hard for me to follow so I'll give this much now and try and play with it more tomorrow.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #250 on: August 03, 2016, 07:27:36 PM »
@ Drake: Sorry about that! Here's a diagram. Hope it helps: here.

@Asthmagician: I see! Thank you for explaining. After poking the code a little more, I figured it had something to do with the sine value being at or above a certain point. Do you have any ideas on how to keep it at a wiggling line (see my diagram above) without it going to the "particle" stage? (It seems that the bullet lines separate about midway through sine counts).

I've revised my code a bit. I've finally gotten the lines to wiggle how I want, at least in the beginning. However, the direction reverses and never seems to go back the other way. objcount is supposed to bounce between 240 and 60 to make the wiggling happen, and it doesn't seem to be doing that. What am I missing?

Code: [Select]
task LostWaves{
    let angleT = rand(0, 360);
    let objcount = 40;
//let oscount = 0;
    loop{
        loop(5){
let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2, angleT, 45, 5);
            angleT += 360/5;
wait(0.001);
        }
        //angleT += sin(objcount) * 8; //BOWAP- Sine makes the oscillation, * 6 ensures there are gaps.
if(objcount >= 240){
angleT -= sin(objcount) * 8;
objcount -= 3;
}else if(objcount <= 60){
angleT -= sin(objcount) * 8;
objcount += 3;
}else{
angleT -= sin(objcount) * 8;
objcount += 3;
}
        yield;
    }
}

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #251 on: August 04, 2016, 06:17:29 AM »
@ Sami-Fire:
The wiggling doesn't happen because objcount doesn't bounce between 240 and 60.
I'll use & comment your code here for reference:
Code: [Select]
    task LostWaves{
    let angleT = rand(0, 360);
    let objcount = 40; // objcount is initialized here
    //let oscount = 0;
    loop{   
        loop(5){
            let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2, angleT, 796, 5);
            angleT += 360/5;
            wait(0.001); //???
        }
        //angleT += sin(objcount) * 8; //BOWAP- Sine makes the oscillation, * 6 ensures there are gaps.
        // if-else block is here and down
        if(objcount >= 240){ // A
            angleT -= sin(objcount) * 8;
            objcount -= 3;
        }else if(objcount <= 60){ // B
            angleT -= sin(objcount) * 8;
            objcount += 3;
        }else{ // C
            angleT -= sin(objcount) * 8;
            objcount += 3;
        }
        yield;
    }
}
The main issue is that the if-else block is tested every frame (actually every sixth frame but I'll discuss that later).
When objcount is initialized, the part I marked C is selected until objcount gets past 60 (61 to be exact) where the part I marked B happens.
As an aside note, B and C look like they do the same thing. is there any reason they're both there?
when objcount reaches A, it has the value of 241. Since this test occurs every (sixth) frame, A is triggered, which reduces objcount by 3.
This means it goes down to 238, thus triggering B, and adding 3, triggering A and taking 3, etc.
The sequence of values looks roughly like:
220, 223, 226, 229, 232, 235, 238, 241, 238, 241, 238, 241, 238, etc.
This is where it seems to get stuck : /\
The stuck behaviour occurs beccause (the sin of) objcount controls the change in angle, rather than the plain angle.
If (the sin of) objcount controlled the actual angle what happened would look a lot more obvious, as the shots would just form straight lines.

On another note, I'll point out that the wait() function (assuming it's the one I'm thinking of) rounds to an integer (whole number), so 0.001 is turned into 1.
The wait function acts as a number of frames rather than a number of seconds, so replacing the current line with wait(1); or just a yield; would functionally change nothing.

The diagram is much clearer, I'll play around and see if I can come up with anything.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #252 on: August 04, 2016, 11:07:05 PM »
Does anyone know if the speed an item flies to a player when auto-collect is called can be changed? 

My project's resolution is much higher than the standard 640x480, one side affect of the higher regulation is that default of speeds of items/players are slower because of how much more pixels they have to cross to get to the other side of the screen.

Having the items be auto-collected quickly when passing the PoC or bombing is necessary for my project since my project's scoring system is similar to DDC.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #253 on: August 05, 2016, 06:40:17 AM »
Yes, but not through the existing item functions presented on the wiki. You'll need to create your own 'movement' piece of code.

Create a custom item tied to an obj variable like
Code: [Select]
let obj = CreateItemU2(....);
Then add movement behaviour code to it using the obj variable to increase dropping speed /spinning etc.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #254 on: August 14, 2016, 10:43:46 AM »
Hi, I started looking into animating my boss with the help of Helepolis's tutorial.
The problem is, i'm using a spritesheet from a fighting game, so I only want to use the idling animation (which uses 8 sprites). But the tutorial uses the "if" and "else", does that mean that if i copy the code, change the numbers to suit my needs and delete the part that isn't for the idling it won't work ? (Danmakufu is my first experience with coding...)
Also, since the idling for my script is twice longer than the one in the tutorial, should i reduce the numbers from 0,15,30,45,60 to 0,7.5,15,22.5,30,37.5,45,52.5,60 if it works ?
Thanks in advance :)

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #255 on: August 14, 2016, 04:22:16 PM »
Instead of copying and pasting it in, write the code yourself! Think of it as an exercise.

As for the numbers, assuming you're talking about the frames in which the sprite changes, you shouldn't use decimals. For example, if your idle animation uses 8 sprites, instead of "15,30,45,60" just simply write "10,20,30,40,50,60,70,80".

If the animation takes too long, simply adjust the speed in which the variable you use for counting those frames increases it's value. (Just don't change it to a decimal!)
Lunatic 1CCs: PCB, IN, PoFV, HSiFS
Extra: All except PC-98.

Oh hey look I can do DNH scrips.

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #256 on: August 18, 2016, 04:51:01 AM »
I'm not sure if this is the right place to ask, but has the Riverbed Soul Saver english patch been completed? This is the newest thing I could find and I didn't want to bump a dead thread.

https://www.shrinemaiden.org/forum/index.php/topic,17407.msg1162315.html#msg1162315
« Last Edit: August 20, 2016, 05:59:02 PM by wobuffet3 »

Lollipop

  • stay woke
  • literally and figuratively dying
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #257 on: August 18, 2016, 11:07:57 PM »
is it possible to declare i global variable from inside a task?

also, how do i make the boss use the 'moving left' sprites when it moves left, and make the boss use the 'moving right' sprites when it moves right?
Touhou 1CCS:
Hard: LLS, EoSD(NB), PCB(NB), IN, MoF, TD, DDC(NB), LoLK
Lunatic: EoSD, PCB, DDC, LoLK
Extra: LLS, EoSD, PCB(Extra&Phantasm), IN, MoF, SA, DDC, LoLK
Current Focus: 1cc SA Hard, or an Extra

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #258 on: August 18, 2016, 11:50:55 PM »
is it possible to declare i global variable from inside a task?

also, how do i make the boss use the 'moving left' sprites when it moves left, and make the boss use the 'moving right' sprites when it moves right?

You cannot declare a global variable from within a task because when you declare a variable within a block such as a task, it cannot be accessed from outside that block.

If you want your boss to use a different set of sprites when it's moving in a different direction, first obtain the direction the boss is moving at (ObjMove_GetAngle), normalize the angle/use trigonometry to determine the direction, and use an if statement to select which sprites to use.

Lollipop

  • stay woke
  • literally and figuratively dying
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #259 on: August 19, 2016, 02:10:52 AM »
You cannot declare a global variable from within a task because when you declare a variable within a block such as a task, it cannot be accessed from outside that block.

If you want your boss to use a different set of sprites when it's moving in a different direction, first obtain the direction the boss is moving at (ObjMove_GetAngle), normalize the angle/use trigonometry to determine the direction, and use an if statement to select which sprites to use.

Can I please have an example?

My scripting skills are bad  :(
Touhou 1CCS:
Hard: LLS, EoSD(NB), PCB(NB), IN, MoF, TD, DDC(NB), LoLK
Lunatic: EoSD, PCB, DDC, LoLK
Extra: LLS, EoSD, PCB(Extra&Phantasm), IN, MoF, SA, DDC, LoLK
Current Focus: 1cc SA Hard, or an Extra

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #260 on: August 19, 2016, 05:30:16 AM »
Can I please have an example?

My scripting skills are bad  :(
As rude as it may sound, but did you check the tutorials?

Drake

  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #261 on: August 19, 2016, 05:44:02 AM »
https://www.youtube.com/watch?v=XL51t2_gxs8

As for the "can I declare a global variable in a task" question, it's important to note what you want to use this for in the first place. Because if the answer is just "no" (which it is), then we can't help any further until you do tell us what you wanted it for.

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

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #262 on: August 19, 2016, 10:33:28 AM »
is it possible to declare i global variable from inside a task?
Variables can only be used inside the "block" it was declared in, so no.
However, you can do something like this:
Code: [Select]
let x = 1; //declared a global variable "x" with the value of 1
task whatever(){
//...
x = 3; //x is now 3 and will remain 3 throughout the entire file until changed
}
I might misunderstand your question but this is how I interpreted it.
« Last Edit: August 19, 2016, 10:35:01 AM by afkwtflol »

Lollipop

  • stay woke
  • literally and figuratively dying
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #263 on: August 19, 2016, 04:32:42 PM »
As rude as it may sound, but did you check the tutorials?

Well, it seems like I've made a fool of myself.

The answer was in the tutorial  :blush:
Touhou 1CCS:
Hard: LLS, EoSD(NB), PCB(NB), IN, MoF, TD, DDC(NB), LoLK
Lunatic: EoSD, PCB, DDC, LoLK
Extra: LLS, EoSD, PCB(Extra&Phantasm), IN, MoF, SA, DDC, LoLK
Current Focus: 1cc SA Hard, or an Extra

Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #264 on: August 20, 2016, 01:18:27 PM »
You could technically alter a global variable from inside a task using Obj_SetValue, or SetCommonData.
Lunatic 1CCs: PCB, IN, PoFV, HSiFS
Extra: All except PC-98.

Oh hey look I can do DNH scrips.

Lollipop

  • stay woke
  • literally and figuratively dying
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #265 on: August 21, 2016, 01:34:30 AM »
Sorry to bother you guys again, but are there any tutorials on how to make a stage?

More specifically, I want a stage that would only have a midboss and a boss, each with their own music and backgrounds.
Touhou 1CCS:
Hard: LLS, EoSD(NB), PCB(NB), IN, MoF, TD, DDC(NB), LoLK
Lunatic: EoSD, PCB, DDC, LoLK
Extra: LLS, EoSD, PCB(Extra&Phantasm), IN, MoF, SA, DDC, LoLK
Current Focus: 1cc SA Hard, or an Extra

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #266 on: August 21, 2016, 01:28:20 PM »
There is no such thing as "sorry to bother". Of course many people do this due to being polite.

A good question. We have exactly 0 tutorials on making stages in ph3.

Summary: A stage is created using #TouhouDanmakufu[Stage] as header. You spawn enemies within the stage and at a certain point you call the Plural script for the boss.

A set of question you need to ask yourself to tackle this is:
- Can I make a single boss attack (regular or spell card)
- Can I make a boss with multiple attacks/spellcards?
- Can I make a familiar/enemy which is NOT a boss?
- Do I understand SFX and BGM using .wav and .mp3/.ogg?

If the above is all yes, then we can tell you the rest. If not, you should tackle all of the above first.

Also this seems like a good idea for a video tutorial I think. Hmmm

Lollipop

  • stay woke
  • literally and figuratively dying
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #267 on: August 21, 2016, 06:15:43 PM »
There is no such thing as "sorry to bother". Of course many people do this due to being polite.

A good question. We have exactly 0 tutorials on making stages in ph3.

Summary: A stage is created using #TouhouDanmakufu[Stage] as header. You spawn enemies within the stage and at a certain point you call the Plural script for the boss.

A set of question you need to ask yourself to tackle this is:
- Can I make a single boss attack (regular or spell card)
- Can I make a boss with multiple attacks/spellcards?
- Can I make a familiar/enemy which is NOT a boss?
- Do I understand SFX and BGM using .wav and .mp3/.ogg?

If the above is all yes, then we can tell you the rest. If not, you should tackle all of the above first.

Also this seems like a good idea for a video tutorial I think. Hmmm

I already have everything ready, I just need to put it together.
Touhou 1CCS:
Hard: LLS, EoSD(NB), PCB(NB), IN, MoF, TD, DDC(NB), LoLK
Lunatic: EoSD, PCB, DDC, LoLK
Extra: LLS, EoSD, PCB(Extra&Phantasm), IN, MoF, SA, DDC, LoLK
Current Focus: 1cc SA Hard, or an Extra

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #268 on: August 21, 2016, 08:07:11 PM »
I already have everything ready, I just need to put it together.
Oh. Why didn't you say so :V

Declare global in your stage file:
Code: [Select]
let idScript;
Then call anywhere during your stage this for your mid or stage boss:
Code: [Select]
idScript = LoadScriptInThread("pathtoyourscript");
StartScript(idScript);

The LoadScriptInThread will allow you to run a script while your stage script is still active. This can be used for any loadable scripts but in general often used for mid/stage bosses.

Enemies can be spawned anywhere during the stage. No need for specific script loading.

If you want to change music for the midboss and stage boss, you need to stop and load/play your desired song somewhere. Could be done from the boss script, plural or during a "dialogue".
« Last Edit: August 21, 2016, 08:10:55 PM by Helepolis »

Lollipop

  • stay woke
  • literally and figuratively dying
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #269 on: August 21, 2016, 10:28:52 PM »
Oh. Why didn't you say so :V

Declare global in your stage file:
Code: [Select]
let idScript;
Then call anywhere during your stage this for your mid or stage boss:
Code: [Select]
idScript = LoadScriptInThread("pathtoyourscript");
StartScript(idScript);

The LoadScriptInThread will allow you to run a script while your stage script is still active. This can be used for any loadable scripts but in general often used for mid/stage bosses.

Enemies can be spawned anywhere during the stage. No need for specific script loading.

If you want to change music for the midboss and stage boss, you need to stop and load/play your desired song somewhere. Could be done from the boss script, plural or during a "dialogue".

How would I make everything else wait until the midboss dies?

thanks for the help, by the way
« Last Edit: August 21, 2016, 10:32:08 PM by Lollipop »
Touhou 1CCS:
Hard: LLS, EoSD(NB), PCB(NB), IN, MoF, TD, DDC(NB), LoLK
Lunatic: EoSD, PCB, DDC, LoLK
Extra: LLS, EoSD, PCB(Extra&Phantasm), IN, MoF, SA, DDC, LoLK
Current Focus: 1cc SA Hard, or an Extra