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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #810 on: January 08, 2012, 11:38:03 PM »
How do you do CreateShotFromScript? Man, that is a dumbass question >.>

CreateShotFromScript("name", x, y, v, angle, delay, argument);

Code: [Select]

script_shot name {
@Initialize {
SetDefault(RED01); //SetBombResist; (uncomment if you want to have it bomb resistant)
}
@MainLoop {
SetCollisionBDefault;
}
@DrawLoop {
DrawGraphicDefault;
}
@Finalize {
}
}

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #811 on: January 08, 2012, 11:59:50 PM »
CreateShotFromScript("name", x, y, v, angle, delay, argument);

Code: [Select]

script_shot name {
@Initialize {
SetDefault(RED01); //SetBombResist; (uncomment if you want to have it bomb resistant)
}
@MainLoop {
SetCollisionBDefault;
}
@DrawLoop {
DrawGraphicDefault;
}
@Finalize {
}
}
Now I can use the familiars for Mokou's spell, thanks


Edit: A more question that may get me to being an official dumbass but how do you slow down time or freeze it? Like Sakuya's spells and when Youmu slows down time greatly.
« Last Edit: January 13, 2012, 09:12:26 AM by Helepolis »
" Borders are Borders. They were meant to be manipulated and mistreated. "

DarkOverord

  • Damn Red Dragons
  • Aaaaaaaaaaaaaaaaargh
    • Lol YouTube
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #812 on: January 12, 2012, 12:25:26 AM »
A more question that may get me to being an official dumbass but how do you slow down time or freeze it? Like Sakuya's spells and when Youmu slows down time greatly.
Not too clued up here but there are "slow" and "time stop" functions in the wiki
« Last Edit: January 12, 2012, 01:53:39 PM by DarkOverord »
http://www.youtube.com/user/DarkOverord <-- its wat cool ddes do rite :V

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #813 on: January 13, 2012, 02:36:46 AM »
Oh. Well that'd be helpful. Just wanna know how to for a game I'm making ( Well, it won't be that great >.> ). Thanks.


Since Pastebin is under maintence right now >.>, I'll edit this post after it is out of maintence with a link to it, Now, This set of codes says "PhoenixShot" and
http://pastebin.com/0Wnv9zXh
Please forgive me for the inconvience
« Last Edit: January 13, 2012, 08:02:34 PM by Yuyuko-sama »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #814 on: January 13, 2012, 05:19:33 AM »
Extra bracket after the spawn task, which terminates the file so that anything after it isn't read by the program.

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #815 on: January 13, 2012, 07:59:42 PM »
Extra bracket after the spawn task, which terminates the file so that anything after it isn't read by the program.

Did that but it says that PhoenixShot is:
---------------------------
PhoenixShotは未定義の識別子です(913行目)

It says Phoenix shot is an undentified identifier
" Borders are Borders. They were meant to be manipulated and mistreated. "

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #816 on: January 13, 2012, 10:18:46 PM »
GetAngleToplayer
obj_Create
Obj_Angle
GetAngleToThePlayer
(see later)
are all misspelled.

You might need an extra closing bracket after the wait function to separate script_enemy_main and script_enemy, but I'm not sure. In any case, script_enemy matches all of its brackets but there is no closing bracket for script_enemy_main. Either put it before script_enemy or at the end of everything (again, unsure which is needed).

Deleting the FamiliarA graphic in the familiar's @Finalize will make all the other familiars disappear until it's loaded again, so I suggest not putting it there.

GetAngleToThePlayer * cos + 10, GetAngleToPlayer * cos + 20, GetAngleToPlayer * cos + 30 is also completely wrong. I think you want
cos(GetAngleToPlayer) * 10, cos(GetAngleToPlayer) * 20, cos(GetAngleToPlayer) * 30

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

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #817 on: January 13, 2012, 10:28:17 PM »
Well now, I made such mistakes. Corrected it all but it says PhoenixShot is  undentified. DAMN YOU TASKS! I just need to know that problem and maybe I can fix it.
« Last Edit: January 13, 2012, 10:30:00 PM by Yuyuko-sama »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #818 on: January 13, 2012, 10:54:10 PM »
Could you post the current script then? Also, more problems.
  • I noticed that you're declaring MSpeed, Angle and Graphic as arrays, then passing them as parameters to SCARLET_SHOT_MOKOU which tries to use them as setters. That won't work. You do the same thing in FamShot and I'm not sure what you're trying to do there.
  • MWay is probably supposed to be 5, not 56. I can't imagine you wanting 56 loops with wait(240) in each of them.
  • You never defined the wait function for the familiar script.
  • /-- Declaring the Variables ------------ isn't a comment, you're missing a slash.
« Last Edit: January 13, 2012, 10:55:42 PM by Drake »

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

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #819 on: January 13, 2012, 11:21:47 PM »
Well, I blame myself. This is my Second time tasking so I've decided to make a new script. It's basically a remake of the exact same thing but with the mistakes corrected.

Well since my problem has been fixed with tasking, what about this for the event for Marisa
http://pastebin.com/SPyuUAw7
It cannot interpret MARGIN XL and stuff. Do I need to do a function or something? Just asking.
AND
http://pastebin.com/9Xm1Anqr
It says:
Routine and more of the same name is declared in the same scope (line 978)

    @ DrawLoop {



        SetGraphicScale (1, 1);

        SetTexture (MariFamA);

       
~ ~ ~
---------------------------
OK
---------------------------



I highly suggest you start using the EDIT button. This is the 3rd time in the same page I have to fuse your posts. There is absolutely no reason to double post. --Hele

My response: Man I've been screwing up
« Last Edit: January 15, 2012, 02:35:39 AM by Yuyuko-sama »
" Borders are Borders. They were meant to be manipulated and mistreated. "

TraceTheKriken

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #820 on: January 14, 2012, 11:51:28 AM »
What in this code affects to how often bullets are spawned from laser?

Code: [Select]
ascent(i in 0..30){
    ascent(j in 0..20){
        CreateShotA(1, 0, 0, 10);
        SetShotDataA(1, 0, 0, 90, 0, 0.1, 3, YELLOW11);
        AddShot(i*3, 0, 1, j*15);
    }
}

And how do I make the bullets spawn a specific angle based on LaserC's angle?

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #821 on: January 14, 2012, 02:23:20 PM »
Well now, thought I've never seen this topic in the first page. I wonder, can you ascent in tasking?
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #822 on: January 14, 2012, 04:41:12 PM »
@Trace: The i*3 in AddShot affects the frequency. More accurately, the 3. The 90 in SetShotDataA should be how many degrees the bullet is fired at in relation to the laser.
@Project Mokou: Yes you can. Now take it to the Q/A Thread.

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #823 on: January 14, 2012, 04:46:22 PM »
Thanks Mewkyuu.  Though I have no more questions to  ask before I begin tasking, Thanks.
" Borders are Borders. They were meant to be manipulated and mistreated. "

xForeverFanaticx

  • Bomb ALL the Spellcards!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #824 on: January 14, 2012, 05:58:05 PM »
Idk if this is a silly question or not... but how do you enable or encorporate power items and power levels into characters?

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #825 on: January 14, 2012, 06:17:35 PM »
Idk if this is a silly question or not... but how do you enable or encorporate power items and power levels into characters?
You are going to probably work with CommonData for that. You create CommonData in your player script and use that to track/update it. With that, you can create power items or w/e which drops from enemies and link them to the CommonData. After that is a matter of creating the correct statements for "level up" or "shot power".

Code: [Select]
SetCommonData("playerPower",0);

/////

if(GetCommonData("playerPower") > 8) {
// do stuff
}

Power items are probably made as EffectObjects, and you create statements to make the player collect these, increasing the playerPower etc. You can even save common data to make sure the data isn't lost when the player quits the game. (Useful for unlocks and stuff). Probably various methods of doing, this is the one I am familiar with.
« Last Edit: January 14, 2012, 06:19:35 PM by Helepolis »

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #826 on: January 14, 2012, 08:19:46 PM »
Well since my problem has been fixed with tasking, what about this for the event for Marisa
http://pastebin.com/SPyuUAw7
It cannot interpret MARGIN XL and stuff. Do I need to do a function or something? Just asking.
You cannot put spaces in variable names. You weren't doing this after the first block; I'm not sure why you didn't catch this.


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

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #827 on: January 14, 2012, 08:49:25 PM »
Idk if this is a silly question or not... but how do you enable or encorporate power items and power levels into characters?
I did it through common data too. Basically what you need to do is: Organize a queue for dropped items processing, make a task that creates an item and processes it (falling, getting collected), put some code in enemies scripts so they will drop items on death, store power level value in common data so player scripts can use it. I have this system working in my game, so PM me if you're interested.
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #828 on: January 15, 2012, 02:56:41 PM »
I'm having an issue with object effects causing immense amounts of lag.

This task (subtask of a player shot object) is called every frame to create an effect object trail behind a player shot object.  In-game, I can shoot for about 20 seconds before the FPS begins to start dropping, and it doesn't ever get faster afterward.  The effect appears to delete, but the framerate shows otherwise.

The "return;" method from a topic on these forums didn't seem to help, so I tried isolating the counter into the if statements.  No better.  Commenting out the Trail(); task from calling will cause the lag to never show up, so I'm pretty sure it's just this task.

Tried searching around for a solution, but I haven't yet found anything that works.

http://pastebin.com/RNc8v7pW

I'd really love to have some nice effect trails, but I've tried my limited knowledge to it's limits and I still can't figure it out.  Hopefully I haven't herp-a-derped someplace and I'm just overlooking it.

Pastebin for the whole player script. (Copy-pastad-code-from-other-scripts-inside alert)
http://pastebin.com/V4qCXy99
« Last Edit: January 15, 2012, 05:29:45 PM by Helepolis »

TraceTheKriken

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #829 on: January 15, 2012, 04:20:14 PM »
I'm trying to make a curving LaserC spawn bullets from it so that the bullets will be spawned +90 and -90 degree from the lasers current angle (if laser's angle is 90 bullets are fired to 0 and 180). So how do I make danmakufu get the laser's angle when a new bullet is spawned from it?

here is the task. It will propably help you:

Code: [Select]
   task laserC1 {
      let x = 0;
      let dir = 45;
      loop {
         while(x<3) {
            CreateLaserC(1, GetCenterX, GetCenterY, 10, 50, RED01, 0);
            SetLaserDataC(1, 0, 5, dir, 5, 0, 0);
            SetLaserDataC(1, 15, 5, NULL, 4, 0, 0);
            SetLaserDataC(1, 30, 5, NULL, 3, 0, 0);
            SetLaserDataC(1, 45, 5, NULL, 2, 0, 0);
            SetLaserDataC(1, 60, 5, NULL, 1, 0, 0);
            SetLaserDataC(1, 75, 5, NULL, 0.5, 0, 0);
            ascent(i in 0..100){
               ascent(j in 0..1){
                  CreateShotA(2, 0, 0, 10);
                  SetShotDataA(2, 0, 0, dir+90, 0, 0, 0, RED04);
                  SetShotDataA(2, 5, 0, NULL, 0, 0.025, 1.5, RED04);
                  AddShot(i*3, 1, 2, j*15);
               }
            }
            ascent(i in 0..100){
               ascent(j in 0..1){
                  CreateShotA(2, 0, 0, 10);
                  SetShotDataA(2, 0, 0, dir-90, 0, 0, 0, RED04);
                  SetShotDataA(2, 5, 0, NULL, 0, 0.05, 1.5, RED04);
                  AddShot(i*3, 1, 2, j*15);
               }
            }
            FireShot(1);
            dir+=360/3;
            x++;
         }
         x = 0;
         dir = 45;
         wait(300);
         yield;
      }
   }

Oh yeah, and when I spawn bullets from laser how do I make the spawning rate a little smaller, the bullet trails it spawns are too thick and hard to get through (I copied the "ascent" thing so I don't know)

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
    • LiveJournal blog
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #830 on: January 15, 2012, 05:38:36 PM »
I'm having an issue with object effects causing immense amounts of lag.

This task (subtask of a player shot object) is called every frame to create an effect object trail behind a player shot object.  In-game, I can shoot for about 20 seconds before the FPS begins to start dropping, and it doesn't ever get faster afterward.  The effect appears to delete, but the framerate shows otherwise.

The "return;" method from a topic on these forums didn't seem to help, so I tried isolating the counter into the if statements.  No better.  Commenting out the Trail(); task from calling will cause the lag to never show up, so I'm pretty sure it's just this task.

Tried searching around for a solution, but I haven't yet found anything that works.

http://pastebin.com/RNc8v7pW

I'd really love to have some nice effect trails, but I've tried my limited knowledge to it's limits and I still can't figure it out.  Hopefully I haven't herp-a-derped someplace and I'm just overlooking it.

Pastebin for the whole player script. (Copy-pastad-code-from-other-scripts-inside alert)
http://pastebin.com/V4qCXy99
Hmm.. how can fcount go beyond 9 when loop ends on 5? Maybe it's better replace loop with while(!Obj_BeDeleted(obj_trail)) then you wont need return too (why do you need it in task?)
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - EoSD extra no bombs clear


Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #831 on: January 15, 2012, 06:03:38 PM »
Hmm... Why is script_enemy an undefined? Tell me other problems too and I cannot use wait in the fam script
Defined the function of wait but cannot use wait.
http://pastebin.com/qUzakxQr

« Last Edit: January 15, 2012, 06:14:29 PM by Yuyuko-sama »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #832 on: January 15, 2012, 06:58:39 PM »
You have to close the bracket for task Marishot

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #833 on: January 15, 2012, 07:02:21 PM »
I don't know how, but I just quitted it because if Marisa shoots her dynamic random hard nonspells from IN combined with that = impossible. Thanks anyway Mewkyuu.
" Borders are Borders. They were meant to be manipulated and mistreated. "

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #834 on: January 15, 2012, 09:09:31 PM »
I'm having an issue with object effects causing immense amounts of lag [...]
Fixed. I put in both the method you were probably looking for, and one that is surely less computationally expensive and is just shorter in text.
http://pastebin.com/GEXYfxRH

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

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #835 on: January 16, 2012, 01:23:27 AM »
Hmm.. how can fcount go beyond 9 when loop ends on 5? Maybe it's better replace loop with while(!Obj_BeDeleted(obj_trail)) then you wont need return too (why do you need it in task?)
That loop (and return;) were vain attempts at solving this.  It was originally an !Obj_BeDeleted, but that failed as well so I just started trying random things.  They all looked the same, and produced the same results so I didn't ever change it back.

Fixed. I put in both the method you were probably looking for, and one that is surely less computationally expensive and is just shorter in text.
http://pastebin.com/GEXYfxRH

Thanks, Drake!  Unfortunately, both solutions didn't work.  The game still slows after a few seconds of firing.  Tried adding return; to ensure the task was being finished (that's what it does, right?), but to no avail.

I can clearly see the object deleting (the "trail" doesn't sit on the last frame), but somehow it's not.  Or something.

EDIT: Problem solved!  It wasn't the task, but the while loop calling it.  Turns out there was a loop in there, which upon removal also removed the lag.
« Last Edit: January 16, 2012, 03:15:14 AM by Frenticpony »

Drake

  • *
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #836 on: January 16, 2012, 03:20:01 AM »
return; isn't needed for a situation like this because once the object is deleted, the while loop ends and the task finishes. You're going to want to use return; for tasks that might not have a very well-defined end or multiple different ends.

Looking at the whole script, I think the problem might be your weird obj!bedeleted{loop{}} setup. The while(!Obj_BeDeleted) loop starts, sets the three variables, then starts up an indefinite loop. This loop won't ever finish, so even when the main shot object is deleted, the inner loop is still going and it won't ever get to read the !Obj_BeDeleted condition to break and finish off the task. If this is indeed the problem, you could fix it by first of all removing the first three variable sets because they won't ever change anyways, and then simply getting rid of the inner loop (and the extra yield). The while loop should take care of things.

If you want to test, you can keep track of a variable that increases when you create a trail object and decreases when it deletes, and then display it in the debug window. The debug window also keeps a number of total objects, so that might be useful too.


way to go man make me look around and type the correct solution for nothing >:C

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

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #837 on: January 16, 2012, 03:29:04 AM »
ah the wonders of irc

Remember that while is already a loop that breaks when the condition is no longer true.

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #838 on: January 16, 2012, 03:31:03 AM »
One Question. How do you use the CtC spell lines. I want to use a specific one. Do I have to use Drawloop or something ( ZUNish spell lines of course. )
" Borders are Borders. They were meant to be manipulated and mistreated. "

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #839 on: January 16, 2012, 07:44:18 AM »
way to go man make me look around and type the correct solution for nothing >:C

Well, it's the thought that counts.  Thanks for the help!