-
Content Count
5,629 -
Joined
-
Last visited
-
Days Won
262
Posts posted by Rikifive
-
-
To use the existing format you have, you could alter it like this:
def has_2_cards?(id) actor = $game_actors[$game_variables[27]] amount = 0 for card in actor.deck amount += 1 if card.id == id return true if amount == 2 end return false end
Basically, instead of returning true as soon as desired card is found, I created a local variable and assigned 0 to it. Then, each time the desired card is found, it adds 1 to the variable. Then, as soon as the variable hits 2, it breaks from the loop and returns true, meaning the script call will return true if the actor has at least 2 cards you're checking for.
Alternatively, I'm thinking of using the .count method. I assume "deck" is an array, that consists of skills, given there's checking for .id for each card, which I assume to be an ID of the skill. If I'm guessing correctly, something like this would work too:
def has_2_cards?(id) actor = $game_actors[$game_variables[27]] amount = actor.deck.count($data_skills[id]) return true if amount >= 2 return false end
Going a step further with the alternate method, perhaps a method to count cards would be helpful to you?
def count_cards(id) actor = $game_actors[$game_variables[27]] return actor.deck.count($data_skills[id]) end
This method would count how many cards with specified ID the actor has.
With that, you could for example, put this conditional branch:
page 4: script: count_cards(3) >= 5
and it would be true if the actor (under $game_variables[27]) would have 5 or more cards with ID 3.
-
I'm not sure what's your exact setup, so let me just mention the problem you're facing right there~
The error you're getting is because you're accessing the variable incorrectly.
It's not $gameVariables.value(27), it should be $game_variables[27]
So, the method in red, "value" doesn't exist in $gameVariables, because $gameVariables itself doesn't exist, hence why it says there's no such method in nil (basically "nothing").
Same problem would be with $gameActors.actor(var), it should be $game_actors[var]
The original script call loops (the "for" loop) through all party members and then loops (another "for" loop) through cards in each deck caught by previous loop to see if anyone has the card. If you want to check a single deck, you should remove the first "for" loop and, for example, put an assignment to refer to specific actor.
So, correcting what you already have, it should be something like this~
def has_card_in_deck?(id) actor = $game_actors[$game_variables[27]] for card in actor.deck return true if card.id == id end return false end
Well, that at least should solve the problem you've mentioned here, the one with referring actor via variable. Give it a try and see where it takes you.
Edit: Welp, I see you figured that out. What you came up with is correct, and I believe my post should answer why "for actor" you rightly removed didn't work.
-
Oh it's been years since I played that game and according to Steam, I have almost 500 hours in that game... Makes me wonder what has changed.
I hardly remember how exactly things went there, but I vaguely recall, that I've been waiting until getting stuck. I've been pushing as far as I could and when it was hard to make progress, I ascended - and I recall the start was somewhat slow. Not sure if things look the same now, but I guess that's all I can tell, heh.
I miss these times...
-
1 hour ago, PhoenixSoul said:One note:
If using a script the removes the gold window (Calestian's Currencies is one example), change the following line:
@lim_inv = Window_MenuLimInv.new(@gold_window.width)
to
@lim_inv = Window_MenuLimInv.new(@command_window.width)
and it will no longer have the gold window related crash. Of course, it will no longer be at the bottom, but that can be adjustable.
Speaking of adjustments...
I've managed to figure out how to make the script display float values for the current and max inventory (~nnn.f), but...
<inv_size: n.f> is not working, no matter what I do to the script. Like, sometimes, a smaller than 1.0 value is more accurately reflective, but not 0.0. A small vial of liquid should be represented properly, and this script is not allowing me to do so. Make sense? No? Play TES III: Morrowind for an hour and count how many items weigh less than 1, but more than 0. (that was one example of a game that has such a mechanic-there are many others and it makes sense to me anyway)I assume trying to put a number between 0 - 1 results in the tag not being read at all?
You'll need to adjust the REGEX that looks for the tag~
By default, line #257 contains the REGEX responsible for capturing the tag you've mentioned:
InvSizeREGX = /<inv[\s_]+size\s*:\s*(\d+)>/i
This REGEX requires ONE or more digit after ":" and nothing else. Putting "." results in an unexpected character appearing, so to speak, so it no longer matches.
To fix that, you'll have to adjust it to account the possibility of the "." appearing.
For example, if I'm not mistaking, this REGEX:
InvSizeREGX = /<inv[\s_]+size\s*:\s*(\d+\.?\d*)>/i
should, after ":", expect:
ONE or MORE digits
then, ZERO or ONE " . " making it optional
then, ZERO or MORE digits making it optional
So, both
<inv_size: 4> and <inv_size: 4.5126> would be matching REGEX, thus be valid.
Try changing that line of code to what I suggested and see what happens.
-
1
-
-
Hello, hi and welcome!
-
1
-
-
Yes, yes, now that I checked the script over there, there indeed was the same error in multiple spots. Scripts posted on RMW got their formatting broken during migration to another forum software, if I recall correctly. All scripts turned into super long one liners and it looks like someone overlooked some of the lines when fixing the formatting manually.
You're welcome.
-
Oh sorry, I didn't notice you replied, you should have @mentioned/quoted me
You've got the answer somewhere else, but just to be clear here ~ yes, yes, of course you can, asking for support is definitely the right thing to post on the forums.
-
I think the script formatting is broken, split these two things into separate lines.
It should be
@back1_sprite.z = 0
@back1_sprite.ox = 0
Not in a single line like this:
@back1_sprite.z = 0 @back1_sprite.ox = 0
If the game crashes and points to this line, simply open the script editor and you'll be taken there, then simply press enter between these two variable assignments.
-
That probably had to be a minor derp in your code I assume? Glad you got it working in the end.
9 hours ago, SpuddyGoggles said:To make things clear, I added the def to Window_SaveFile to
(yes i know that editing the default scripts isnt ever a good idea, but ive found that attempting to make my own scripts in main that directly overwrite existing scripts is puzzling and mildly irritating.)
To be honest it depends. It is not a bad idea if you know what you are doing. It's all clearer to work with if you're just modifying the defaults directly, while aliasing/overwritting in new script slots is indeed irritating, because a single thing is all over the place.
I'd say it's not recommended because the majority of RM users don't know how to code and are unable to word their issues precisely. They install a 3rd party script and then be like "help my game crashes" and it's much more confusing to pinpoint the issue if it turns out, that they tinkered with the defaults without telling you that they did so. Having modifications in separate slots makes it easier to eventually undo the changes or adjust something. Should something break, just delete the adjustment and you're back in game, but if the defaults are changed, chances are beginners will get stuck struggling to restore their game to playable state.
Generally, if you're enjoying coding on your own and don't plan to flood your game with random 3rd party scripts (and just panic when the game crashes), you should be fine.
You're welcome.
-
1
-
-
I'm somewhat confused, because for me it just crashes when I put it that way. I imagined it will draw whatever leader was loaded in the last game session - so;
- crash when booting the game and selecting load because the party has not been setup yet
- draw current leader's name when opening save/load in-game, keep drawing the same name even after returning to title screen (because all data still remains until it's reset by "new game" or overwritten when loading a save file)
...but it just crashes claiming $game_party doesn't exist... eh. maybe I'm overlooking something because I'm tired.
Well either way, you'll need to add more data into save file's header and then refer to it. Calling $game_party will refer to current/last game session's data, not savefile's.
Paste this piece of code in the materials
module DataManager #-------------------------------------------------------------------------- # * !overwrite: Create Save Header #-------------------------------------------------------------------------- def self.make_save_header header = {} header[:characters] = $game_party.characters_for_savefile header[:playtime_s] = $game_system.playtime_s #===[ Custom ]=========================================================== header[:leader_name] = $game_party.leader.name #======================================================================== header end end
This is code from DataManager - by default it only stores sprites of the characters (which contains filename and index) and playtime. This piece of code overwrites that method and adds more data into header. I separated defaults from additions for your convenience, better don't edit anything outside the "custom" block, otherwise things may go brrrr.
I've added a new header that stores leader's name upon saving.
Then, to read that header, use:
draw_text(x, y, width, line_height, header[:leader_name])
Be careful if you'd be planning to add more headers though, if you'll mistype something or put an incorrect variable and then try to save the game in the save menu, it will fail to do so, which will result in the savefile being removed instead. Keep it in mind if you'd be having some precious saves and then decide to toy with their headers.
-
1
-
-
Hello and welcome!
I hope you'll have a good time here!
-
@AlexGalaxia Hmm, it somewhat depends on what you're looking for. Take a look at Theory and Development forums and see if there is something, that would suit your needs, and if not, you could share these in a status update on your profile.
Though now that I think of it, I'm considering creating an easily accessible "share-your-progress" thread of some sort, where everyone could just dump screenshots/videos and other stuff they're working on without the required critique...
-
Hello and welcome!
I hope you'll have a good time here and good luck with your projects!
-
Hello and welcome!
Good luck with your projects!
-
Hello and welcome!
-
Hmmm a master thread like this, so to speak, could be convenient for devs looking for commissioning artists. I suppose an exception could be made.
-
1
-
-
@Charmy If it comes from 3rd party scripts you have installed in your project, and therefore probably requires some tweaks to the code, place it in Programming.
If you haven't installed any scripts and for example, something in events generate such errors, place it in Editor Support and Discussion.
Don't worry too much about the topic placement, it always can be moved when necessary and there are no punishments for genuine mistakes of that type.
-
@Yue When you click download, it will show you the script.
Copy it all and paste into your script editor (F11 while in the map editor) as per instructions:
QuotePut this script below material but above main. And it's recommended to put this above most of custom script.
On the script list, scroll down until you find the right spot the script mentions. Once there, create a new slot and paste the code into it.
Once this is done, the script just works on its own, you don't have to do anything.
-
1
-
-
Hello and welcome!
I hope you'll find what you're looking for.
-
Hello, hi and welcome!
I hope you'll have a good time here.
-
Hello and welcome!
I hope you'll find what you're looking for and have a good time here.
-
Hello and welcome officially then!
I hope you'll have a good time here
-
Hello and welcome!
I hope everything goes well!
-
Hello, hello and welcome!
Don't worry, no bans for that, but the opposite ~ all game dev activity is welcomed, and while the forums indeed focus on RPG Maker, all other engines are accepted as well.
I myself no longer work with RPG Maker (used to work with Ace), I switched to Game Maker Studio, because all games I did in RPG Maker weren't even RPG's anyway, I coded them from scratch, so hah, I didn't use RM the right way.
Assets sound interesting, looking forward to see your stuff!
-
1
-



To ascend or not to (Clicker heroes)
in General Discussion
Posted
I see, well that's disappointing. One would think they'd add some stuff after all these years, I believe the Cookie Clicker was getting new features once in a while, but haven't played that one in years either.
It is addicting, that's true, that's how these games work. I got really bored of it and stopped playing at some point, never visited again and not having plans to do so. The good part is that one can always just run the game in background and still make progress I guess.
---
Yeah, I remember using autoclicking software myself back then, it's much faster than idling.