Charas-Project

Game Creation => Requests => RPG Maker Programming => Topic started by: evmaster on February 03, 2010, 10:11:31 PM

Title: A bunch of questions
Post by: evmaster on February 03, 2010, 10:11:31 PM
A bank?

When a button is pressed it does a specific funtion?

The ability to change faceset during battle when the character's life is getting low?

A righ or left hand game and non repeating?

To make events not repeat over and over again?

Weather effects; Lighting, raining, sandstorm etc

Is frequency how much the sprite's animation changes, and Speed for how fast it moves?

How would switches and variables work on an event itself placed on the map?

To make monsters appear differently as to where you are on one huge map?

Also, what came first, rpgkr 2003 or XP?
Title: Re: A bunch of questions
Post by: Prpl_Mage on February 04, 2010, 11:11:38 PM
1A bank?
Can be doen quite easily.
Make the player talk to a certian NPC. It will ask if you want to deposit or withdraw.
In the deposit part you'll make one of them "Input numbers" events, store the value in a certain varaible(i'll call it "[DEposit]".
Now set a variable equal to your amount of gold(it's a choice near the bottom)
Check if the value of "[DEposit]" is larger than the ammount of gold you carry.
If it is: tell the player that they are a bunch of leeches that are trying to cheat.
If it is not: add the value of [DEposit] to another variable called "[StoredCA$H]"
And then remove gold equal to the amount of [DEposit].
--------- With this we let the player input a number of the ammount he want to deposit. Then we check if the player actually have that much. If he does then the value is added to the "bank variable" [StoredCA$H"] and at the same time we remove the same amount from the player's pocket.

Now, the withdraw. (it's basically the same thing but in reverse)
The player have a input numbers again to chose how much he want to withdraw. (store it in a variable(you can even use the same as for deposting))
Check if the value the player inserted is higher than the amount of gold stored in "[StoredCA$H]"
If it is higher: Tell them to bugger off.
If it is lower: remove the value of the input on the "bank variable" and then increase gold by the same value.

Quote
When a button is pressed it does a specific funtion?
Key input process. You can choose what buttons the check should react to and then use a parralel process to check the value of the variable you store it in.
The value depends on the button:
Down=1
Left=2
Right=3
Up=4
Action key=5
Cancel key(menu)=6
(you can also use some other buttons like Shift. you'll see it in the key input window)

What you want the button press to do on the other hand is up to you.
Quote
The ability to change faceset during battle when the character's life is getting low?
Well in theory "all" you have to do is to create a common event for all the characters. In the common event you check the heros' hp with a conditional branch. (you'll need a lot of branches here)
In the check that's one of the limits you simply add the command "change faceset: [your faceset]
Just remember to make the common event a parallel process, it should be able to play alongside the battle as well.

Quote
A right or left hand game and non repeating?
Not really sure what you mean here. But I'm gonna guess that it's soemthing like this:
"Old man says: If you want my precious gemstone then you'll have to guess what box it is in! The left one or the right one?" and you let the player choose one.
In that case it's pretty simple. When you speak to the man: set a variable to "A random number between 1 and 2"
In the event for the "left box" you check if the variable is 1. in the box on the right you check for the value 2.
If the checks are right: you get your item.
If the checks are wrong: they blow up in your face.
In other words: variable becomes either 1 or 2.
The 1 represents the "left" and 2 the "right"

And to not make this happen again: add another page in the event that's NOT the entire game thingy. And give it a precondition. RPGM2k3 have priority on preconditions. So the second page of the old man have the precondition" precious gem: in possesion" and the message eh gives you is "drats,. ye won me gem."
OR soemthing along the line.

Quote
To make events not repeat over and over again?
Add a check in the beginning of the event OR add another Event page with a precondition.
With the conditional branch that checks for something you can allow that part of the event only to be played it the condition is true. For example. You have a villain that you have to fight. The shopkeeper only sells **** before you fight the boss but afterwards he got gold and mythril. In the shopkeeper's event you can add a conditional branch at the top with the check "Switch: badguydefeated" is ON.
if it is true: (open shop window with awesome stuff)
If it is false:(open shop window with awful stuff)
------- This way the whole "mythril inventory" stuff will only happen when the switch is on. If it isn't - he will sell ****.

And then. You have a villain battle. You enter his throne room and the whole monologue thingy plays. Then the battle starts and you defeat him. After you defeat him he throws a smokescreen and disappears. You are free to move as you want and even inspect his throne to find a Healing card.
BUT WAIT! If you re-enter the throne room the whole "fight the villain" will happen again.
That's why we'll use a second event page. The event that started all the talking and **** is an "Auto-start" in the "trigger condition" - in other words. it started itself. OR when you walked up to the villain and spoke to him.
EITHER WAY:
you create a second event page. And this time you'll add a precondition to it. And the precondition is that the switch "badguydefeated" is ON.
This page is completely blank. No events, nothing. (Don't make this page an auto-start)
And in the event that triggered the batlle we simply add the "Switch :badguydefeated turn ON" in the end.

And while we're at it we can go through the last kind of anti-repeat.
I mentioned that you can grab a heal card from the throne? Well. On the throne event, add a second page that has the precondition "Heal card: possesed" and the message "Nothing left here but the odour of an evil villain".

And with all that we have a shopkeeper that will only sell good things after the battle and a battle that will only occur if you haven't fought him before as well as a hidden heal card that won't be found again if you already have it.

Quote
Weather effects; Lighting, raining, sandstorm etc
Rain and sandsorms are available in the "Weather condition" event on page 2.
For the lighting though you'll probably want the "heavy rain" and then have a parallel process randomly "flash Screen" in a nice thunder like colour.

Quote
Is frequency how much the sprite's animation changes, and Speed for how fast it moves?
The frequency is how fast the sprite's animations "roll" and the speed is how fast it moves. correct.

Quote
How would switches and variables work on an event itself placed on the map?
Not sure what you mean here. But the variables and switches are all global in RPGM2k3. They are not limited to one event(individual) like game maker.

Quote
To make monsters appear differently as to where you are on one huge map?
You mean that they walk around on the screen instead of random encounters? You create an event, give it the graphic of a monster, make it follow the here or any other custom pattern you want. And then the trigger should be "collision with hero" and the event itself is "Enemy encounter" and an "Erase event" in the end. This way you will fight a certain monster group when touching the event"monster" and after defeating or running from it - it will disappear.
If you want these encounters to be random as well you can give a variable a random value and have a conditional branch check it. so if the random value of the variable is 1. you'll fight goblins x 3, if it is 2 then oyu'll fight one behemoth and if it's 3 you'll fight quite pink squirrels.

Quote
Also, what came first, rpgkr 2003 or XP?
in order of appearance:
Rpgm 2000
Rpgm 2003
Rpgm XP
Rpgm VX

2003 is basically 200 but better, uses the same RTP and all.
XP uses RUBY, a scripting language instead of the whole event thingies 2k and 2k3 got. (also the graphics look odd) It's more flexible but harder to use. And there's no battle chars if i remember it right.
VX on the other hand brought back some 2k3 features but appears to look horrible.

I'm still using RPGm2k3 even after the 7 years it's been around. It's a pretty great engien that offers most things you can ask for.


Anyway. I hope I managed to help you a little at least.
Title: Re: A bunch of questions
Post by: evmaster on February 07, 2010, 07:13:52 PM
wow, your replies are awesome. Thanks! =D
Title: Re: A bunch of questions
Post by: evmaster on February 09, 2010, 05:56:16 PM
whats a paranama
Title: Re: A bunch of questions
Post by: Prpl_Mage on February 09, 2010, 10:31:37 PM
whats a paranama

A Panorama is another phrase for "Parallax-background.

To make this "simple" let's picture what you see when playing as a cake with layers.

At the top we have pictures.
Under the pictures we have events.
Then we have the Upper layer objects
And the tiles(chipset).
But underneath the tiles we have Paralax-backgrounds.

I bet you've noticed that the background of all the upper layer stuff is pink in the RTP?
That's because it's the transparent colour of that chipset.
If you use the same pink tile(I believe it's in the lower-right corner of the tile layer) then you will have "nothing-black" when you test play the game.

But if you right click your map, and go to properties then you will find a part that's about paralax backgrounds. The RTP gives you a couple of clouds and stuff.
Basically, say you want a sky city? You create your city and then use that pink tile here and there. Then you choose a fitting background(panorama) and you might even want it to scroll to the left.
When you test-play the game you will see the result.

Best way to figure it out though is by doing it. Give it a try, it's pretty fun.
Title: Re: A bunch of questions
Post by: evmaster on February 10, 2010, 05:11:11 PM
Okay, I thought of more tutorials I would like

---------------------

I remeber seeing a tut for rm2k3 for two players, i actually did it before, you just have to follow instructions and picutres do help a lot, but im literate so, yeah

I remember also seeing one for making npcs at some point get annoyed of you talking to them, I think i know how to make them say random things already, just not til the point they're annoyed

Edit: Okay, Im having trouble with this. Im trying to make it where the npc monster sprite move towards the hero and when they touch each other, a battle starts, and with a variable its gonna decide which battle set of monsters to fight. Cept they havent moved toward the hero. And im trying to also make them move away if the hero is too low leveled. Seems like the only branch for "IF HERO IS LV" is only for level up or higher, and no choices for less. So if Hero is level 5 or higher, would it make the monster move toward the hero if Hero is lv 1 or if Hero lv 6? My brain just can't seem to process that. Also, what is modulos in the varaible

(http://img641.imageshack.us/img641/8311/prntscrn.jpg)

I've tried a lot of different ways to get it to work, mainly working with variables, trigger condition, preconditions and branching. Oh, whats the difference between collision and Touched by Hero? Does Touched by hero mean the hero has to touch it?


Also, could anyone please explain what the functions of variables could be used for? I've used it before to make npcs say random things, show how many times the player lost, won, fled, and for amount of current money to be shown. I mean, how does range and reference work?

(http://img641.imageshack.us/img641/1365/varaibleoperations.jpg)

EDIT: Oh yeah, a simple tut for a lotter 777 type system would be nice too. I followed a tut before and did it, but that was long ago.



Title: Re: A bunch of questions
Post by: Prpl_Mage on February 10, 2010, 08:12:37 PM

Monster event movement

About the "monster move Towards/away from hero.

The way you've done it is that "Once the monster collide with the hero" the event checks the level and THEN makes the monster event move towards the hero OR away from it. But it's a little late for that since the next part of the event makes a battle start.
What you need to do is that you define a movement pattern under "Movement type, define pattern" this will affect how the monster event move - anytime.


And the solution to the whole level thing?
Create different pages

Pages can give events different "properties" like graphis, movement speed, collision or touched by and all that.So this is what we'll do. We'll create pages of you're MUK so that he sometimes have a movement pattern where he attacks and one where he flees.

As the precondition -  have it check a variable.
Have a common event somewhere set that variable EQUAL to Hero1's level. In other words: RTP ZACK.
___
The common event pretty much just need to look like this:
CHECK Party level. Parallel process.
<>variable operation: VAR[partylevel] set equal to: [Hero001] level.

And that's it.
If you really want THE level of the party then you need to add together the levels of all members in the party and then divide it by the ammount of people that are in the party.
4 lvl 50 people would have the party level of 50. 50+50+50+50 = 200. And they are 4 people so it goes down to 50 again.
But if you have a lvl 74, 34 and 12 the party level will become 40. It's like a middle value. There is a name for this but English math-thingies just aren't my thing.
_______
BACK ON TRACK!

So these event pages then. Let's say that each monster have 3 pages. First page is the basic page, no preconditions at all, in the movement pattern you can have something like"random,random,random,random,face hero, move to hero,move to hero, move to hero, move away from hero.
He will move about, minding his own business and then he will look at the hero and move in his direction, then loop the whole thing.

The second page is the mad page. In other words - you put a precondition that checks if the variable for party level is "equal to or lower than" let's say : 15.
So if the hero is below 15(or equal to it) this monster page will be the one used.
In the movement thingy you can basically place something along the line: face hero, move forwards, move forwards, face hero, move forward, random, move to hero, move to hero, move to hero, move to hero. AAAAAAAAAND loop.
So if the hero is lower than 15 this monster will look at you, move where you stood as he looked at you and then move directly at you. Kinda more aggressive and still not impossible. If you want impossible then you can do that or create a forth page that always moves towards the player if he is below 5.

And the third page will be the coward page. You have the precondition : partylevelvariable is higher than or equal to 35.
Then in the movement type - pattern thingy you can add something like. random,random,random, face hero, move away from hero, move away from hero, move away from hero.
So if the partylevel variable is higher than 35 then this page will make the monster event move about and then look at the hero and run like a japanese school girl.

And that should solve it.


-----------------------------------
Touched by hero and collision with hero
Touched by hero means that the monster NPC can pretty much breathe in your face, hug your arm and snake around you and the event will still not start. It will only start when you - the player move into it.
So all things that moves to you should have collision. Things like traps or cutscenes really doesn't need it.


---------------------------------
Two unidentified variable options
Anyway, the two mystery "Variable choice" means this:
Variable range.
Say you have 5 mini game monsters on the map.
Their hp is stored in: "Var0034: [mon1hp]", "Var0035: [mon2hp]", "Var0036:[mon3hp]", "Var0037:[mon4hp]", "Var0038:[mon5hp]"
So instead of making 5 different variable operations that each sets the variable equal to 50 we chose "Variable range.
The first number we put in is "34" and the second one is "37" this means that variable #34 > 37 are the variables affected. So you create the event, the variable operation 34>37 are set equal to 50.

Then we have the Variable reference, a bit tricky to understand. And I still haven't figured out any useful way of using it.
The variable reference checks the value of the selected variable.
Say you have a variable equal to battles fought and you've fought 15 times. When you use that variable as a reference it will have the value:15. And what that does is that the variable affected in the variable operations is variable number 15. If you've fought 35 battles though (the value is 35) then the affected variable will be variable number 35. So yeah. Pretty useless.


---------------

I hope it didn't get too messy.


EDIT:
Seems like I overlooked some questions.

Dundumdudnum

Two player mode:
 no idea.

But in theory, all you have to do is to move an event depending on the value of a variable.
And then have a parralel process -  key input process that stores the value in that there variable.
So if you press a certain button that you choose is the button for up, the event will recognize the value and move up.

As I said, no idea. I don't really see the point in doing it though.
---------------------
Multiple talks to NPC gets on their nerves

Making NPCs finally lose it to your endless ramblings is pretty easy actually.
To make it easy - create a new event page for the NPC. Have the precondition be VAR:"Herotalkstoomuch" is larger than or equal to:(20 or something high enough).
Then add the whole message of the NPC telling you to sod of before he shows you how true smiths use their tools on spoiled brats who think they can save the world.
Then reset the variable.

On the "normal" page of the NPC on the other hand you add the "VAR:herotalkestoomuch add 1" in the end.
So everytime you speak to him the variable will go up by 1 every talk. In other words- once you've talked to him 20 times the variable will have the right value, page 2 will be activated when you speak to him and he will tell you to burn in a painful fire of beaver.

-----------
Modulus
I think I saw something about the "modulus" command earlier? not sure. Gonna explain it either way.
RPGM cannot store decimals. so dividing 14 by 3 will give you the value "4" instead of "4,66666666666666666666667".
But when you use modolus you DON'T save the value before the whole "," mark - instead you store the numbers that are decimals.
So if you have one variable operation divide 14 by 3 it will get the value 4.
If you have the variable operation modulus 14 by 3 it will get the value 66666666666666666666666666667.

--------------------
Lottery
And as for the lottery.
I can think of an easy way - actually 2 different easy ways depending on what you're actually looking for.

VERSION 1:
--------------
The hero decides his own numbers with the "input numbers" thingy and you store it in a variable called something like "playerlotterynumber"

Next you want the whole "drawing" to be made.
You have 3 different variables for this.
The first variable is set randomly between 1 and 9.
The second is set randomly between 1 and 9.
Then you multiply it by 10.
The third is set randomly between 1 and 9.
Then you multiply it by 100.
Afterwards you add all these three variables into the variable "lotterynumber".

You have a conditional branch check if the two variables: "playerlotterynumber" and "lotterynumbers" are equal to each other and then you add the whole prices and shizzle if it is true(good luck with that though).
--- So, what exactly happened there?
Well, you add your own number, that's what you're bet is on.
Next we have 3 different variables randomly get the values 1-9.
But adding together those would give us something like "12 or 24" and that's hardly a lottery number.
So on the second variable we multiply it by 10 so it becomes the "second number" of the lottery number and then we multiply variable3 by 100 so it becomes the first number. When we add together it then each number will be dependent only on their own randomizes.
OF COURSE, you can simply have just one variable called "lotterynumber" and set it randomly between 1 and 999" but then you could get 0's

What I wrote might just make sense.

SECOND VERSION:
-----------------------

Instead of choosing your own number the game gives you a number in the same way as they generate their own number. In other words: 3 variables, randomize, 1 of them times 10, and one of them times 100, put them together.

The cons: more variables. Sure you can make this version simply by having the game give 2 variables a random number between 1 and 999 and then compare it.
________________
<>VAR OP: VAR[playerlotterynumber] set random 1 - 999.
<>VAR OP: VAR[lotterynumber] set random 1 - 999.
<>COND BRANCH: IF [playerlotterynumber] = [lotterynumber]
YES
 <> message: OMFG BBQ! You won m8! Get this ca$h yo!
 <> add gold: 10000
NO
  <> message: yet another loss, thanks for playing
_____________
But that's just not as much fun.

Pros:
You can actually make this more interesting.
Instead of checking the whole number you can compare the player's first variable with the lottery's first number and so on with all three variables and then give a prize if either of them match, if two match and if all 3 match.
kinda like this:
_____________
COND BRANCH: [Playlottnum1] =[lottnum1]
 <> VAR OPS: [matches] add 1.
COND BRANCH: [Playlottnum2] =[lottnum2]
 <> VAR OPS: [matches] add 1.
COND BRANCH: [Playlottnum3] =[lottnum3]
 <> VAR OPS: [matches] add 1.
COND BRANCH: [matches] >=[3]
 <> Message: HOLY COWS!!! congratulations! All three of your numbers matched!, please accept this grand prize that only one blessed by lady luck can win!
 <> Add item: awesomesauce
COND BRANCH: [matches] >=[2]
 <> Message: congratulations! two of your numbers matched!, please accept this fabulous prize!
 <> add item : fabulous prize
COND BRANCH: [matches] >=[1]
 <> Message: congratulations! one of your numbers matched!, please accept this prize!
 <>add item: silly prize
______________________

So yeah, it's all up to you. How you want it and how much time you want to put on it.

----------------------------------------------

Well, even updated I still question if it makes any sense.
But I hope it helps.