Author Topic: ※ Dnh Q&A/Problem ※ for Danmakufu ph3 (locked)  (Read 267906 times)

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #60 on: August 30, 2011, 11:41:54 PM »
Is ObjRender_SetBlendType a non-working function right now? It doesn't seem to work, sadly.

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #61 on: August 30, 2011, 11:50:13 PM »
Is ObjRender_SetBlendType a non-working function right now? It doesn't seem to work, sadly.
Are you using BLEND_ADD_RGB, etc?

edit:typo
« Last Edit: August 31, 2011, 12:50:14 AM by Mewkyuu »

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #62 on: August 31, 2011, 12:26:26 AM »
BLEND_ADD_RGB, yeah.
There's no error window or anything. It's just that there's no effect.

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #63 on: August 31, 2011, 03:18:38 AM »
ObjRender_SetBlendType works well.

KrackoCloud

  • I don't mean to be greedy...
  • ... but white rice is my favorite food.
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #64 on: August 31, 2011, 04:05:27 AM »
Hmm... Are the ObjRender functions not supposed to apply to bullets? Because that would solve a lot.

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #65 on: August 31, 2011, 04:18:18 AM »
Blend types for shot objects are defined in shot data.

Thaws

  • _m廿廿m_
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #66 on: September 09, 2011, 10:19:37 AM »
Finally have time to play around ph3 like 2 weeks ago, took some time to get used to the new scripting style, but I am really liking how much more convenient it is to use object bullets XD.

Anyways,  this is probably a stupid question due to me having never been interested in scripting players and so have no knowledge about them.  :V
I've noticed when the default Rumia player dies, bullets don't disappear. So do I have to do something like if(Player dies){Delete bullets} in all my attack scripts or is that the player script's responsibility to do so?

Nimono

  • wat
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #67 on: September 09, 2011, 12:22:40 PM »
Finally have time to play around ph3 like 2 weeks ago, took some time to get used to the new scripting style, but I am really liking how much more convenient it is to use object bullets XD.

Anyways,  this is probably a stupid question due to me having never been interested in scripting players and so have no knowledge about them.  :V
I've noticed when the default Rumia player dies, bullets don't disappear. So do I have to do something like if(Player dies){Delete bullets} in all my attack scripts or is that the player script's responsibility to do so?
The player does it. Run a check for (GetPlayerState == STATE_DOWN) when removing bullets; don't simply put the code in the EV_HIT event section, or they'll be deleted before you die. (EV_HIT runs exactly when it says it does: when you get hit. Deathbombing is counted as a "hit" because a bullet still hit you. STATE_DOWN is death, but I don't know if there's an associated event type.)

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #68 on: September 11, 2011, 09:59:06 AM »
Is there any way to #include scripts from the upper directories?
« Last Edit: September 11, 2011, 11:04:42 AM by Rosen »

Miplouf Saigyouki

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #69 on: September 11, 2011, 12:04:16 PM »
Is there any way to #include scripts from the upper directories?

Not at my knowledge.
Except if you translate what you did in 0.12 into ph3!


Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #70 on: September 11, 2011, 07:59:09 PM »
First of all I'm not quite sure why you would #include a script from a higher directory, considering in most cases an #include should just be in the same or below. If you're making a huge file structure you should be using absolute paths instead of GCSD.

If it's the sort where you usually put ./ for the script directory (i.e. when you aren't giving a string), use ../ for the one above.
If it's the sort where you use GCSD, the whole thing is just a string. You can eliminate characters in the pathname until you get to your desired directory.

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

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #71 on: September 12, 2011, 02:48:00 AM »
Yeah, i'm using absolute paths already.

GCSD, GMSSD does not work in #include. It shows an error... something about types.

../ doesn't work too.

Thanks for the reply.

UPD:
Is there something like CreateEnemyFromFile in ph3?
« Last Edit: September 16, 2011, 02:49:44 AM by Rosen »

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #72 on: September 16, 2011, 12:18:04 PM »
As far as I'm aware, there is none. However, you can use this for the same effect:
Code: [Select]
function CreateEnemyA1(scriptpath, x, y, enmspd, enmang, life, argument){
let enemyscript  = LoadScript(scriptpath);
SetScriptArgument(enemyscript, 1, x);
SetScriptArgument(enemyscript, 2, y);
SetScriptArgument(enemyscript, 3, enmspd);
SetScriptArgument(enemyscript, 4, enmang);
SetScriptArgument(enemyscript, 5, life);
SetScriptArgument(enemyscript, 6, argument);
StartScript(enemyscript);
return enemyscript;
}
And in the initialize of the enemy script, put the respective script arguments to their respective values.
Code: [Select]
ObjMove_SetPosition(objEnemy, GetScriptArgument(1), GetScriptArgument(2));
ObjMove_SetSpeed(objEnemy, GetScriptArgument(3));
ObjMove_SetAngle(objEnemy, GetScriptArgument(4));
ObjEnemy_SetLife(objEnemy, GetScriptArgument(5));

