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

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #150 on: October 06, 2014, 10:33:04 PM »
you didn't forget the ";" at the end of "LoadPlayerShotData(current ~ "Player_ShotData.txt"" right?
It's in my post, the forum just made a smiley out of it. ( ;) <- ; ) ) Anyway, the problem only requires opening & saving the file, not modifying the player script any. So it has nothing to do with LoadPlayerShotData AFAIK.....

- If I take the default install, open the example Rumia shot data, save it back to disk without modifying it, and attempt to use the default Rumia player the problem manifests (shooting does nothing but moving, bombing, etc. is fine).
- If I make my own shot data from scratch (like in the above post) instead of modifying the one that's already there, the problem also manifests.
- If I edit the example Rumia player script (and do not touch the example Rumia shot data in any way), the problem does not manifest, so I doubt it's an encoding issue....? Otherwise, I'd have problems with the player script too?

Once I save the shot data, modified or not, it just stops working. So, what I'm asking is, is there some trick to this? Special file encoding? Use of applocal with my text editor/danmakufu/something else? I tried a few things and so far nothing.... I couldn't find any mention of this sort of thing on the wiki and tried redownloading from a different site but no luck......

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #151 on: October 06, 2014, 10:38:57 PM »
oh, that's because the smiley was so out of place  :V
i have no idea... although i'm not an expert :V but i thought that your problem was similar to one i had the past days (the character won't shoot)...
but, your hypothesis suggests that's got something to do with the main player script, NOT the shot data, right?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #152 on: October 06, 2014, 10:44:39 PM »
wait... isn't the "#UserShotData" misplaced? i never used it, nor knew of its existence, yet my tries on making player scripts worked fine without it :V

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #153 on: October 06, 2014, 10:53:32 PM »
wait... isn't the "#UserShotData" misplaced? i never used it, nor knew of its existence, yet my tries on making player scripts worked fine without it :V
From this post and the one before, I think you are getting confused. =) This problem is with "Default_Player_RumiaShotData.txt", not "Default_Player_Rumia.txt". The problem has nothing to do with player scripts as far as I can tell.

Please read the three example cases I provided. You will see that the player script causes no problems whatsoever: the problem comes up in a clean install without having touched the player script. It's modifying or even just saving the shot data that causes it to take place. Modifying the player script itself in any way is just fine and whatever changes I make to it come out as expected.

Edit: Ok got it working. The shot data worked after I made it UTF-8 and manually added a BOM to the start of the file (my text editor by default omits the BOM). But the player script does not require this at all (in fact the one I use is in plain ANSI). I still don't get it. So player scripts support any (?) encoding but shot data only supports UTF-8 with a BOM and won't load if it's not in that specific format? Something doesn't feel right. What is going on? =/
« Last Edit: October 06, 2014, 11:30:38 PM by Neodymium »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #154 on: October 06, 2014, 11:34:37 PM »
okay... what's all this UTF or ANSI stuff about? why not just saving them as plain normal txt files? i never heard of saving scripts like that...
also, the "#UsedShotData" i tried to mean was the one found inside the shotdata, right at the beginning... i fint it a bit... odd

EDIT: if it's working already then nevermind this :V
« Last Edit: October 06, 2014, 11:36:31 PM by BlazervaniaX »

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #155 on: October 07, 2014, 12:08:24 AM »
okay... what's all this UTF or ANSI stuff about? why not just saving them as plain normal txt files? i never heard of saving scripts like that...
also, the "#UsedShotData" i tried to mean was the one found inside the shotdata, right at the beginning... i fint it a bit... odd
"Plain normal text" doesn't exist. A computer has to go from individual bits to readable text in one way or another.

Neodymium, you can also replicate this problem in other scripts by using the #東方弾幕風 header instead of #TouhouDanmakufu, and then saving it as anything but Shift-JIS.

That being considered, it might be that the way the headers are being read is the main issue. I can't replicate your problem in shot definitions with any encoding, but see if it works in other encodings after removing the header. I've never actually had to put it there.
« Last Edit: October 07, 2014, 03:59:21 AM by Drake »

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 #156 on: November 02, 2014, 06:31:38 AM »
Hello, I'm new to the forums, and new to Danmakfu as well. I'm not quite sure if my first post should be a question, but I'll go for it!

