+++ DYNRPG - THE RM2K3 PLUGIN SDK +++

Posts

author=bulmabriefs144
So it's by number rather than name? Yea, I've started to figure out how to post them.

As in, on the ini, under TrophySort do I put "Starting the Quest" or trophy #19275? And do I include secret trophies on both lists?

Also, can I omit Score Tables/ Max Scores? I don't care about rankings.
I do, however care if it shows the default trophies, if I leave it blank. I want just a trophy for some, and I'm worried the thing will glitch ("file not found" type error).

ALSO, can you explain what themes does visually?

Yes. It's by trophy ID. It's all in the readme...

TrophySort=12345,12346,12347,12348, etc.
TrophySecret=12345,12347
DisableLeaderboards=true

Is this what you're talking about for the third thing?
HideSecretTrophies=true

That will not show secret trophies at all, as opposed to obfuscating the descriptions and icon with question marks. There are no default trophies. Trophies are trophies, and you define the sort order, and which ones are secret. You won't get a file not found error. If you are missing a trophy image (ex: trophy_12345.png) in your Pictures directory, it simply won't show a picture at all.

For themes... let's see...
"Jams" is the blue/pink from this: http://jams.gamejolt.com/
"Fireside" is the pale orange/blue from this: http://fireside.gamejolt.com/
"Fire" is a red/orange theme
"Water" is a dark blue theme
"Earth" is a green/brown theme
"Ice" is a pink theme
"Honey" is a yellow/gold theme
"SNES" is the purple SNES colors
"GBOY" is the green original Gameboy screen colors.

At some point I'll make an image of all of them... but I'm lazy.
Nah I'm talking about the picture on the left. <---

I wanna just have the notice and the gold, bronze, silver, or platinum trophy. And ignore the side picture (all my pictures were full-size until GameJolt shrunk to 75x75) so it's basically text and trophy.

In any case, I'm having trouble with sound effects (it started with the occasional SE in battle, now the disharmony won't seem to play voices. Urgh... I don't know how to fix sound problems) so right now this might be too much of a distraction.
I thought about including that option, but decided that if you want trophies, you must have an image for each of your trophies. I want to keep this plugin standardized.

Don't worry about the 75x75 size that GameJolt wants. Make your trophy images 32x32, and as long as they are 256 colors, "trophy_12345.png" and in your pictures directory, they will display. Then you can just upload the 32x32 images to GameJolt.
Ummmm, I don't think you understand. Most of these files were 320x240 screenshots. As in, pictures. GameJolt has a resize function so converting them there to 75x75 was not, as you said, a hardship. Full-sized picture into a trophy? No sweat. On the other hand, 32x32 with most methods I personally try leaves a blob of color, or I have to crop stuff I don't wanna crop (that's a 2x2 square of sprites, using my actual picture though, that's a 1/10 by 1/7.5 or so reduction/crop).

Please please please allow it to be flexible. I know you want standardized for your game, but I'm not you. I have 27 trophies, many of which the actual picture I used was "borrowed" from the internet (my bounty hunt completed picture was Han Solo in a room with his kills mounted on a wall). At the very least allow it to default to trophy_blank and have a blank 32x32 image as a placeholder. If I later want to make 32x32 images, I can, but if I have to do it all at once or ERROR, then I would not use this at all. I usually do projects piecemeal, adding stuff later. Having a default image is no big deal for you, and it crash-protects anyone who has a missing picture. They have the time to figure out which ones are missing versus it crashing individually, and having to repair one only to have ALSO MISSING error, when maybe 15 or so pictures are there but wrong format or wrong size, or missing.

Also, having this buys me time to work at these a few at a time, leaving out the ones that would just be some generic trophy anyway.

This may help.

http://www.pic2icon.com/format_conversion.php

But still.
It sounds like you don't understand how to properly crop an image... how you create your trophy images is your problem. I've given you the guidelines and don't care how many achievements you decided to add in a day. You don't have to make the trophy image in your game match the one on the website, but I recommend doing so since it would look nicest. Again, the image guidelines were in the readme dude...

...and no I will not make the use of trophy images flexible. This plugin is designed to be like a Steam or Google Play type of thing. Those API's have similar guidelines for developers.
Thanks for the DynRPG upgrade! :D I'm hoping I can figure out a way to change the monster types at the start of a battle using it, instead of the hacky transforming method I'm currently using that requires every battle to start with a "Back Attack".
I don't want to crop the image. If the whole image is what I want, the only reason to crop is to highlight a specific part of it. By "flexible" I mean, "omittable" not changing the guidelines. I'm not sure we understand each other.


