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

gtbot

  • Master of ScreenSplit
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #720 on: August 21, 2013, 10:11:05 PM »
Danmakufu tells me I can't use @Initialize in the script I include it in.
The file you are including has another @Initialize in it, which is the cause of this error. Are you trying to include the previously mentioned script that you tried to start five times?

Also, that task closes the loop before it can do anything. I've made fixes to the pastebin you had given; they are found here () edit: that pastebin was wrong oops, http://pastebin.com/rLEDyar4

The idea behind the changes I made are this: you create a basic fairy using CreateFairy, then after creating it, (using the object that was returned from the function) you use FairyMaintenanceA1 so that it follows the properties of that task. In this case, it will simply fire one shot every second downwards. If you wanted to have different properties for different fairies (because you won't be using the same fairy throughout the stage), simply make a new task, perhaps FairyMaintenanceA2, and define new actions for it to take.

Example:
Code: [Select]
loop(5){
let e = CreateFairy(img,rand(48,GetStgFrameWidth-48),rand(48,128),325,100,100);
FairyMaintenanceA1(e);
}
// remember that since it is returning a value, you can also shorten it like this
// (if you aren't planning on using the object id again):
// FairyMaintenanceA1(CreateFairy(img,rand(48,GetStgFrameWidth-48),rand(48,256),325,100,100));

If you still get errors I'd suggest posting the full script (and the one you are trying to #include as well)

« Last Edit: August 21, 2013, 11:55:52 PM by gtbot »

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #721 on: August 21, 2013, 10:54:21 PM »
The file you are including has another @Initialize in it, which is the cause of this error. Are you trying to include the previously mentioned script that you tried to start five times?

Also, that task closes the loop before it can do anything. I've made fixes to the pastebin you had given; they are found here (http://pastebin.com/hnwtRq15)

The idea behind the changes I made are this: you create a basic fairy using CreateFairy, then after creating it, (using the object that was returned from the function) you use FairyMaintenanceA1 so that it follows the properties of that task. In this case, it will simply fire one shot every second downwards. If you wanted to have different properties for different fairies (because you won't be using the same fairy throughout the stage), simply make a new task, perhaps FairyMaintenanceA2, and define new actions for it to take.

Ok so it works, but only in Single scripts, if I use a stage script the game will create the fairy but it won't do anything. But if I create the same fairy in a single script it works.

So how do I get it to work in a stage script or how do I code single scripts so that when all fairies are gone it closes the script?


EDIT: Also, I kinda used and did a few edits to MPP's lifebar script(though it doesn't delete when the boss dies) I want to know if it's ok to use it while I do give ido full credit?
« Last Edit: August 21, 2013, 10:56:30 PM by Infinite Ultima Wave »

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #722 on: August 21, 2013, 11:24:30 PM »
but after some testing I noticed that if I start the same script twice it will only show up once.
Nope. It would be so much more helpful for you to actually show us what the heck you're doing rather than do "testing" and then dismiss it.

Danmakufu will only create one even though I put StartScript in five times.
This is probably the problem. You don't just keep calling StartScript, you need to load the script again, wait to compile and start it. When you call LoadScript it returns the new script's ID, and will return a different script ID even if it's the same file. If you just call StartScript a bunch it'll just ignore it because the script with that ID has already started. In practice, you're going to want to load all of the scripts a bit earlier than when you want to start them in order to start them all in quick succession, because loading a script takes about a second.


Anyways, here's an example of spawning five enemies in one script that you can call from a stage.

http://pastebin.com/MGMtm6DT

Alternatively, you can do as I originally said and have just one enemy in the one script, and run the script multiple times.

Alternatively, you can plop all the relevant functions from the enemy script into the stage script and it should work fine too.

Note that I didn't bother with @Event, but really events are super useful and are a very good reason to use scripts to spawn enemies rather than just creating them using functions, especially in full stages/games.

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

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #723 on: August 21, 2013, 11:47:51 PM »
Thanks again, everyone is such a big help especially you Drake. Anyway, I probably won't need to use 0.12m anymore.

EDIT: Also, I kinda used and did a few edits to MPP's lifebar script(though it doesn't delete when the boss dies) I want to know if it's ok to use it while I do give ido full credit?