Anyway, I want to make a gravity bullet have a trail following it, similar to Koishi's Rekindled "Embers of love" card, but with single bullets rather than clusters of them.
I did discover how to make gravity bullets, but the trail part is being a pain. Here's what I have so far.

-----
task Glow {
   //Current task for the "leader" Bullet
   loop(4){
      let randir = rand(-0.5,0.5);
      Light = CreateShotB2(BossX,BossY-45,randir,-3,0,0.05,0,2,308,15);
      wait(53);
   }
}

task Glowtrail {
   //Current task for the disappearing bullet trail following the leading bullet
   loop{
      let LgtX = ObjMove_GetX(Light);
      let LgtY = ObjMove_GetY(Light);
      MiniLgt = CreateShotA2(LgtX,LgtY,0,rand(0,360),0.001,0.1,74,11);
      wait(10);
      ObjShot_FadeDelete(MiniLgt);
   }
}
-----
(Sorry if the code is way too big, I felt like it isn't, but let me know if it is.)

I think I understand why the trail stops once a new "Light" bullet appears and instead follows the newer one, but I can't think of a way to get around it so I can have multiple gravity bullets with multiple trails on screen at once. I suppose I could just make a ton more variables, but it seems like there would be a better way to do this thing.
Also, the wait in the Glowtrail task isn't working how I'd like. The trails are too short, and adding more time to the wait makes the gaps in the trail bigger, which I don't want.

Thanks for the help!  :)

TalosMistake

  • Master of Aura and Shade
  • I'm Talos, not Talo~~
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #157 on: November 02, 2014, 01:30:24 PM »
I'm not good at English and I'm not that great about explanation, but I think can help you a little bit. xD

For the first problem, I assume your "Light" Variable is a global variable and it's created outside the task Glow, then you use it to store the bullet data from CreateShotB2, right?

Obviously, it's impossible that 1 variable can store more than 1 bullet data, so every time you call a new CreateShotB2 function,

"Light" variable will store new bullet data instead of the old one.

The silly way to solve this problem is create variables as many as possible to store every bullet data, but how many will you create it? 100? 1000? you don't really know how many

bullets will you create in that spell/nonpell card, and it also wastes your memory A LOT.

The good solution for me is create a new variable each time you call a CreateShotB2 function , and let another task handles it separately. Something like this.

http://pastebin.com/cgwxdk9D

The second problem is pretty easy, instead of using bullets as a trail, you use lasers, then you can adjust the laser length to make the trails longer or shorter.

It may be hard to understand at first (probably my english :V). Feel free to ask if you don't understand. Everyone here is willing to help you. xD
« Last Edit: November 02, 2014, 01:32:34 PM by TalosMistake »

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #158 on: November 03, 2014, 03:45:24 AM »
Thanks, Talos!  :)
A trail follows all of the bullets now!

I've had no experience making tasks that have arguments at the end of them before, so I'm not sure I understand how "Glowtrail(Light)" makes a new bullet-containing variable each time it's called...Or, maybe it's "Glowtrail(obj)" that does it? (Maybe even both of those together?)

As for the length of the trails, that still needs to be fixed, and I'd rather not use lasers because I'm going for a certain look. The look I want is already achieved, but the time before the bullets disappear is too short. The rate they appear at is just right though.

Why do I need to create a new variable in the "Glowtrail" task though? (talking about your last comment after MiniLgt)
What would it be for?

Thanks again!

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #159 on: November 03, 2014, 07:11:09 AM »
One thing is that making a variable to put the Light bullet in isn't actually necessary in this case; you could just as well omit the task's obj parameter and instead put the randdir and a let obj = CreateShotB2(etc); at the start of the task, since it's always running the same thing anyways. Maybe that would look more familiar:

Code: [Select]
task Glow {
   loop(4){
      Glowtrail();
      wait(53);
   }
}
task Glowtrail(){
   let randir = rand(-0.5,0.5);
   let obj = CreateShotB2(BossX,BossY-45,randir,-3,0,0.05,0,2,308,15);
   while(!Obj_IsDeleted(obj)){
     //stuff
   }
}

CreateShotB2() is a function that returns the created object's ID. By saying Light = CreateShotB2(bla) you're storing the object's ID inside that variable. Then when you call Glowtrail(Light), you're giving the Glowtrail() task that object ID. Inside the task, having that obj parameter defines obj as a new variable that stores whatever is passed to it, so then inside the task obj will now contain the created object's ID. Now when you use obj throughout the task you're referring to that particular object.


