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

0 Members and 1 Guest are viewing this topic.

Trung0246

  • Gaming, coding, drawing, composing, ... for fun
  • Gender: I don't even care
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #720 on: July 14, 2017, 02:31:18 am »
How to disable the number show up when player collect item ?
My workbench & codedump
Gallery & album (WIP)

IIe4eNiIIIe

  • Neophyte
  • Nickname: Cookieofd00m
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #721 on: July 14, 2017, 07:30:10 am »
How do i aim a straight laser to a certain object?

Jimmy

  • Pffft
  • that doesn't scare me
  • Nickname: touhou9513
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #722 on: July 14, 2017, 10:01:49 am »
How to disable the number show up when player collect item ?
Use ObjItem_SetRenderScoreEnable(item,bool) and put false as the second parameter.
« Last Edit: July 14, 2017, 11:38:29 pm by Jimmy »
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy
Hard 1cc: IN, DDC
Extra clears: MoF, DDC

Goals: Going Extra Hard!

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
  • Staff
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #723 on: July 15, 2017, 06:42:52 am »
How do i aim a straight laser to a certain object?
To aim it at a desired object, you need to calculate the angle from the straight laser source to the object using atan2.
Code: [Select]
let laserAngle = atan2(y1-y2,x1-x2);
xy1 for the laser position and xy2 for the object position.
  • Helepolis' Siege Workshop

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #724 on: July 17, 2017, 01:55:23 pm »
So I am wondering.... that how to make bullets act/shoot like Hina's last spell (Pain Flow) and bullets curves like gengetsu's last attack ?
*its not gengetsu rape time
I wanna be better

Jimmy

  • Pffft
  • that doesn't scare me
  • Nickname: touhou9513
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #725 on: July 17, 2017, 04:17:48 pm »
So I am wondering.... that how to make bullets act/shoot like Hina's last spell (Pain Flow) and bullets curves like gengetsu's last attack ?
*its not gengetsu rape time

Here.
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy
Hard 1cc: IN, DDC
Extra clears: MoF, DDC

Goals: Going Extra Hard!

GenoCraft

  • Boundary of productive and lazy
  • Hijirin da best 2hu
  • Nickname: ♥♪!?
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #726 on: July 17, 2017, 05:18:09 pm »
I want to make a spell card background that works like Sagume's, how can I create that effect?

Drake

  • アイスになりたい
  • *
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #727 on: July 18, 2017, 02:20:08 am »
What part of it? The blending or the motion? If it's the latter, it works the same as Junko's, for which I have a writeup here:
https://www.shrinemaiden.org/forum/index.php/topic,19249.msg1257975.html#msg1257975

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #728 on: July 18, 2017, 12:34:56 pm »
Soon after i edited, it said angleToPlayer is not defined, I'm not so sure about where to make it defined, any ideas ? https://pastebin.com/qNb1FTts
*if you don't mind, send the full script and i'l try to observe :3
« Last Edit: July 18, 2017, 12:39:18 pm by BananaCupcakey »
I wanna be better

CrestedPeak9

  • Just Beat SA Hard
  • Nickname: Crested
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #729 on: July 18, 2017, 12:36:44 pm »
the function is GetAngleToPlayer(objBoss)
the script here uses a custom function which I assume does the same thing
just change it and you should be good
Normal 1cc: LLS, MS, EoSD, PCB, IN, PoFV, MoF, SA, UFO, TD, DDC
Hard 1cc: LLS, EoSD, PCB, IN, MoF, SA, TD, DDC
Extra 1cc: EoSD, PCB (+Phantasm), IN, MoF, UFO
Easy Perfect: EoSD, TD

Jimmy

  • Pffft
  • that doesn't scare me
  • Nickname: touhou9513
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #730 on: July 18, 2017, 12:50:23 pm »
Soon after i edited, it said angleToPlayer is not defined, I'm not so sure about where to make it defined, any ideas ? https://pastebin.com/qNb1FTts
*if you don't mind, send the full script and i'l try to observe :3
Yep, angleToPlayer is a custom function that I took from Helepolis' tutorials quite a time ago and pretty much kept it unaltered. I wrote it in one of the #include files of the script I took the task from.

PS: I'm currently not home and thus on my mobile, will edit this post and provide pastes of the relevant files as soon as I've returned.


