RM2K3- ACTIVE ENCOUNTERS USING RANDOM GROUPS STORED IN A VARIABLE
Posts
Pages:
1
Alright, I've been able to do the actual active enemy thing. That on its own with one Monster Group works fine; however, I'd figure it'd be nice to save time if I could use a variable to store a multiple number of monster group ID in that it could randomly choose between. I'd like it to be based on the map terrain the player is currently walking on, which would obviously need another variable. I can't seem to make the event initiate correctly; it gives a black screen and says it can't find the mosnter group. I put it in the Common Event section since I want to call on both of these every time I generate an enemy on the map. Here's the code that generates the active encounters:
Here is the code for determining the Terriain and making the encounters. This could probably use more work; I'm more familar with GameMaker which uses a totally different type of coding-- so I tried to model it based on how I would do it that way. Basically I want it to choose between X number of things, this stored in a varaible and at random. I know there is a better way to do this; I'm still figring it out. I'm probably missing something stupid and obvious.
Memorize Location: Map_Pos, X_Pos, Y_Pos
Switch Op. Encounter ON'
Call Event: The One Below that chooses for us
Enemy Encounter: Normal, with Monster ID Stored in Variable Encounter Type
Jump to Label 1
Else
End
Recall to Location: Map_Pos, X_Pos, Y_Pos
End Event Processing
Here is the code for determining the Terriain and making the encounters. This could probably use more work; I'm more familar with GameMaker which uses a totally different type of coding-- so I tried to model it based on how I would do it that way. Basically I want it to choose between X number of things, this stored in a varaible and at random. I know there is a better way to do this; I'm still figring it out. I'm probably missing something stupid and obvious.
Store Terrain ID: CharX, CharY (Probably gonna change these), Terrain ID
Branch if Var Encounter_Type is 1
Enemy Encounter: Normal, GroupName
Else Handler
if Branch Encounter_Type is 2
Enemy Encounter: Normal, GroupName2
Else
//Same until we get to 4
End Event Processing
End
End Event Processing
End //Repeat 4 times
If you group your enemy groups together (that is, say one batch is your first terrain set - from Database # 25-40) you can then randomly generate a number from 25-40 via variable, then use that variable in the enemy encounter command to pick which encounter to call.
Easy enough~
Easy enough~
Okay, now I figured out how to make a type of quest and almost have a chest going. I need help in making an Inventory type system that the system can access upon dying. I have the variables; I just know I'm missing a key part that is putting them together. I have it put in the Common Event system as Inventory, and it will be called upon when the character gets an item and later when they die. I want to so that it can keep track of all items that the player has currently. The problem I'm having however is trying to do the same 'take the numbers from the database and put them in a variable' thing like before. That and I need to have the Inventory know what items are what and how many. I guess I need more than one variable for this, but I have no idea. I tried setting it to a number; but I don't want it to be random and I can't figure out how to just set the variable to whatever I need while still referencing it. This also plagues my chest problem; it executes the events but doesn't give a random item.
Here's the chest code (I would not know where exactly to start for an inventory; though I have a couple of ideas.)
Rest is basic 'chest is empty' stuff. Thanks in advance for the help!
Also, I have the thing installed for rpg2003 to change fonts and I have put them in the system folder but they don't show up as choices; I have a feeling I'm not using the right type or maybe location, though I tried several different font types to be safe.
Here's the chest code (I would not know where exactly to start for an inventory; though I have a couple of ideas.)
Switch closed is on
variable give item is set to random 1 to 7
branch is switch closed is on
change items; type set in give item; amount set in item
display message: you found \v(item)!
jump to 1
label 1
switch closed is off
switch open is on
Rest is basic 'chest is empty' stuff. Thanks in advance for the help!
Also, I have the thing installed for rpg2003 to change fonts and I have put them in the system folder but they don't show up as choices; I have a feeling I'm not using the right type or maybe location, though I tried several different font types to be safe.
Wait, let me get this clear.
You want to track the amount of items you have on you at all times, basically? I assume this is so that when a game over triggers you, instead of getting a game over, have another event occur instead? It should automatically keep your current items on your person in that case.
Despite that, there's a very, very easy way to keep track of item amounts.
You'll need one variable per item slot. Then you'll set the various variables to:
SET EQUAL > Item > Name of item > Number Held
It really is that easy. Later on, when you need to do something with the variable:
ITEM MANAGEMENT: Add item > Specific Item > Amount Stored In > the variable in which the amount for that variable is stored.
You want to track the amount of items you have on you at all times, basically? I assume this is so that when a game over triggers you, instead of getting a game over, have another event occur instead? It should automatically keep your current items on your person in that case.
Despite that, there's a very, very easy way to keep track of item amounts.
You'll need one variable per item slot. Then you'll set the various variables to:
SET EQUAL > Item > Name of item > Number Held
It really is that easy. Later on, when you need to do something with the variable:
ITEM MANAGEMENT: Add item > Specific Item > Amount Stored In > the variable in which the amount for that variable is stored.
Yes, basically. I want to have rougelite(?) system where the player loses most items aside from key ones that are for story progression upon death. Thanks a bunch for this; I hope I don't seem like a pain...I usually try to figure things out on my own before asking for help, bu this one left me stooped. I might have one more question later, but I'll deal with that after I've made some progress in coding the actual thing.
Okay, didn't want to waste people's time with this but I can't get it working on my own despite changing it several times. I want the battle music to change randomly; doing image links to the code doesn't work well for me so I'll just type it out again. It either doesn't play at all or changes randomly in battle every five seconds.
[b]Active Encounters w/ Music code[/b]
//same as before
memorize bgm //field music
if switch encoutner is on
switch b_musicplay is on
call event playbmusic //in case it doesn't call in m-group
//win battle stuff
label 1
switch b-Musicplay off
switch encounter off
end event processing
[b]Battle Music Call[/b]
Set B_Music1 to Rand 1-3
if Switch B_MusicPLay is on
if variable B_Music - 1
play msuciA
//repeat until 3
else handler
jump to label 1
play memorized bgm
end event processing
[b]Monster G. Triggers[/b]
Trigger: If Switch B_MsuicPlay is ON
Call Common Event Battle Music
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Just one song per battle, right? Don't use battle events at all for that. You want an event outside of battle to change the system bgm for battles. This could easily be done in your event that triggers encounter. Don't make a loop for it or anything, just pick a random number between 1 and 10, and have 10 conditional branches that each set a song based on what the nunber was.
Welp, I was using play_bgm instead of change system bgm. Shows how much I know.
I think I only have a couple more things that I can't figure out then I'll just post a test room so I can show you guys what I have so far.
Alright, for this I want the player to become invincible after they have touched the enemy on the screen to prevent constant battle collisions. Here I'm assuming the timer system is similar to Game Maker's alarms in order to do this. It makes the player invisible and then gives them a few seconds before they can be encountered again; however the sprite stays invisible and doesn't change back, plus enemies can still encounter you even if you are supposedly invisible. There might be problems as I'm trying to type this up as smoothly as it comes up in the editor.
Another thing is trying to make enemies resistant or weak to certain types of attacks. I know it can be done through the attribute menu, but I'm not 100% sure that it's doing what I want with it. I've read the help file and it says that putting it 200% on certain points will do double damage, etc. What I want it to do is that if I set it to like...50% or whatever, I want to make sure the damage would be less than the full amount if it was set at 100%. (I'm probably not wording this right.) If it helps, think of SMT's Null/Drain/Repel system; Null makes it ineffective, Drain converts it to HP and Repel sends it back to player. I put it as a common event to make things easier, maybe:
I think I only have a couple more things that I can't figure out then I'll just post a test room so I can show you guys what I have so far.
Alright, for this I want the player to become invincible after they have touched the enemy on the screen to prevent constant battle collisions. Here I'm assuming the timer system is similar to Game Maker's alarms in order to do this. It makes the player invisible and then gives them a few seconds before they can be encountered again; however the sprite stays invisible and doesn't change back, plus enemies can still encounter you even if you are supposedly invisible. There might be problems as I'm trying to type this up as smoothly as it comes up in the editor.
if invis=1 (in active encounters event)
{sprite+transparent
timer set: 12s
timer start}
else
if timer <=00s
{if invis=1
{set invis to 0
jump to label 1}
}
end
label 1
if invis-0
{transparency=opaque
timer 1 set= 12s
jump to label 2}
end
end
label 2
end event processing
Another thing is trying to make enemies resistant or weak to certain types of attacks. I know it can be done through the attribute menu, but I'm not 100% sure that it's doing what I want with it. I've read the help file and it says that putting it 200% on certain points will do double damage, etc. What I want it to do is that if I set it to like...50% or whatever, I want to make sure the damage would be less than the full amount if it was set at 100%. (I'm probably not wording this right.) If it helps, think of SMT's Null/Drain/Repel system; Null makes it ineffective, Drain converts it to HP and Repel sends it back to player. I put it as a common event to make things easier, maybe:
if Target=Enemy
{
if Weakness=1
{Damage=x2}
else
(Damage=x1)
end
else
if Resistance=1
{Damage=x.5}
else
(Damage=x1)
Pages:
1














