• Content count

  • Joined

  • Last visited

About esrann

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
  1. Here's a screenshot of the common event I use: I had other stuff in there, but I deleted everything except the delay (prevents lag) so you can clearly see the overweight check. Of course, you can have anything under the conditional branches, whatever fits your project! If you set up a switch to toggle the parallel process, remember to turn it on to actually run the code in-game.
  2. This is all I added to Game_Party: def overweight? weight > max_weight end Here's the logic I use in a parallel process common event: $game_party.overweight? == true If true, > add conditon "Encumbered" > set move route: [slow player speed] Else, If condition "Encumbered" == true > remove condition "Encumbered" > set move route: [normal player speed] You can set up the "Encubered" state to give whatever debuffs you want. This is the way I use it, there could be more elegant way to make it 100% script. Hope this helps!
  3. Oooh, I feel like christmas morning, man! @Vaster: I agree, customization & modularity. A module with switches for different needs and errr... anti-needs (like the toxin thing, I don't know the technical term). Or a module with an array to add custom needs with different parameters. At the moment, I use Galv's Region Effects and Variable Instance Bars to have certain areas (region id's) increase toxin dose variable. These scripts might be interesting to you. I don't know, I suck at scripting and math and stuff in general. I do graphic design (for living)...
  4. I have this mechanic in my project that lowers your maxHP if you have deseases or toxic contamination. So even a high-level actor may temporarily have a really low max health if he is affected by a lot of bad status effects. Compare to real world: even if you're a professional athlete, acute radiation syndrome or ebola will make you pretty weak. Of course, the player won't be able to heal him past the maxHP. So, this works sort of like the Life value, but instead of simply killing the actor it will make him die very easily. Well, this is just my approach and works in the context of my project. I know a really hardcore survival game mechanic can be really immersive and lots of fun, too. Yeah, you understood my second suggestion correctly, I just expressed it in a weird way. I meant that the logic is reversed compared to your existing stats: instead of [variable decreases -> life decreases], you'd have [variable increases -> life decreases]. I used to have a system similiar to this in RPGMXP so I was thinking about the code logic... Fallout rad level is a perfect example, I should have used that to begin with. As you know, a script that allows lots of room for developer creativity will need to have optional features and in general be modular. It's not easy, but you seem skilled in coding, even if you're new to Ruby or RGSS3. Anyways, these are just ideas I come up with when playing games and brainstorming with my geek friends, don't mean to sound demanding or anything. I appreciate the fact that your sharing your work with us!
  5. Really nice script! As a fan of survival rpg's, I've been wanting to add a system like yours into a project I'm working on. Couple of ideas: - The Life value could be hidden and only used for giving the actor debuffs as it gets lower. I think it would be more challenging if the player didn't explicitly see the value, only see the individual stat levels and the effects of the worsening condition. - 'Reverse logic' stats, for example as your Toxin Dose gets higher, Life value decreases. Then you need to take certain meds to keep the toxin level low.
  6. Ah, thanks! That of course is the best way, because I don't think I need to adjust the height anywhere else, for now. I was thinking too complicated... Problem solved!
  7. I'm using Zerbu Engine - Title Screen Window Options to edit Window_TitleCommand and run into a problem with line height. I want to use a large font size (about 40 points) in the title scene, but the line height is set to 24 pixels by default, so the text gets cut. In Window_Selectable we have: def item_height line_height end And in Window_Base: def line_height return 24 end Any ideas on how to write an 'intelligent' method for adjusted line height? PS: Link to script: EDIT: Screenshot (ignore the placeholder background image)
  8. I'm not sure what you're trying to say, but I know how to set up static light effects in the list: X => [picture,opacity,variation,cut] Now, I would like to have that cut option for the dynamic light, too. However, the commands for the dynamic light don't include cut by default. These are the listed commands: l = $game_map.lantern l.set_graphic(i) l.set_multiple_graphics(h) h = {2=>"ld",4=>"ll",6=>"lr",8=>"lu"} l.change_owner(char) l.set_opacity(o,p) l.hide If you mean something like: l.cut = false ...well, that won't work, because 'cut' method is not defined in Light_DSource.
  9. Hey, I wonder if there is a way to disable the 'cutting' of the dynamic light. In the script's effects list, you can set the 'cut' feature to false, but you can't do that for the lantern light by default. I have a flashlight that casts shadows normally, and also a night vision device that shouldn't cast shadows. So, does someone have an idea how to do this?
  10. Hot dang! It works! Yeah, I should have realized that the array doesn't just store the id's, but actually all the armor data. Hehe. It all seems so simple now... Thank you for helping me understand! Here's the working thingy: #============================================================================== # Lantern Toggle v1.0 (23/03/2013) # for Khas Awesome Light Effects #============================================================================== # AUTHOR: esrann # # Thanks to Khas for the incredible script! # Thanks to DP3 for help! # # Feel free to adapt to your own needs. Give credit if you want. # If you want to work this into a 'real' script and publish it, go ahead. # This is not a stand-alone script, only an add-on function! # This snippet is definately not plug-and-play, but if you have a little # scripting experience you may find it useful. # # I will not be able to offer much support. However, there shouldn't be # any compatibility issues. I may write a more elegant and user-friendly # version later. # # And, yes, I realize there's more comments than actual code. kthanxbai. #-------------------------------------------------------------------------- # DESCRIPTION: # Toggle dynamic light on and off by pressing A button in map. # Set up equipment conditions for the light. # - For example: Equipping a flashlight allows you to turn dynamic light on. # See the code for example how to set up. # Have a game switch indicate if the light is on. Useful for eventing. # - For example: Having a flashlight on will raise your hit rate and/or # draw enemies to you. #-------------------------------------------------------------------------- # INSTALLATION: # Copy this script in the Materials section in your project's # script editor. Set up the variables and graphics. #-------------------------------------------------------------------------- # REQUIREMENTS: # - Khas Awesome Light Effects v1.0 # - Appropriate graphic files for the light effects #============================================================================== #============================================================================== # Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # Alias method: update #-------------------------------------------------------------------------- alias esrann_input_update update def update esrann_input_update # Alias method if Input.trigger?(:X) # Press A to toggle lantern lantern_toggle end end #-------------------------------------------------------------------------- # New method: lantern_toggle # # Customize variables: # - Game switch ID # - Equipment ID's # - Dynamic Light graphics & options #-------------------------------------------------------------------------- def lantern_toggle lantern = $game_map.lantern # If the lantern is off, turn it on if $game_switches[20] != true # If Flashlight is equipped if $game_party.leader.armors.include?($data_armors[54]) Sound.play_cursor pics = {2 => "LanternDown", 4 => "LanternLeft", 6 => "LanternRight", 8 => "LanternUp"} lantern.set_multiple_graphics(pics) lantern.set_opacity(255,0) lantern.change_owner($game_player) end # If Night Vision is equipped if $game_party.leader.armors.include?($data_armors[54]) Sound.play_cursor lantern.set_graphic("LanternNightVision") lantern.set_opacity(225,10) lantern.change_owner($game_player) end # Add more equipment here... else # If the lantern is on, turn it off lantern.hide end $game_switches[20] = !$game_switches[20] end end
  11. Thanks again! I tested the code more thoroughly, everything else is fine but the if statements are not working. $game_party.leader.armors.include?(id) This line never returns TRUE, even if the leader actor has that armor (id) equipped. I don't get it. $game_party.leader is a $game_actor, and Game_Actor class has a method called armors defined, which is an array of equipped armor id's. And the include?(val) method is supposed to return TRUE if the array contains an equipment id equal to val. So what am I doing wrong?
  12. Thanks! This is what I came up with: #============================================================================== # Scene_Map #============================================================================== class Scene_Map #-------------------------------------------------------------------------- # New method: lantern_toggle #-------------------------------------------------------------------------- def lantern_toggle lantern = $game_map.lantern # If the lantern is off, turn it on if $game_switches[20] != true # If Flashlight is equipped if $game_party.leader.armors.include?(54) == true Sound.play_cursor pics = {2 => "LanternDown", 4 => "LanternLeft", 6 => "LanternRight", 8 => "LanternUp"} lantern.set_multiple_graphics(pics) lantern.set_opacity(255,0) lantern.change_owner($game_player) $game_switches[20] = true end # If Night Vision is equipped if $game_party.leader.armors.include?(60) == true Sound.play_cursor lantern.set_graphic("LanternNightVision") lantern.set_opacity(225,10) lantern.change_owner($game_player) $game_switches[20] = true end else # If the lantern is on, turn it off lantern.hide $game_switches[20] = false end end #-------------------------------------------------------------------------- # Alias method: update #-------------------------------------------------------------------------- alias esrann_input_update update def update esrann_input_update # Alias method if # Press A to toggle lantern lantern_toggle end end end However, it does not turn on the dynamic light. I'm not getting any errors, but there is probably something wrong with my logic. Also, it's not the prettiest piece of code. I might rewrite it to something more elegant, if/when I get it working.
  13. I'm trying to run this bit of code after I press a button in a map scene, but I've worked so long with RPGMXP, that I'm a little confused with the way button input is handled in VXA. Here's the code that I want to run (please feel free to suggest improvements): def lantern_toggle lantern = $game_map.lantern lantern.change_owner($game_player) if $game_switches[20] != true # If the lantern is off, turn it on (depending on equipment) case $game_party.leader.armors.include? when 59 # Flashlight pics = {2=>"LanternDown",4=>"LanternLeft",6=>"LanternRight",8=>"LanternUp"} lantern.set_multiple_graphics(pics) lantern.set_opacity(255,0) $game_switches[20] = true when 60 # Nightvision Device lantern.set_graphic("light_nv") lantern.set_opacity(225,10) $game_switches[20] = true end else # If the lantern is on, turn it off lantern.hide $game_switches[20] = false end end (BTW, is it necessary to have an else condition after the when clause? I'm guessing, with this code if you have other than the defined id's equipped, running the code will do nothing, as it should.) So, where should I place the method and this bit: if # Press A to toggle lantern lantern_toggle end to make it work in the map scene? The lantern_toggle method uses Khas Awesome Light Effects, but that shouldn't cause any issues here. I simply want to be able to switch the dynamic light on and off with a press of a button while checking for the correct equipment and setting a game switch for eventing purposes.
  14. csca

    I noticed on small detail: When I use the \$ control character in an event message to show the gold window next to the message, the gold window does not obey the 'switch_currency(currency)' script call, but always uses the default currency. Is there a way to fix this?
  15. Aha! There is also a 'limit_reached?' method in Game_Inventory, which has the same code in it. Also I changed the 'can_add_amount?' in both Game_Inventory and Game_InventorySlot into: def can_add_amount?(item) return [max_items - @item_count, 0].max end Added 'overweight?' method in Game_Party. Now I can use that as a condition in a parallel process common event. Fantastic. Thanks for the help!