I still wanna know before I start working on it.

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #724 on: August 22, 2013, 07:02:18 AM »
Note that I didn't bother with @Event, but really events are super useful and are a very good reason to use scripts to spawn enemies rather than just creating them using functions, especially in full stages/games.
Are you suggesting making and running an "enemy management" script that uses its @Event to summon enemies? Because I already have a sort of system like that with sounds and graphical effects. Would that be easier than just running enemy tasks from the stage?

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #725 on: August 22, 2013, 09:47:53 AM »
Not necessarily to summon enemies, but "management" was what I was going for with the script I posted, yes. The use of @Event would be more for things like "an enemy has been destroyed" or "signal this wave to explode" or anything else that signals across and/or requests information from other non-simple entities. A script that manages enemies is one idea that seems like it would be useful, but I haven't even thought about it much, never mind using it constructively yet. The main point is that having event handling cuts through a huge number of different blockades and unnecessary overcomplications people have encountered with 0.12 (the more obvious being "global" flags, stupid overuse of commondata, ridiculous function chaining, stages doing everything) and it really deserves some thought.

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 #726 on: August 22, 2013, 08:26:42 PM »
Does anyone have a script that adds the Enemy Marker to the bottom of the screen, the one that follows the boss around? If not I think I could make one, but I would still need a sprite if anyone has one of those.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #727 on: August 22, 2013, 11:29:53 PM »
If you want to just use graphics from the Touhou games, I have image rips available here.
http://www.shrinemaiden.org/forum/index.php/topic,197.0.html

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 #728 on: August 22, 2013, 11:58:44 PM »
If you want to just use graphics from the Touhou games, I have image rips available here.
http://www.shrinemaiden.org/forum/index.php/topic,197.0.html

Thank you very much!

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #729 on: August 23, 2013, 04:40:25 AM »
Does anyone have a background tutorial for PH3? even as simple as a non moving picture would do.

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #730 on: August 23, 2013, 05:13:33 AM »
Does anyone have a background tutorial for PH3? even as simple as a non moving picture would do.
There's no longer any real special background functions or anything like @Background. Drawing a background (especially a static one) is as simple as making an effect object and drawing an image with it. Just make sure that the priority is in the background.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #731 on: August 23, 2013, 05:15:17 AM »
There's no longer any real special background functions or anything like @Background. Drawing a background (especially a static one) is as simple as making an effect object and drawing an image with it. Just make sure that the priority is in the background.

Wow they really made this much more simple, and then to add a effect filter over it just make a new effect object right?

Ozzy

  • Veteran Danmakufu Scripter
  • Currently working on a full Touhou fangame!
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #732 on: August 23, 2013, 05:23:11 AM »
Wow they really made this much more simple, and then to add a effect filter over it just make a new effect object right?

Yes. Typically background management is done in a separate script which can be specified for use in a script's #Background section. You can look at how the default background script called "Default_Background_IceMountain.txt" does it.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #733 on: August 23, 2013, 06:23:24 PM »
1. http://www.mediafire.com/?dbtdzfbnuturnib; Put #include"./Cutin.txt" in the header for the file you want the cutins to be added for. Keep in mind that depending on your file structure, you may have to edit the image paths in Cutin.txt. This is true when only white squares appear instead of the proper image. When editing the image paths, keep in mind that it is relative to the script calling Cutin.txt, not relative to Cutin.txt itself. Instructions on how to use the cutins are in Cutin.txt

2. You can do it in any script you desire, the key to getting it down is "display image and text; when shot button is pressed, move on". In the download for the cutins, I added a file that i was messing around with some time ago. This file contains a crude version of a Ten Desires conversation. Add #include"./EventTest.h" into the Sample.txt file to see how it works.

3.
Code: [Select]
let objFamiliar = CreateOption;

function CreateOption{
let obj = ObjEnemy_Create(OBJ_ENEMY);
ObjEnemy_Regist(obj);
ObjPrim_SetTexture(obj, familiarimage);
ObjSprite2D_SetSourceRect(obj, rec1, rec2, rec3, rec4);
ObjSprite2D_SetDestCenter(obj);
ObjEnemy_SetLife(obj, familiarlife);
return obj;
}
With the object id you get from this task, you may use it as you desire. Alternatively, you may edit this task to suit your needs for your familiar.

I'm using the cut in file from this post and I'm having a problem where the cut ins wont delete themselves, they stick on the screen and I was wonder if the creator is still around, or if anyone knows a function I can use to wipe the screen after each card.

Darkness1

  • Nothing to see here.
  • Enigmatic, isn't it?
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #734 on: August 23, 2013, 07:19:02 PM »
or if anyone knows a function I can use to wipe the screen after each card.
From the danmakufu wiki on ph3 functions:
Code: [Select]
SetAutoDeleteObject
Arguments:
    1) Boolean