If the time before the bullets disappear is too short, just change the wait(10) to longer.

Lastly, you just need the MiniLgt variable so you can reference the object later when you go to delete it with ObjShot_FadeDelete(MiniLgt).
« Last Edit: November 03, 2014, 07:14:09 AM by Drake »

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 #160 on: November 03, 2014, 07:58:52 AM »
Ah, ok! Thanks, Drake!

Yeah, that looks easier for me to understand.
One of my flaws with coding for this so far seems to be not knowing where to place lines of code...

If I increase the "wait(10)" though, the gaps in between the trail of bullets gets bigger. The wait in the while loop is affecting both
"let MiniLgt = CreateShotA2(LgtX,LgtY,0,rand(0,360),0.01,0.1,74,11);" the speed that the bullets spawn,
and "ObjShot_FadeDelete(MiniLgt);" the speed that they disappear.

"wait(10)" is the correct amount of time I need for the bullets to appear, but it's too quick for them to disappear. I'm thinking I need to move "ObjShot_FadeDelete(MiniLgt);" somewhere else? Like in a loop inside the while loop, or maybe a different task entirely?

...Actually thinking about it, putting it in a different task sounds like it could work... I might mess around with that in the meantime and see if I can come up with something.

Thanks for all the help!

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #161 on: November 03, 2014, 10:06:26 AM »
Oops, missed that. Well, you could stack another task on top of it, or you could use ObjShot_SetDeleteFrame() to specify when to delete the child bullets instead. Only thing is that you won't get the fade out, if that matters.

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 #162 on: November 03, 2014, 11:14:56 AM »
Quote
or you could use ObjShot_SetDeleteFrame() to specify when to delete the child bullets instead. Only thing is that you won't get the fade out, if that matters.
You also could decrease the alpha of the bullet by what you want per frame with ObjRender_SetAlpha (and delete the object when alpha <= 0) and use ObjShot_SetIntersectionCircleA1 with 0 as radius to make fadeout bullet without hitbox.
It's not the easiest way but it work. I think.