(Level 99 Trophy)

This. I want it 32 x 32. Or I don't want it. Because it's so beautiful I had to use it for the Level Up trophy as well as for my game clock.

So I'd want:

(Blank picture, on left)
Title, middle
Description, middle below title
Points, on right
Trophy, on right

As in, I want to be able to set up the system now. Then I want to make/crop the pictures and add them in. Is the only way this gonna happen by making a bunch of identical transparent pictures, and naming them trophy 18275 or whatever? Because that's stupid.

Anyway, it's moot, because most of what I'm doing right now is removing Disharmony and restoring my original method for voice acting. I will not be setting this up today unless I have a huge amount of time.
Learn Photoshop.

Edit: And write your own damn Achievement plugin
I've decided not to use this anyway. It's a pain to login, and I'm learning how to do file processes. I have decided instead that if I want trophies, I can make a trophy screen extras. I'm also going to try to store them externally in a file, and search for those that have been unlocked (appending strings to a file, then searching the file for strings).

It'll probably be inefficient, but given that my FileControl plugin can basically create a limitless number of text files (I'm still working out how to append, though, so they literally have like one line of string ^_^;), I can basically check to see it X file is there, and if it has the code I want. If it does, turn on the trophy because it's been unlocked.
Well done for v30 ! :) Thank you.


Sorry to ask again, but is there anyone that can help ?

author=AlexRE
I wonder whether it exists a DynRPG plug-in that can manipulate Faceset from a specific hero.

I just want to display the Faceset of all the 4 heroes of the team, but as the game contains more than 130 heroes, it can be complicated without a plug-in. (I thought the only parameter could be the variable with the hero number, and then use the image like we would do it with "Show Picture"/"Move Picture" commands.)


Long story short : I want something like "Show Picture" but the picture would be the faceset of a hero. The plug-in would just need the hero ID.


I think I may program this myself, but I have no idea where to begin, which Class to use (Picture ? Image ? Canvas ?). If you can just indicate me some tips, I would be very grateful !
author=AlexRE
Sorry to ask again, but is there anyone that can help ?
Hey! I don't have the time to do it for you, but maybe i can help you a little.

author=Me
The Actor class has the information, which faceset is selected.
// This gets you Hero 1.
RPG::Actor *actPtr = RPG::actors;
// Get the filename of the used faceset
std::string facesetFile = actPtr->getFacesetFilename();
// Get which of the 4x4 facesets is used. The id should be 0 to 15, or 1 to 16, i don't know, Try it!
int faceUsed = actPtr->getFacesetId();

// You can check which Actors are in the party by using
for(int i=0;i<4;i++) // check all party slots for actor
{
RPG::Actor *actPtr = RPG::Actor::partyMember(i);
if(actPtr != NULL)
{
// Act with Actors!
}
}

// Loading an image works like this:
RPG::Image *imgPtr= RPG::Image::create();
imgPtr->useMaskColor = true;
imgPtr->loadFromFile(facesetFile , false);

// Don't forget to kill the images later
RPG::Image::destroy( imgPtr);

// And this is how you draw. Draws an RPG::Image or a part of it onto the canvas.
RPG::Screen::canvas->draw(int x, int y, RPG::Image *image, int srcX=0, int srcY=0, int srcWidth=-1, int srcHeight=-1)

// Fetch variables by using
int variableValue = RPG::variables;

What you need to do is build the logic when it is shown and where. For beginners. Use a switch and in the onFrame-Callback, check if the scene is map and the switch is on and then draw the faces of all heros where you want them. And please don't load and kill images on every frame.

Fantastic ! Thank you, I will try this real soon. :)

I think using onComment with parameters HeroID, XImage, YImage will be enough for me !

I guess, in order to display just one face out of the 16 on the faceset, I have to deal with the 4 last parameters of canvas->draw ?
Try it. You can PM me if you encounter problems.
author=AlexRE
I guess, in order to display just one face out of the 16 on the faceset, I have to deal with the 4 last parameters of canvas->draw ?

Yes!
This is where I am currently :
author=Me
int heroId = (int)parsedData->parameters[0].number;
int xDestination = (int)parsedData->parameters[1].number;
int yDestination = (int)parsedData->parameters[2].number;

std::string facesetFile = RPG::dbActors[heroId]->facesetFilename;

int faceUsed = RPG::dbActors[heroId]->facesetId;

int xFace = (faceUsed%4)*48;
int yface = floor(faceUsed/4)*48;

RPG::Image *imgPtr= RPG::Image::create();
imgPtr->useMaskColor = true;
imgPtr->loadFromFile(facesetFile , false);