Determines whether to delete all existing objects that were created in the script at its termination.
The default value is false.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #735 on: August 23, 2013, 07:36:54 PM »
From the danmakufu wiki on ph3 functions:
Code: [Select]
SetAutoDeleteObject
Arguments:
    1) Boolean
Determines whether to delete all existing objects that were created in the script at its termination.
The default value is false.

That is so useful....

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #736 on: August 25, 2013, 10:14:27 AM »
I noticed drawing order and 3D drawing in ph3 is a major headache compared to 0.12m. Replicating a stage from 0.12m ended up in a train wreck. For example in 0.12m I have  floor > walls > ceiling  drawing order. If I apply this in ph3 the results will be extremely wonky. The ceiling and floor will "bleed" through the walls and move at very odd speeds/perspective. So I had to change the order to   floor > ceiling > wall, because wall falls over the ceiling.

Now a question of my own: I have some issues regarding ADD type blending and fog.  ObjRender_SetBlendType(obj,BLEND_ADD_RGB);


in 0.12m the texture had the same effect, but not for the entire square , only the visible graphic itself.

Logically we can work around by altering alpha based on distance, though perhaps someone figured an easier way?


Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #737 on: August 25, 2013, 02:48:13 PM »
Why not create a 3D environment using Metasequoia? I never could get the 3D in 0.12m to work like I wanted it to.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #738 on: August 25, 2013, 04:04:37 PM »
Sorry if those questions were already answered but this forum isn't suited for proper searching (like "search in topic").

Could anyone help with these?
1) Is it possible to use double quote characters in text? For example, quotes in spellcard names.
2) Is there any way to use styles for text like bold, italic or some other one? Anything to highlight specific parts of the text. For now, the only way I can imagine is using capital but it's just wrong. I found ObjText_SetFontBold but it seems I can't use it to mix normal and bold text.
« Last Edit: August 25, 2013, 05:17:56 PM by Vectorfish »
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Maths ~Angelic Version~

  • Aspiring Mathematician of Brilliant Laziness
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #739 on: August 25, 2013, 05:57:17 PM »
Why not create a 3D environment using Metasequoia? I never could get the 3D in 0.12m to work like I wanted it to.
I guess because Metasequoia isn't freeware.

Sage Ω (Ultima)

  • CEO at Team Eternal Desire
  • ??? X
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #740 on: August 25, 2013, 06:04:18 PM »
There are freeware and shareware versions. Though the shareware version is limited unless you buy a license. Though the basic features should be good enough.

Imosa

  • Any sufficiently advanced technology
  • is indistinguishable from magic
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #741 on: August 25, 2013, 06:22:31 PM »
One that that I've been doing to make my 3d backgrounds was to start in Google Sketchup. I like interface more, and its made for architecture so clean cut and simple structures go up better (as appose to the smooth flowing curves which other programs have to think about). Sketchup, however, does not have good support for VN mapping. So I suggest saving the Sketchup model as an .obj file and doing that elsewhere.
I've been able to do VN Metasequoia but I also want to check out other programs. If you look into other programs just make sure you can get a .obj out of it.
Finally you may only be using Metasequoia as a converter from .obj to .mqo.

Helpful hint: the danmakufu camera, when azumith and elevation are 0, looks down the x axis so along [-1,0,0], with up being up the y axis, so [0,1,0].

Sorry if those questions were already answered but this forum isn't suited for proper searching (like "search in topic").

Could anyone help with these?
1) Is it possible to use double quote characters in text? For example, quotes in spellcard names.
2) Is there any way to use styles for text like bold, italic or some other one? Anything to highlight specific parts of the text. For now, the only way I can imagine is using capital but it's just wrong. I found ObjText_SetFontBold but it seems I can't use it to mix normal and bold text.
I was only able to do this by making multiple piece of text and moving them into place.
« Last Edit: August 25, 2013, 07:25:48 PM by Imosa »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #742 on: August 25, 2013, 07:53:56 PM »
I appreciate the suggestion for meta, I have the program except modelling is hard and UV mapping is even harder.