Nimono

  • wat
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #73 on: September 30, 2011, 05:34:14 PM »
http://pastebin.com/2jSBE8u5

I'm trying to make Reimu's homing orbs for a bomb (reeeeeeeeeeal original), but right now, just to get the graphics right, I have a basic spell object that simply moves up 5 pixels every frame. But for some reason, whenever the first orb spawns, the game stops for about 2 seconds. After that, the rest spawn just fine! (they spawn every 60 frames just as a test of this) I can't figure out what's wrong. If you check my Marisa A player from the Player Script thread, it doesn't stop the game when the bomb is used, and I copied the code for the explosion object for this bomb! I can't figure out WHAT is different that causes this freeze. All I can tell is, it only freezes when the very first orb is spawned; doesn't matter when, just that it does at all.

Help!

EDIT: I just realized, it might be more helpful if the entire player script was posted...
EDIT2: ...nevermind, it was setting the texture that did it...but why did THIS freeze when I spawned SIX objects at once with my Marisa A player without loading the graphic any other way? Heck, that bomb loads NONE of the graphics before spawning the objects...there should've been at least three freeze spots...
EDIT3: Default Rumia does one even better- NO graphics are preloaded in it. Not bomb, not player. NOTHING. It doesn't freeze. SO WHY IS THIS ONE BOMB LITERALLY THE ONLY ONE THAT DOES!?
EDIT4: and finally, the issue: Apparently, the bomb's graphic was DOUBLE the size of those used in my Marisa player, plus 1. Minus 1, halve the size, no freeze. ...but when I switched to the player graphic file, Reimu.png...no freeze. Said file is bigger. Odd. Then again, it has a lot of transparent space...
« Last Edit: September 30, 2011, 05:55:28 PM by Nimono »

Formless God

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #74 on: October 02, 2011, 01:12:35 AM »
EDIT: if (ObjEnemy_GetInfo(obj, INFO_LIFE) <= 0). Never mind, I need to go kill myself.
« Last Edit: October 02, 2011, 05:48:53 AM by Anarchy Formless »

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #75 on: October 08, 2011, 02:04:02 PM »
Well now I have a problem on my script.
 I want to create explosion effects when my boss shooting bullets ... I tried with this code (I have not yet made the paramettrage below):

Code: [Select]
task ExplodeBUllet(X,Y,sx,sy,alpha)
{
let A= 28;
let B= 31;
let objE = ObjPrim_Create(OBJ_PRIMITIVE_2D);
ObjPrim_SetPrimitiveType(objE,PRIMITIVE_TRIANGLELIST);
ObjPrim_SetVertexCount(objE,4);
ObjPrim_SetTexture(objE,GetCurrentScriptDirectory ~

"img/explodeyellow.png");
ObjPrim_SetVertexUV(objE,0, -1/2*A,-1/2*B);
ObjPrim_SetVertexUV(objE,1,1/2*A,-1/2*B);
ObjPrim_SetVertexUV(objE,2,1/2*A,1/2*B);
ObjPrim_SetVertexUV(objE,3,-1/2*A,1/2*B);
ObjRender_SetX(objE,X);
ObjRender_SetY(objE,Y);
ObjRender_SetScaleX(objE,sx);
ObjRender_SetScaleY(objE,sy);
ObjRender_SetAlpha(objE,alpha);
}


But nothing appears >.<!
Help me >o<

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #76 on: October 08, 2011, 09:33:22 PM »
Five bucks says you forgot to load the texture.

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

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #77 on: October 08, 2011, 11:20:26 PM »
ObjPrim_SetTexture loads the texture, so it's not that.

I think you've got the wrong primitive type; you want PRIMITIVE_TRIANGLEFAN. (Personally, I'd just use ObjSprite2D functions for rectangles.)

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #78 on: October 09, 2011, 03:12:24 AM »
Trianglefan vs Trianglestrip likely has nothing to do with this, the only difference with square objects is that the third and fourth vertices are swapped.

Although, now that you mention it, the coordinates for the whole image is currently (-14, -15.5, 14, 15.5). Apparently Prim_SetVertexUV uses percentages (0 to 1) relative to the texture size for
its coordinates, so you'd want Prim_SetVertexUVT for the pixel coordinates. But even then, the coordinates shouldn't go into the negatives since there's nothing past (0,0).

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

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #79 on: October 09, 2011, 06:40:44 PM »
Is there any way to check if a bullet collides with another bullet or laser? I tried ObjCol_IsIntersected but that only seemed to apply to the player.

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #80 on: October 10, 2011, 03:08:29 AM »
I think you can use some trigonometry to check if the point is on the segment.