RPG::Screen::canvas->draw(xDestination, yDestination, imgPtr, xFace, yface, 48, 48);

(Inside an onComment function, I don't show everything here.)

I now have to learn how to create a DLL file, haha ! *noob*
If that is all your code, you seem to misunderstand, how drawing an image works. RPG::Screen::canvas->draw is not like the show picture command. It draws the image on screen, exactly once. You need to do that on every frame if you want it to be visible all the time.
Oh, damn. This is obvious now that you say it... I need to use the onFrame-Callback then ? I'm going to look into other plug-ins' cpp files.
Haha! It's all part of the learning experience, keep going and you will be the best pokemon-trai~ errr programmer some day ;-)
I've been meaning to reply to that post! I wrote a little plugin similar to that a while ago, but it just changes the faceset command to a hero in your party, and inserts their name into a message box. Below, I explain how to basically do that, but inserting the image into a picture command instead.

A couple other notes:

Yes, RPG::Screen::canvas->draw needs to be onFrame, unless you're piggy-backing another event command (explained below)...

Also, it might be RPG::screen->canvas->... instead.

You could also take advantage of onComment's "nextScriptLine," so you could do something like throw in a comment command before a show picture command, check to make sure it is a show picture command, then alter its stringParameter to the filename of your choosing. But... since we're dealing with facesets, it's a little more tricky. You would sill need getFacesetId() to find out which face to use in a particular faceset, and then use that to crop the image. Since you're injecting the image into a show picture, you'd need to do the following:

RPG::Image *imgPtr= RPG::Image::create();
imgPtr->useMaskColor = true;
imgPtr->loadFromFile(facesetFile , false);
RPG::pictures[nextScriptLine->parameters(0)]->image->clear(); // may or may not need this
RPG::pictures[nextScriptLine->parameters(0)]->image->draw(0, 0, imgPtr, srcX, srcY, 48, 48, false);
RPG::pictures[nextScriptLine->parameters(0)]->image2->draw(0, 0, imgPtr, srcX, srcY, 48, 48, false);
RPG::pictures[nextScriptLine->parameters(0)]->image->applyPalette();
RPG::pictures[nextScriptLine->parameters(0)]->image2->applyPalette();
RPG::Image::destroy( imgPtr);

Try commenting out the image2 line too. You might not need that.

nextScriptLine->parameters(0) should be the ID of the picture.

...image->applyPalette() is necessary because you're copying one image into another.

You'll need srcX and srcY before that as well, but I can't remember off the top of my head how to get the row/column. I think row is just modulus:
srcX = (faceUsed % 4)*48;

and then I think srcY needs to be a bitwise "AND"
srcY = (faceUsed & 4)*48;

Put those before the image stuff. The operations inside the parentheses gets 0-3, and then you need to multiply that by 48 since you're dealing with pixels.

If you do this right, you can still use pictures instead of needing to draw onFrame.

Another practice you might want to get used to is safeguarding your Image creation, especially if you are not destroying the image right away. It's pretty simple:
if (!imgPtr) { // make sure the image doesn't exist
RPG::Image *imgPtr= RPG::Image::create();
imgPtr->useMaskColor = true;
imgPtr->loadFromFile(facesetFile , false);
}

Otherwise, if that is called a second time while the image already exists, you'll get a nice little crash. Additionally, when you are drawing Images onFrame, you'll want to do the same thing, but checking to make sure the image exists:

if (imgPtr) RPG::Screen::canvas->draw(x, x, imgPtr, 0, 0, width, height); // make sure the image exists first
Changing the picture is a very good idea, tough i would use a 48x48 placeholder in ShowPicture and draw the face on that using onComment. Using the nextScriptLine seems more complicated than necessary.

@image1&Image2: Picture->merge() combines them. Use that, ignore Image 2.
Yeah, it becomes a matter of "do I want to define the picture ID as a parameter, or use the show image?" I don't think you need the merge() though, because pictures should do that automatically... which reminds me... instead of drawing to "image", I think you can just draw to "image2." You may not even need applyPalette() because of that... Play around with it if you want. I'll try to confirm that stuff when I'm at my home computer.

Another tip for dealing with images: You'll notice there's both "clear()" and free()." Never use those functions back-to-back. It might appear to work, but I guarantee it will crash if you try to redraw to that image. When I was fucking around with all of the image creation functions (not understanding them fully), I tried this and saw some strange behavior. Sometimes it would crash with a memory error, other times I got a divide by zero error (probably because the image's size was 0). 9 times out of 10, you'll just need clear().