(sorry if I'm not clear. My english is really bad ><)

TalosMistake

  • Master of Aura and Shade
  • I'm Talos, not Talo~~
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #163 on: November 03, 2014, 11:30:02 AM »
"wait(10)" is the correct amount of time I need for the bullets to appear, but it's too quick for them to disappear. I'm thinking I need to move "ObjShot_FadeDelete(MiniLgt);" somewhere else? Like in a loop inside the while loop, or maybe a different task entirely?
...Actually thinking about it, putting it in a different task sounds like it could work... I might mess around with that in the meantime and see if I can come up with something.

Yeah, you can create another task inside task Glowtrail, like this

http://pastebin.com/t3kPRvR7

with this you're able to create a trail bullet every 10 frames and determine how many frames do you want to wait before it's deleted.

(I think this technique is called "Nested task", but I'm not quite sure. xD)

You also could decrease the alpha of the bullet by what you want per frame with ObjRender_SetAlpha (and delete the object when alpha <= 0) and use ObjShot_SetIntersectionCircleA1 with 0 as radius to make fadeout bullet without hitbox.
It's not the easiest way but it work. I think.

Yeah, instead of using ObjShot_FadeDelete function, you can manually create a "fade delete" function by yourself

Code: [Select]
task ManualFadeDelete(obj,time) // time is a time before it's completely deleted.
{
    let alpha = 255;
    let ratio = 255/time;
    ObjShot_SetIntersectionEnable(obj,false); // remove the hitbox from a bullet.
    while(alpha>0)
    {
          alpha -= ratio;
          ObjRender_SetAlpha(obj,alpha); // the alpha of a bullet need to be updated every frame.
          yield;
    }
   Obj_Delete(obj);
}

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #164 on: November 04, 2014, 12:10:36 AM »
Yes, I got it to work by moving the ObjShot_FadeDelete into another task like this.

Code: [Select]
task deletetrail(obj2) {

wait(45);
ObjShot_FadeDelete(obj2);

}

The wait(45) doesn't add on to the other wait in the trail making task, so I can change either wait without it affecting the other now!

Wow, there seems to be lots of ways to do this. Thanks for your help everyone!


Justin

  • Grand High Poobah
  • what is life
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #165 on: November 08, 2014, 05:39:13 AM »
Hi,
I'm fairly new around here. So I'm trying to make a small game with a friend, and I've run into a few.. issues with this stage script here...
http://pastebin.com/UckTStUz

The issues are as follows:
  • The one enemy that spawns does not die
  • Boss does not show up
  • Script just ends randomly (assuming because the boss script is never opened)
If you need the plural and single for the boss as well, here they are:
Plural: http://pastebin.com/arxQdcww
Single: http://pastebin.com/dMY3k83B
Oh, I  just wanted to add that that I looked under functions, and I found no way to get the hp of the enemy so I could delete the object.
« Last Edit: November 08, 2014, 05:53:17 AM by Justin »
Current Goals (BC I guess this is a thing):
1CC all 2hu on normal: All clear!
1CC all 2hu on hard: LLS, EoSD, PCB, IN, MoF
Clear all extras: EoSD, PCB, IN, MoF, SA
SA Hard Mode is kicking my butt ;-;

Sparen

  • Danmakufu Artist
  • Git ready, git set, PUUSH!
    • AFCDTech
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #166 on: November 08, 2014, 04:20:00 PM »
Oh, I  just wanted to add that that I looked under functions, and I found no way to get the hp of the enemy so I could delete the object.

Code: [Select]
        while(ObjEnemy_GetInfo(objBoss,INFO_LIFE)>0){yield;}
I think this is in the sample scripts that come with danmakufu? Use the samples as a base to start on if you are a beginner - it makes things like these slightly less cumbersome.

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #167 on: November 08, 2014, 04:57:21 PM »
The one enemy that spawns does not die
You never tell the enemy to be deleted. Usually, people will have a while(ObjEnemy_GetInfo(objEnemy,INFO_LIFE)>0) rather than a simple loop and have Obj_Delete(objEnemy); after it. That way it will run the attack routines and/or collision detection while it has life and delete itself when it runs out.

Boss does not show up
You have to load every script before you can start it. You would want something like this:
Code: [Select]
let Script = LoadScript(dir ~ "Stage 1 Boss.txt");
StartScript(Script);
Alternatively you could just have the boss be created by the stage script itself instead of allowing another one to handle it but that's up to you.

Script just ends randomly (assuming because the boss script is never opened)
That is correct, the boss script is never started because it was never loaded.
 
To clarify Sparen, the fuction to get the life of any enemy object is ObjEnemy_GetInfo(object enemy id, INFO_LIFE); Most people tend to put it in a while statement, like what I had stated before.
« Last Edit: November 08, 2014, 05:00:41 PM by ExPorygon »

Justin

  • Grand High Poobah
  • what is life
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #168 on: November 09, 2014, 02:08:02 AM »
Both of you, thank you so much!!


Code: [Select]
let Script = LoadScript(dir ~ "Stage 1 Boss.txt");
StartScript(Script);

I see my issue now, I had forgotten the LoadScript( blahblah ) in the "let Script=" thing. Thanks again!!
Current Goals (BC I guess this is a thing):
1CC all 2hu on normal: All clear!
1CC all 2hu on hard: LLS, EoSD, PCB, IN, MoF
Clear all extras: EoSD, PCB, IN, MoF, SA
SA Hard Mode is kicking my butt ;-;

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #169 on: November 10, 2014, 11:12:12 PM »
It's certainly a stupid question but what is the exact meaning of the "../" used on pathing? It's seems to be a sort of "back to the previous folder" but... I'm not sure.

And also the "~" is used to concatenate string. But is there an operator or a function to do the opposite? For example if I have a string like "text1text2" and I want to remove "text2" and keep only "text1" how I can do? It's possible?



Uruwi

  • Nightmare of Torrential Precipitation
  • 478 million goober
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #170 on: November 11, 2014, 04:39:41 AM »
It's certainly a stupid question but what is the exact meaning of the "../" used on pathing? It's seems to be a sort of "back to the previous folder" but... I'm not sure.

".." means the folder above the current one.

Quote
And also the "~" is used to concatenate string. But is there an operator or a function to do the opposite? For example if I have a string like "text1text2" and I want to remove "text2" and keep only "text1" how I can do? It's possible?

No.
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

ExPorygon

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
    • Ephemeral Entertainment
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #171 on: November 11, 2014, 02:33:18 PM »
And also the "~" is used to concatenate string. But is there an operator or a function to do the opposite? For example if I have a string like "text1text2" and I want to remove "text2" and keep only "text1" how I can do? It's possible?
Actually there sort of is a way. Look up the function SplitString on the wiki.

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #172 on: November 17, 2014, 11:34:38 AM »
So I attempted to create a custom bullet for a script using ObjShot_Create and other commands that I figured went with it. I had a picture ready, and I set the code up similar to how I rendered the boss (via Helipolis's tutorial). But it didn't work when I tried to shoot it from the boss.

Code: [Select]
function RedRocket {
let RedMsl = ObjShot_Create(OBJ_SHOT);
ObjShot_Regist(RedMsl);
ObjPrim_SetTexture(RedMsl,RedMissleBullet);
ObjSprite2D_SetSourceRect(RedMsl,0,0,32,40);

while(!Obj_IsDeleted(RedMsl)){
ObjShot_SetIntersectionLine(RedMsl,16,4,16,36,4);
yield;
}
}

Other than probably not getting the coding right, I placed "RedRocket" as the bullet to shoot... But now thinking about it, putting a function or task inside the bullet ID seems a bit silly.
So how would I actually go about creating a custom bullet? I'm under the impression though that I'd need to paste the code for the custom bullet in every script I want it in, which may be unadvised.

From this happening though, I started making my own shot sheet, which I think I understand how to do, but I'd like some advice, like on mistakes to avoid and such. I can ask for that in this thread, right? For some reason, I feel like this might not be the right place to ask for advice on that.

Thanks for the help!

PhantomSong

  • The Ghost Living through Everyday Life.
  • Eh, it doesn't matter.
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #173 on: November 19, 2014, 11:24:51 PM »
So I attempted to create a custom bullet for a script using ObjShot_Create and other commands that I figured went with it. I had a picture ready, and I set the code up similar to how I rendered the boss (via Helipolis's tutorial). But it didn't work when I tried to shoot it from the boss.

Code: [Select]
function RedRocket {
let RedMsl = ObjShot_Create(OBJ_SHOT);
ObjShot_Regist(RedMsl);
ObjPrim_SetTexture(RedMsl,RedMissleBullet);
ObjSprite2D_SetSourceRect(RedMsl,0,0,32,40);

while(!Obj_IsDeleted(RedMsl)){
ObjShot_SetIntersectionLine(RedMsl,16,4,16,36,4);
yield;
}
}

Other than probably not getting the coding right, I placed "RedRocket" as the bullet to shoot... But now thinking about it, putting a function or task inside the bullet ID seems a bit silly.
So how would I actually go about creating a custom bullet? I'm under the impression though that I'd need to paste the code for the custom bullet in every script I want it in, which may be unadvised.

From this happening though, I started making my own shot sheet, which I think I understand how to do, but I'd like some advice, like on mistakes to avoid and such. I can ask for that in this thread, right? For some reason, I feel like this might not be the right place to ask for advice on that.

Thanks for the help!

Can you please specify your problem? Does it not show up or does it not intersect with the player...?

Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #174 on: November 20, 2014, 04:20:05 AM »
Oh, sorry. The bullet does show up.  In fact, it actually stops the code after it from working as well.

I have this little bit of code for a slash like attack, it works just fine...until I changed it for a test.

Code: [Select]
ascent (i in 0..25) {
count+=360/8;
CreateShotA2(BossX-90+i*8,BossY-90+i*8,1.3,count+variance,0.01,2.7,202,20);
CreateShotA2(BossX-90+i*8,BossY-90+i*8,1,count+variance,0.01,2.5,202,20);
CreateShotA2(BossX-90+i*8,BossY-90+i*8,0.7,count+variance,0.01,2.3,RedRocket,20);
wait(1);
}

To see if the bullet would work, I've placed the function inside the 3rd CreatShotA2's bullet ID argument.
After I put the function in, the code stops after it hits the third CreateShotA2, spawning only 2 bullets.

Drake

  • *
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #175 on: November 20, 2014, 04:53:59 AM »
EDIT: was writing when you posted

By the lack of a position to shoot and saying "putting a function or task inside the bullet ID" I can only assume you did something like CreateShotA1(x, y, s, a, RedRocket, d). That's totally not how it works. Shot IDs are just numbers that correspond to the IDs in a shot definition file that you've loaded. If you include the default shots with #include"script/default_system/Default_ShotConst.txt", then you can use numbers from 1 to 255 as shot IDs, or use the constants defined in that file like DS_BALL_S_RED (which is 9, incidentally). When making a custom shot sheet this is also what you're doing.

RedRocket(), though, is just a function (like CreateShotA1). If it worked, you would just call it on its own. It won't work for a few reasons:
- A Shot object is not a Primitive object, nor a Sprite2D object, so those two functions won't work on RedMsl.
- The graphic would instead need to be set with ObjShot_SetGraphic(), which needs to be a shot ID as described above.
- You'd need to specify a position for the object to spawn at. You could do this with ObjMove_SetPosition() or something similar, since Shot objects are Move objects.
- ObjShot_SetIntersectionLine()'s four position parameters need you to give an absolute position on screen, rather than a position relative to the object. It doesn't change depending on angle.
- By using a function and not spawning a task, Danmakufu would probably freeze since it would be infinitely checking if the bullet was deleted.

How you would get this to work is that you make a shot sheet with your custom bullet so you have a shot ID for it, load it by using LoadEnemyShotData(path_to_file), then you could use that ID in your CreateShotA2().
« Last Edit: November 20, 2014, 05:14:51 AM by Drake »

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 #176 on: November 20, 2014, 05:54:19 AM »
Ok, so I can't just plop a picture in and turn it into a bullet then. It would have to be an image from a ShotSheet.
I was just assuming it would be similar to give a bullet a graphic like it was to give one to the Boss Object. I don't know what actually counts as primitive objects or Sprite2D objects, other than that the Boss Object is one.

Thanks!
Now hopefully I can figure out how to make my own shot definition file and ShotConst file. Up till now, all I've been doing is drawing bullets. I'll use the defaults as a guide will show me how to make them properly. Though, setting the rect for things has been a little difficult for me to figure out.  :ohdear:

Oh, well, I'll figure out how rect works the more I mess with it it.
Thanks again!


Jimmy

  • Shameless spender
  • gaining big pounds
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #177 on: November 23, 2014, 04:29:13 PM »
I've got a problem with implementing sound effects into my script in ph3.

Although I've followed Helepolis' tutorial for doing so, using the functions LoadSound(...) and PlaySE(...) and putting them in @Initialize right below the ObjEnemy-functions
and other desired locations,
for some reason Danmakufu keeps spawning an error message saying that the line where @Initialize starts is "Unable to be interpreted", however,
the script runs flawlessly if I take these functions away or disable them.

I honestly don't have any idea why this is happening.
Have these functions been changed or updated in some way?
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy, HSiFS, WBaWC
Hard 1cc: IN, DDC, HSiFS
Extra clears: MoF, DDC, HSiFS, WBaWC

Goals: Going Extra Hard!

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #178 on: November 23, 2014, 05:05:17 PM »
Hello Jimmy,

Can you show us your script in pastebin and the error message as screenshot or text message exactly?

Jimmy

  • Shameless spender
  • gaining big pounds
Re: ※ Dnh Q&A/Problem thread II ※ for Danmakufu ph3 .1 preX(ry
« Reply #179 on: November 23, 2014, 05:46:48 PM »
That persistent error message reads as follows:

--------------------------------------------------------------------------
解釈できないものがあります(「;」を忘れていませんか)
C:/Users/KingJimmy/Saved Games/Touhou Danmakufu/script/Tutorial/test2.txt
test2.txt 17行目


@Initialize {
   bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
   ObjEnemy_Regist(bossObj);
   
   ObjMove_SetPosition(bossObj,190,-10
~~~
--------------------------------------------------------------------------

and refers to this part of the affected script:

http://pastebin.com/bPcCueqH


Every time I remove/disable the LoadSound and PlaySE functions, the script plays normally.
« Last Edit: November 23, 2014, 05:48:30 PM by Jimmy »
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy, HSiFS, WBaWC
Hard 1cc: IN, DDC, HSiFS
Extra clears: MoF, DDC, HSiFS, WBaWC

Goals: Going Extra Hard!