EDIT: Here's the script where that task is from (it's called Shot1 there) and my library of miscellaneous functions that contains angleToPlayer.
« Last Edit: July 18, 2017, 04:04:21 pm by Jimmy »
Normal 1cc: EoSD, PCB, IN, PoFV, MoF, UFO, TD, DDC, LoLK Legacy
Hard 1cc: IN, DDC
Extra clears: MoF, DDC

Goals: Going Extra Hard!

GenoCraft

  • Boundary of productive and lazy
  • Hijirin da best 2hu
  • Nickname: ♥♪!?
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #731 on: July 18, 2017, 01:28:06 pm »
What part of it? The blending or the motion? If it's the latter, it works the same as Junko's, for which I have a writeup here:
https://www.shrinemaiden.org/forum/index.php/topic,19249.msg1257975.html#msg1257975
It's the latter, thank you!

Axyo

  • Neophyte
  • Gender: Keesom
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #732 on: July 21, 2017, 09:55:06 pm »
    Hey guys! I am new in the scripting world, just began this week and I have some problems with a pattern :(. I fact, I don't understand why it does something like that :ohdear:, I need someone to try it and tell me why it does something like that, and how you would fix it :blush::

https://drive.google.com/drive/folders/0Bwf7GLCc6Z9JbWh3NjF3YTlfdW8?usp=sharing

    As you can see, the problem resides in the delay laser. I want my big stars to explode only when hitting the delay laser, but when the laser hits the bottom of the screen and teleport to the top, everything explode, I really don't get it ???.
    I think it's because of the fact that the laser doesn't actually warp to the top, but goes really fast to the top while hitting the stars, which cause the stars to explode, but why? I've set the laser to teleport to the top, it shouldn't do something like that... :ohdear:

    Actually, I was able to fix it, but in a weird way that I don't understand, so I still need someone to tell me how he/she would do :D.
« Last Edit: July 23, 2017, 10:56:19 am by Axyo »

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #733 on: July 22, 2017, 07:14:21 am »
It's quiet weird while the bullets shoot from the ceiling,haha, what have i done ? https://pastebin.com/2PntFf07
I wanna be better

Drake

  • アイスになりたい
  • *
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #734 on: July 22, 2017, 08:43:16 am »
You fire around BossX and BossY. You set these both to be 10 at the start of the file, but never change them. You want to use ObjMove_GetX(objBoss) and ObjMove_GetY(objBoss).

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

IIe4eNiIIIe

  • Neophyte
  • Nickname: Cookieofd00m
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #735 on: July 22, 2017, 12:24:29 pm »
When i change intersection circle of a shot via ObjShot_SetIntersectionCircleA1 it doesnt intersect with any other objects, making IsIntersected_Obj_Obj impossible to use, while if i dont change the intersection circle, it works fine. Is there any other way to register the intersection of 2 objects except for IsIntersected_Obj_Obj?

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #736 on: July 22, 2017, 02:32:37 pm »
And, .... how to replicate Mishaguji-sama ? :3
I wanna be better

CrestedPeak9

  • Just Beat SA Hard
  • Nickname: Crested
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #737 on: July 22, 2017, 03:04:49 pm »
And, .... how to replicate Mishaguji-sama ? :3

Create two  bullet rings and set opposite angular velocities.

When i change intersection circle of a shot via ObjShot_SetIntersectionCircleA1 it doesnt intersect with any other objects, making IsIntersected_Obj_Obj impossible to use, while if i dont change the intersection circle, it works fine. Is there any other way to register the intersection of 2 objects except for IsIntersected_Obj_Obj?

ObjShot_SetIntersectionCircleA1
Parameters:
 1) object ID (real)
 2) hitbox radius (real)
Creates a hitbox of specified radius for collision detection of the shot object. In order to maintain the hitbox, it must be set every frame. There can be multiple hitboxes set for one shot object.

In other words, set the hitbox every frame and it should work as intended.
Normal 1cc: LLS, MS, EoSD, PCB, IN, PoFV, MoF, SA, UFO, TD, DDC
Hard 1cc: LLS, EoSD, PCB, IN, MoF, SA, TD, DDC
Extra 1cc: EoSD, PCB (+Phantasm), IN, MoF, UFO
Easy Perfect: EoSD, TD