This doesn't work in beta2. It seems that it is bugged.
Code: [Select]
bgm_Obj = ObjSound_Create;
ObjSound_SetSoundDivision(bgm_Obj, SOUND_BGM);
ObjSound_Load(bgm_Obj, BGM_TABLE[0]);
ObjSound_SetVolumeRate(bgm_Obj, 100);
ObjSound_SetLoopEnable(bgm_Obj, true);
ObjSound_SetLoopTime(bgm_Obj, BGM_LOOP_TABLE[0], BGM_LOOP_TABLE[1]);
ObjSound_Play(bgm_Obj);
« Last Edit: October 16, 2011, 05:02:10 PM by Rosen »

CK Crash

  • boozer
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #81 on: October 18, 2011, 04:06:28 AM »
BGM doesn't seem to work at all in beta 2 for some reason?

TraceTheKriken

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #82 on: October 19, 2011, 04:17:12 AM »
I was following a tutorial that helps people to do their own spell cards in danmakufu. At the end of the first part the maker of the tutorial tested his script, it worked but mine didn't. I always get this message, and since I can't read japanese I don't know where the problem is.

here is image of the error message

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #83 on: October 19, 2011, 04:25:55 AM »
I'm pretty sure that isn't Japanese...!
Welp, I think your AppLocale is set to the wrong locale on Danmakufu.

Also, I think you're supposed to be having script_enemy_main in your script somewhere. It might not exist, in Danmakufu's eyes. If you get what I mean...

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #84 on: October 19, 2011, 06:28:03 AM »
Your locale isn't parsing the Japanese correctly. Either AppLocale isn't on the proper setting or you don't have the proper languages installed.
Regardless, it's either saying script_enemy_main doesn't exist or that your brackets are mismatched. Can you pastebin your script?

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

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #85 on: October 19, 2011, 11:45:55 AM »
Quote
・oggのBGM再生時、2秒以内のファイルしか再生できなくなっていたのを修正
Fixed *.ogg bgm playback

DgBarca

  • Umineko fuck yeah
  • Spoilers ?
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #86 on: October 24, 2011, 12:45:21 PM »
Well hi.
I wanted to do a image that is only rendered on another image to do something like the transition between the normal and spirit world in TD. But in fact I have no idea how to do this. I managed to do something with a white zone and the pic in multiply blending but only if the background is completely black.

Well, I might not be clear, but something like this : http://img3.imageshack.us/img3/3896/testcbp.png
[21:16] <redacted> dgbarca makes great work
[21:16] <redacted> i hope he'll make a full game once

Rosen

  • Cry moar desu!
  • Hyu~ dorodorodoro!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #87 on: October 24, 2011, 01:52:53 PM »
The first one and the second one are completely different. What exactly do you want to do?

DgBarca

  • Umineko fuck yeah
  • Spoilers ?
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #88 on: October 24, 2011, 02:03:35 PM »
Well, I have a surface, and on this surface is drawn a picture. And the picture is not drawn out of the surface.
[21:16] <redacted> dgbarca makes great work
[21:16] <redacted> i hope he'll make a full game once

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #89 on: October 25, 2011, 03:51:44 AM »
What you want is an alpha mask. Unfortunately it doesn't seem like there's an easy way to do even a simple one in Danmakufu, but if you're content with a mask that simply turns pixels on/off rather than turning some pixels semi-transparent as well (unless you're masking an add-blend image in which case it's much much simpler), you can do it. If you want to do anything besides extraordinarily basic stuff it's going to be extremely process-heavy.

Firstly you make a completely black-white (as in binary) image where the white is what shape you want to turn pixels invisible (to reveal the image underneath) and the black is the stuff you want untouched. Then in-script you create a render target with the affected image as the first image, then the white image where you want to remove, and set the render mode to subtract. This will obviously turn all overlapped pixels black, and thus transparent. You then use this target as the foreground image you use.

If you want a mask shape that moves about the image (necessary for a moving foreground/background), you're going to need to recreate the render target every frame. If you want a shape that changes over time, you're going to need to either apply a mask image multiple times or add onto the target you already have (such as you would with trance mode). Obviously this gets expensive very quickly. If you do want an image that does have semi-transparent pixels as well, it just becomes exponentially expensive since it's basically fusing a lower-transparency image onto a higher-transparency image over and over.

There's really no easy way I can think of.

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