Perhaps my question wasn't exactly well explained, I am looking for a fix with the fog + ADD as shown in the screenshot. I know the workaround thanks to discussing it on IRC with Drake, but i was wondering if anybody knows the fix.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #743 on: August 25, 2013, 08:16:22 PM »
I was only able to do this by making multiple piece of text and moving them into place.
So, there is no easy and convenient way to do it... I guess I'll leave it till better times.
Thank you.
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Imosa

  • Any sufficiently advanced technology
  • is indistinguishable from magic
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #744 on: August 25, 2013, 09:45:48 PM »
So, there is no easy and convenient way to do it... I guess I'll leave it till better times.
Thank you.
Well, not as easy and convenient as you're looking for. For example, there is a function to calculate text length. You could use that to help figure out where you should place other pieces of text.

Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #745 on: August 25, 2013, 10:33:58 PM »
The reason why I wanted a "convenient" way is because the placement of text is done on-the-fly. I didn't try it (yet?) but I doubt that it's possible to add support for automatic processing bold and normal text. If I would do it manually then yeah, it's not a bad option but this case is different.
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #746 on: August 26, 2013, 02:01:00 AM »
Sorry if those questions were already answered but this forum isn't suited for proper searching (like "search in topic").

Could anyone help with these?
1) Is it possible to use double quote characters in text? For example, quotes in spellcard names.
2) Is there any way to use styles for text like bold, italic or some other one? Anything to highlight specific parts of the text. For now, the only way I can imagine is using capital but it's just wrong. I found ObjText_SetFontBold but it seems I can't use it to mix normal and bold text.
1. You can escape double-quotes with a backslash, like "bla \"blablabla\"".
2. Nope. You could do it manually with some effort, indeed by breaking apart text objects and repositioning them, and that could support processing of certain flags if you wanted, but it wouldn't be worth it.

I'm more or less wondering why you need bold/italics in the first place.

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

Imosa

  • Any sufficiently advanced technology
  • is indistinguishable from magic
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #747 on: August 26, 2013, 05:22:34 AM »
So I'm not sure if I expect anyone to know about this stuff but I guess I can try asking.
I wanted to try making a 3d object from scratch so I started putting relevant functions together. There's a lot of stuff that can go wrong here so I thought I'd see what other people thought of the code. Is this, at all, on the right track?
Code: [Select]
task triangleTest() {
let path = GetCurrentScriptDirectory ~ "/Corridor/testure.png"; //sets the path for the texture (object can't be seen without it)
let obj = ObjPrim_Create(OBJ_PRIMITIVE_3D); //Creates the object
ObjPrim_SetPrimitiveType(obj,PRIMITIVE_TRIANGLEFAN); //Sets the type of 3D object (why does this even need to be set?
ObjPrim_SetVertexCount(obj,3); //Creates some vertices (I'll need these)
ObjPrim_SetVertexPosition(obj,0,0,0,0); //Some conspicuous vertex placement
ObjPrim_SetVertexPosition(obj,1,0,100,100);
ObjPrim_SetVertexPosition(obj,1,0,0,100);
ObjPrim_SetTexture(obj,path); //sets the texture
ObjPrim_SetVertexUVT(obj,0,0,0); //UV mapping
ObjPrim_SetVertexUVT(obj,1,10,0);
ObjPrim_SetVertexUVT(obj,2,0,10);

Obj_SetRenderPriorityI(obj, 20); //A render priority
Obj_SetVisible(obj, true); //Would suck if this ended up being a problem

ObjRender_SetPosition(obj,0,0,0); //Added this, just to be safe.
}

Also I tried editing the vertices of a mesh with ObjPrim_SetVertexPosition, and that didn't work. Is there anyway to edit meshes?

EDIT: I fixed the code above, Line 8 I only set 2 vertices on accident. I've now got something showing up.
« Last Edit: August 26, 2013, 05:54:51 AM by Imosa »

Drake

  • *
Re: ※ Dnh Q&A/Problem ※ ONLY for NEWEST engine (ph3 beta)
« Reply #748 on: August 26, 2013, 06:25:05 AM »
Quote
//Sets the type of 3D object (why does this even need to be set?

Stands for 3D primitives.

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 #749 on: August 26, 2013, 07:47:38 AM »
1. You can escape double-quotes with a backslash, like "bla \"blablabla\"".
2. Nope. You could do it manually with some effort, indeed by breaking apart text objects and repositioning them, and that could support processing of certain flags if you wanted, but it wouldn't be worth it.

I'm more or less wondering why you need bold/italics in the first place.
1) Yeah, just found the same solution to use backslash before double quote. Anyway, thank you :)
2) Well, I'm trying to make terrible translation patch for MPP using text from wiki. Some words in the translation are marked as italic and I'm not sure how should I deal with them - try to mark them in similar way (which was shown to be complicated), leave them as normal words (like I did for now) or rephrase translation in such a way where they aren't necessary (which is out of my skills).
Would be glad to get help with Touhou Doumeiju ~ Mystical Power Plant Translation Project spellcard comments' translation.