IIe4eNiIIIe

  • Neophyte
  • Nickname: Cookieofd00m
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #738 on: July 22, 2017, 03:16:52 pm »
ObjShot_SetIntersectionCircleA1
Parameters:
 1) object ID (real)
 2) hitbox radius (real)
Creates a hitbox of specified radius for collision detection of the shot object. In order to maintain the hitbox, it must be set every frame. There can be multiple hitboxes set for one shot object.

In other words, set the hitbox every frame and it should work as intended.

Yes, i already did make the task to set it every frame, but that still doesnt work, the hitbox changes only for player intersection, and other shots just dont react to that object

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #739 on: July 22, 2017, 03:34:09 pm »
 while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
        let angleT = GetAngleToPlayer(objBoss);
        loop(13){
            ascent(i in 0..1){
            CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.5 - i/3, angleT, 406, 5);
            }
         ObjMove_SetAngularVelocity(obj, -10) ;
            angleT += 360/12;
        }
        wait(50);
    }

any ideas ? it doesn't spin like it...  ???
I wanna be better

Axyo

  • Neophyte
  • Gender: Keesom
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #740 on: July 22, 2017, 03:54:05 pm »
while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
        let angleT = GetAngleToPlayer(objBoss);
        loop(13){
            ascent(i in 0..1){
            CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.5 - i/3, angleT, 406, 5);
            }
         ObjMove_SetAngularVelocity(obj, -10) ;
            angleT += 360/12;
        }
        wait(50);
    }

any ideas ? it doesn't spin like it...  ???

You have to declare your "obj" before assigning your function to it, otherwise it won't do anything. And, your angular velocity is way too high, -10 will make your bullets spin so fast that they won't go anywhere, try something like -0.2. If I was you, I would do:

 while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){
        let angleT = GetAngleToPlayer(objBoss);
        loop(13){
            ascent(i in 0..1){
                 let obj = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.5 - i/3, angleT, 406, 5);
                 let obj2 = CreateShotA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 2.5 - i/3, angleT, 406, 5);
       }
         ObjMove_SetAngularVelocity(obj, -0.2) ;
         ObjMove_SetAngularVelocity(obj2, 0.2);
            angleT += 360/12;
        }
        wait(50);
    }

    I am sure of nothing though. I don't get why you used an "ascent", if you wanna slowdown the speed of your bullets, you can simply use "CreateShotA2".
« Last Edit: July 22, 2017, 04:12:57 pm by Axyo »

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #741 on: July 22, 2017, 04:18:23 pm »
I wanna be better

Axyo

  • Neophyte
  • Gender: Keesom
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #742 on: July 22, 2017, 04:33:42 pm »
https://pastebin.com/eLFp9uZ0
can obj be 0 ?

Well, if your "obj" is equal to 0, it won't do anything. Think it this way:
your function "ObjMove_SetAngularVelocity" is assigned to who? No one, but to a random "0" that isn't an object or something. Between your parentheses, you have 2 parameters: The first one is the object ID which you wanna assign to your function, the other one is the angular velocity.
     The object ID is your bullet, right? You want say that you want your bullet to have this angular velocity, not a random 0 to have angular velocity, because it means nothing, 0 isn't an object or something. But how to do it? It's simple, you want to declare your bullet as the object to have this angular velocity, to do so you simply write what I wrote:

let obj = CreateShotA1 etc....

What it is going to do, is declare a new local variable, which is obj (you don't need the other one) and will tell to the script that your obj is assigned to your shot. Once you've written this, you can affect your shot by putting your new variable inside your function, I don't know if I was clear enough, my english is quite bad, sorry for this.
« Last Edit: July 22, 2017, 04:36:15 pm by Axyo »

GenoCraft

  • Boundary of productive and lazy
  • Hijirin da best 2hu
  • Nickname: ♥♪!?
  • Gender: Male
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #743 on: July 22, 2017, 09:00:52 pm »
How can I get and object's alpha? I can't find a function that does that.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
  • Staff
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #744 on: July 22, 2017, 09:32:59 pm »
How can I get and object's alpha? I can't find a function that does that.
Unfortunately, there is no function for that. If you want to track an objects alpha, you can try to use Get/Set Values and pass the alpha value through. That way you can some sort of track an object's alpha.

Example:
Code: [Select]
function someObject() {
let obj = ...
let alpha = 200;

Obj_SetValue(obj, "alphaValue", alpha);

return obj;
}

task testRetrieveAlpha() {
let testObject = someObject();

let retrievedValue = Obj_GetValue(testObject, "alphaValue");

<generic text object prints 'retrievedValue'>
}
If the text object is produced, it should report 200. Above can be turned into more "object orientated" methods/functions, but I tried to keep it simple here.
  • Helepolis' Siege Workshop

BananaCupcakey

  • /o.o\
  • Nickname: Banana
  • Gender: ?
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #745 on: July 23, 2017, 01:51:37 am »
After i let "let obj = CreateShotA1;", then it says that it's not the correct parameters , any ideas ? .-.
I wanna be better

CrestedPeak9

  • Just Beat SA Hard
  • Nickname: Crested
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #746 on: July 23, 2017, 02:23:40 am »
After i let "let obj = CreateShotA1;", then it says that it's not the correct parameters , any ideas ? .-.

facepalm

Tell me, how many parameters are needed in creating a shot using CreateShotA1?
When you assign to obj and use the CreateShotA1 function, you are creating a bullet and assigning the bullet ID to obj.
So create a shot as normal, and obj will be the ID of the shot.
Normal 1cc: LLS, MS, EoSD, PCB, IN, PoFV, MoF, SA, UFO, TD, DDC
Hard 1cc: LLS, EoSD, PCB, IN, MoF, SA, TD, DDC
Extra 1cc: EoSD, PCB (+Phantasm), IN, MoF, UFO
Easy Perfect: EoSD, TD

Drake

  • アイスになりたい
  • *
  • LOOK AT ME
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #747 on: July 23, 2017, 03:44:07 am »
Banana, I would really recommend to go back through tutorials until your basic understanding of scripting improves. Your past few problems have essentially been you typing things in without understanding what it's actually doing. You can't just keep typing whatever and then asking for help when it inevitably doesn't work.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander
- original art by あかがし -

Axyo

  • Neophyte
  • Gender: Keesom
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #748 on: July 23, 2017, 11:08:38 am »
    Hey guys! I am new in the scripting world, just began this week and I have some problems with a pattern :(. I fact, I don't understand why it does something like that :ohdear:, I need someone to try it and tell me why it does something like that, and how you would fix it :blush::

https://drive.google.com/drive/folders/0Bwf7GLCc6Z9JbWh3NjF3YTlfdW8?usp=sharing

    As you can see, the problem resides in the delay laser. I want my big stars to explode only when hitting the delay laser, but when the laser hits the bottom of the screen and teleport to the top, everything explode, I really don't get it ???.
    I think it's because of the fact that the laser doesn't actually warp to the top, but goes really fast to the top while hitting the stars, which cause the stars to explode, but why? I've set the laser to teleport to the top, it shouldn't do something like that... :ohdear:

    Actually, I was able to fix it, but in a weird way that I don't understand, so I still need someone to tell me how he/she would do :D.

   Well, I guess no one's going to help me like that so let's be more specific: When I fix this problem, I have some random stars popping out from the top left corner of my screen. I tried all sort of things like cancel the function that make my stars explode when the laser teleport to the top, or deleting all explosion outside from the screen thinking that the small stars were stacking outside from the screen and reappearing at the top left corner, and trying out other things. The conclusion to this would be that all the stars that explode from hitting the delay laser stack for reappearing later, but I didn't ask for this, I don't get it, can someone help me?
    This is a recurrent problem since in my other scripts, I have the same problem with random stuff popping out from the top left corner of my screen. I thought it was because danmakufu could't interpret functions outside from the screen so to fix that it would make them happen at X=0 and Y=0 but now I am lost.

Infinnacage♫

  • Demonic★Moe
  • *
Re: ※ Danmakufu Q&A/Problem thread 3 ※
« Reply #749 on: July 23, 2017, 07:51:36 pm »
Hi, this is Sercan from olden times.

I'm wondering if there's a ph3 thread for useful code snippets, and/or a library of extra functions to make life easier?

I am currently collecting my own and others' old 0.12m functions and porting them to ph3 to make a wholesome library. If someone did this already, it would be rather useless!
  • Music Empire!
 

SMF 2.0.14 | SMF © 2017, Simple Machines
Theme based on ModernDark64 design by BlocWeb
Page created in 0.073 seconds with 23 queries.