• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Radioactive TIles and Giger counter functionality

  • 1,799
    Posts
    8
    Years
    Hello all,

    I was wondering, if it at all, can a script be made that attaches a radiation level to a tile via the map editor (as making an even on each tile would be ridiculous). I thought about putting in another terrain tag but it wouldn't work if I need radioactive water. )

    I was thinking about defining a new terrain tag -- on invisible tiles so they can be used, say over another tile that has something defined for it already. However, I'm trying to figure out how to have script (that requires a certain following pokemon) and who can only detect them to have a screen with all of the things related:

    *Current Tile Radiation Level
    *Total radiation accumulated

    I'm just wondering how will I get the game to calculate the global variable if stepped on?

    Also I need a way to reduce the amount of radiaton a player has. So what I plan on doing is inveting conssumable by the player: RadPills, stored in a key item RadPillbox. Consuming one of these pills will set back the counter by a specific amount.

    Now I was thinking about having radiation levels apply both to the player and pokemon. If the player receives x amount of radiation he will faint, essentially like starting over, being revived at the nearest pokecenter. (bus since my game refused to acknowledge their existance, that is the equivalent of death).

    If our pokemon receives x amount of radiation they will develop radiation sickness and die over time. To reduce their radiation levels, give them PokeRadPills and it will reduce their counter by a certain amount.


    So what I need is:
    UI for Rotom Geiger (accessible as he follows you, and from the party box)
    A script to connect the global radiation level (for yourself and your pokemon) with the new terrain tag.

    How will I go about this?
    Thanks!

    This article talks all about the effect I want to emulate. https://chernobylgallery.com/chernobyl-disaster/radiation-levels/
     
    Last edited:
    Here is what I have already. This is my first time really coding in Ruby so here it goes:

    Code:
    #==============================================================================
    #WBTERRAINTAG=18-35
    # Radioactive_1   = 18
    #  Radioactive_2   = 19
    #  Radioactive_3   = 20
    #  Radioactive_5   = 21
    #  Radioactive_10  = 22
    #  Radioactive_15  = 23
    #  Radioactuve_20  = 24
    #  Radioactive_25  = 25
    #  Radioactive_30  = 26
    #  Radioactive_40  = 27
    #  Radioactive_50  = 28
    #  Radioactive_65  = 29
    #  Radioactive_80  = 30
    #  Radioactive_100 = 31
    #  Radioactive_120 = 32
    #  Radioactive_150 = 33
    #  Radioactive_200 = 35
    #Defining the correct variables for the tiles and connecting the variables to 
    #those tiles
    #==============================================================================
    $RadiationAccumulation_Player = 90
    $RadiationAccumulation_Pokemon = 91
    
    if WBTERRAINTAG=18
      return $RadiationAccumulation_Player +=1
      return $RadiationAccumulation_Pokemon +=1
    end
    
    if WBTERRAINTAG=19
      return $RadiationAccumulation_Player +=2
      return $RadiationAccumulation_Pokemon +=2
    end
    
    if tWBTERRAINTAG=20
      return $RadiationAccumulation_Player +=3
      return $RadiationAccumulation_Pokemon +=3
    end
    
    if WBTERRAINTAG=21
      return $RadiationAccumulation_Player +=5
      return $RadiationAccumulation_Pokemon +=5
    end
    
    if WBTERRAINTAG=22
      return $RadiationAccumulation_Player +=10
      return $RadiationAccumulation_Pokemon +=10
    end
    
    if WBTERRAINTAG=23
      return $RadiationAccumulation_Player +=15
      return $RadiationAccumulation_Pokemon +=15
    end
    
    if WBTERRAINTAG=24
      return $RadiationAccumulation_Player +=20
      return $RadiationAccumulation_Pokemon +=20
    end
    
    if WBTERRAINTAG=25
      return $RadiationAccumulation_Player +=25
      return $RadiationAccumulation_Pokemon +=25
    end
    
    if WBTERRAINTAG=26
      return $RadiationAccumulation_Player +=30
      return $RadiationAccumulation_Pokemon +=30
    end
    
    if WBTERRAINTAG=27
      return $RadiationAccumulation_Player +=40
      return $RadiationAccumulation_Pokemon +=40
    end
    
    if WBTERRAINTAG=28
      return $RadiationAccumulation_Player +=50
      return $RadiationAccumulation_Pokemon +=50
    end
    
    if WBTERRAINTAG=29
      return $RadiationAccumulation_Player +=65
      return $RadiationAccumulation_Pokemon +=65
    end
    
    if WBTERRAINTAG=30
      return $RadiationAccumulation_Player +=80
      return $RadiationAccumulation_Pokemon +=80
    end
    
    if WBTERRAINTAG=31
      return $RadiationAccumulation_Player +=100
      return $RadiationAccumulation_Pokemon +=100
    end
    
    if WBTERRAINTAG=32
      return $RadiationAccumulation_Player +=120
      return $RadiationAccumulation_Pokemon +=120
    end
    
    if WBTERRAINTAG=34
      return $RadiationAccumulation_Player +=150
      return $RadiationAccumulation_Pokemon +=150
    end
    
    if WBTERRAINTAG=35
      return $RadiationAccumulation_Player +=200
      return $RadiationAccumulation_Pokemon +=200
    end
    
    #this thing below assigns effects to your pokemon in the party
    #if the pokemon is taken in to the box their radiation level shouldn't increase
    #along with the rest of the party
    #if a pokemon is a Radioactive type, they will be unaffected by all of this
    #if a pokemon's radiation level gets to 5000, then they develop a new status 
    #condition that halves sp.att and deals damage over time even outside of battle
    
    def radCountPokemon
      if $RadiationAccumulation_Pokemon == 5000
        return 
        if $RadiationAccumulation_Pokemon == 10000
          return
        end
        
    #now this is the part where the player starts accumulating radiation
    #if the trainer is wearing a lead cloak he or she will not accumulate radiation
    #but will not be able to run
        
    def radCountTrainer
      if $RadiationAccumulation_Trianer == 5000
        return
        if $RadiationAccumulation_Trainer == 10000
          return
        end
    #
    #
    # Beginnings for the Rotom display
    #
    #
    
    def isTileRadioactive?
      if WBTERRAINTAG=35,
      else if WBTERRAINTAG=19,
      else if WBTERRAINTAG=20,
      else if WBTERRAINTAG=21,
      else if WBTERRAINTAG=22,
      else if WBTERRAINTAG=23,
      else if WBTERRAINTAG=24,
      else if WBTERRAINTAG=25,
      else if WBTERRAINTAG=26,
      else if WBTERRAINTAG=27,
      else if WBTERRAINTAG=28,
      else if WBTERRAINTAG=29,
      else if WBTERRAINTAG=30,
      else if WBTERRAINTAG=31,
      else if WBTERRAINTAG=32,
      else if WBTERRAINTAG=33,
      else if WBTERRAINTAG=34,
      else if WBTERRAINTAG=35
        return isTileRadioactive? = true
        else
          return false
        end
    
    def isPokemonRotomGeiger?
    end
    
    def initializeRotomGinterface
    end
    
    def howmuchAccumulation?
    end
    
    def tellPlayerRadiationLevelonTile
    end
    
    #I'm a bit confused on how to make a check on rotom's number or pokemon.
    #How would I tell the program to select if it is the right pokemon
    #either from outside following you or in your party
    #also if he is following you how do you get him to state things if
    #a party member needs a rad pill?
    #I have the pokemon follower scripte by mej71 installed so no worries on that 
    #end
     
    Last edited:
    Don't want to do the whole code for you, but a couple of pointers
    Code:
    if WBTERRAINTAG=31
    = is for assignment, == is for testing
    You make this mistake in a bunch of places.

    While '$' does make a global variable, it won't be saved, you should make it a class variable for your trainer class.

    I think the better solution is just to make a custom terrain tag and make an OnStep proc (you can see a lot of examples in Essentials). You can make that work with multiple terrain tiles if you want.
     
    I agree with Mej, making a terrain tag is possibly the most easiest thing for you to do.
    Plus, your code there has plenty of spelling problmes (<--- get it).

    Just use terrain tags and the on step proc like Mej said, you'll be surprised how well it works.
     
    yeah, it did work! On to the UI and Rotom Geiger functionality, and the Rad Pills, and rad levels for pokemon in the the party. (and the effects of radiation)
     
    yeah can't move without this baby crashing my game
    Code:
    ---------------------------
    Pokemon Fusion Alpha
    ---------------------------
    Exception: NameError
    
    Message: undefined local variable or method `tile_id' for nil:NilClass
    
    PField_Radio Tiles+Effects:13
    
    PField_Radio Tiles+Effects:8:in `call'
    
    Event:54:in `trigger'
    
    Event:49:in `each'
    
    Event:49:in `trigger'
    
    Game_Character:281:in `update_move'
    
    Game_Character:228:in `update'
    
    Game_Event:252:in `update'
    
    PField_DependentEvents:398:in `updateDependentEvents'
    
    PField_DependentEvents:393:in `each'
    
    
    
    This exception was logged in 
    
    C:\Users\Brian\Saved Games/Pokemon Fusion Alpha/errorlog.txt.
    
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------

    Code:
    class Radlevelplayer
    	def radlevelplayer
    	$PokemonGlobal.radlevelplayer=0
    end
    end
    
    RadioactiveSignature_1=PBTerrain::Radioactive_1
    Events.onStepTakenFieldMovement+=proc{|sender,e| #this baby is the problem line
      event=e[0] # Get the event affected by field movement
      thistile=$MapFactory.getRealTilePos(event.map.map_id,event.x,event.y)
      map=$MapFactory.getMap(thistile[0])
      radlevel = nil
          next if tile_id == nil
        if map.terrain_tags[tile_id] &&
           map.terrain_tags[tile_id]==Radioactive_1
          radlevel=1
          break
        end
    
    
     if radlevel
        newTile=nil
        for s in 0...Radioactive_1.length
          newTile=Radioactive_1[s][1]+384 if Radioactive_1[s][0]+384==map.data[thistile[1],thistile[2],radlevel]
        end
        $PokemonGlobal.radlevelplayer=0 if !$PokemonGlobal.radlevelplayer
        $game_map.setRadiationCounterPlayer(thistile[1],thistile[2],radlevel,map.data[thistile[1],thistile[2],radlevel])
        map.data[thistile[1],thistile[2],radlevel]=newTile!=nil ? newTile : 0
        if event==$game_player
          $PokemonGlobal.radlevelplayer+=1
        end
        
        $scene.spriteset.reloadTiles if $scene.spriteset
        end
     }

    The game said the problem line was the one bolded
     
    yeah can't move without this baby crashing my game
    Code:
    ---------------------------
    Pokemon Fusion Alpha
    ---------------------------
    Exception: NameError
    
    Message: undefined local variable or method `tile_id' for nil:NilClass
    
    PField_Radio Tiles+Effects:13
    
    PField_Radio Tiles+Effects:8:in `call'
    
    Event:54:in `trigger'
    
    Event:49:in `each'
    
    Event:49:in `trigger'
    
    Game_Character:281:in `update_move'
    
    Game_Character:228:in `update'
    
    Game_Event:252:in `update'
    
    PField_DependentEvents:398:in `updateDependentEvents'
    
    PField_DependentEvents:393:in `each'
    
    
    
    This exception was logged in 
    
    C:\Users\Brian\Saved Games/Pokemon Fusion Alpha/errorlog.txt.
    
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------

    Code:
    class Radlevelplayer
    	def radlevelplayer
    	$PokemonGlobal.radlevelplayer=0
    end
    end
    
    RadioactiveSignature_1=PBTerrain::Radioactive_1
    Events.onStepTakenFieldMovement+=proc{|sender,e| #this baby is the problem line
      event=e[0] # Get the event affected by field movement
      thistile=$MapFactory.getRealTilePos(event.map.map_id,event.x,event.y)
      map=$MapFactory.getMap(thistile[0])
      radlevel = nil
          next if tile_id == nil
        if map.terrain_tags[tile_id] &&
           map.terrain_tags[tile_id]==Radioactive_1
          radlevel=1
          break
        end
    
    
     if radlevel
        newTile=nil
        for s in 0...Radioactive_1.length
          newTile=Radioactive_1[s][1]+384 if Radioactive_1[s][0]+384==map.data[thistile[1],thistile[2],radlevel]
        end
        $PokemonGlobal.radlevelplayer=0 if !$PokemonGlobal.radlevelplayer
        $game_map.setRadiationCounterPlayer(thistile[1],thistile[2],radlevel,map.data[thistile[1],thistile[2],radlevel])
        map.data[thistile[1],thistile[2],radlevel]=newTile!=nil ? newTile : 0
        if event==$game_player
          $PokemonGlobal.radlevelplayer+=1
        end
        
        $scene.spriteset.reloadTiles if $scene.spriteset
        end
     }

    The game said the problem line was the one bolded

    Okay, you put a decent amount of work in, so I'll try and write it for you.

    Code:
    module PBTerrain
      #define whatever numbers our terrains will use
      #any numbers will work, just make sure you use these same tags on your tiles
      # and make sure you haven't already used these numbers
      RadioActiveGrass = 17
      RadioActiveWater = 18  
      
      #alias our module methods so water will still function like normal water too
      class << self
        alias radiation_isWater? isWater?
        alias radiation_isPassableWater? isPassableWater?
        alias radiation_isJustWater? isJustWater?
      end
    
    
      def PBTerrain.isWater?(tag)
        ret = radiation_isWater?(tag)
        ret = tag==PBTerrain::RadioActiveWater if !ret
        return ret
      end
    
      def PBTerrain.isPassableWater?(tag)
        ret = radiation_isPassableWater?(tag)
        ret = tag==PBTerrain::RadioActiveWater if !ret
        return ret
      end
    
      def PBTerrain.isJustWater?(tag)
        ret = radiation_isJustWater?(tag)
        ret = tag==PBTerrain::RadioActiveWater if !ret
        return ret
      end
    end
    
    #Define radLevel for the trainer, and allow it to work in existing save files
    class PokeBattle_Trainer
      
      DEFAULTRADLEVEL = 0
      
      attr_writer :radLevel
      def radLevel
        if !@radLevel
          @radLevel = DEFAULTRADLEVEL;
        end
        return @radLevel
      end
      
    end
    
    #Register each step taken on radioactive tiles
    Events.onStepTakenFieldMovement+=proc{|sender,e|
      event=e[0] # Get the event affected by field movement
      thistile=$MapFactory.getRealTilePos(event.map.map_id,event.x,event.y)
      map=$MapFactory.getMap(thistile[0])
      for i in [2, 1, 0]
        tile_id = map.data[thistile[1],thistile[2],i]
        next if tile_id == nil
        if map.terrain_tags[tile_id] &&
           (map.terrain_tags[tile_id]==PBTerrain::RadioActiveGrass ||
             map.terrain_tags[tile_id]==PBTerrain::RadioActiveWater)
          $Trainer.radLevel+=1
          break
        end
      end
    }
     
    Okay, you put a decent amount of work in, so I'll try and write it for you.

    Code:
    module PBTerrain
      #define whatever numbers our terrains will use
      #any numbers will work, just make sure you use these same tags on your tiles
      # and make sure you haven't already used these numbers
      RadioActiveGrass = 17
      RadioActiveWater = 18  
      
      #alias our module methods so water will still function like normal water too
      class << self
        alias radiation_isWater? isWater?
        alias radiation_isPassableWater? isPassableWater?
        alias radiation_isJustWater? isJustWater?
      end
    
    
      def PBTerrain.isWater?(tag)
        ret = radiation_isWater?(tag)
        ret = tag==PBTerrain::RadioActiveWater if !ret
        return ret
      end
    
      def PBTerrain.isPassableWater?(tag)
        ret = radiation_isPassableWater?(tag)
        ret = tag==PBTerrain::RadioActiveWater if !ret
        return ret
      end
    
      def PBTerrain.isJustWater?(tag)
        ret = radiation_isJustWater?(tag)
        ret = tag==PBTerrain::RadioActiveWater if !ret
        return ret
      end
    end
    
    #Define radLevel for the trainer, and allow it to work in existing save files
    class PokeBattle_Trainer
      
      DEFAULTRADLEVEL = 0
      
      attr_writer :radLevel
      def radLevel
        if !@radLevel
          @radLevel = DEFAULTRADLEVEL;
        end
        return @radLevel
      end
      
    end
    
    #Register each step taken on radioactive tiles
    Events.onStepTakenFieldMovement+=proc{|sender,e|
      event=e[0] # Get the event affected by field movement
      thistile=$MapFactory.getRealTilePos(event.map.map_id,event.x,event.y)
      map=$MapFactory.getMap(thistile[0])
      for i in [2, 1, 0]
        tile_id = map.data[thistile[1],thistile[2],i]
        next if tile_id == nil
        if map.terrain_tags[tile_id] &&
           (map.terrain_tags[tile_id]==PBTerrain::RadioActiveGrass ||
             map.terrain_tags[tile_id]==PBTerrain::RadioActiveWater)
          $Trainer.radLevel+=1
          break
        end
      end
    }

    Wow! Thanks! I just updated to 16.2 so the terrain defs might have been written a bit differently than what you have as when I run your script in a separate script:

    Script .... line 11:NameError occurred. undefined method isWater? for class 'nilClass.'

    I don't have enough coding knowledge to change it to a module name that works. I've tried pbIsWater? to no progress and I am perplexed
     
    Last edited:
    EDIT: I think what might work better if there are separate tiles radioactivewater that are normally surf-able but require the use surf and still activate the counter. I think the grass tiles were defined correctly... the part the program is whining about is the water tile check

    Code:
    ################################################################################
    # Terrain tags
    ################################################################################
    module PBTerrain
      Ledge           = 1
      Grass           = 2
      Sand            = 3
      Rock            = 4
      DeepWater       = 5
      StillWater      = 6
      Water           = 7
      Waterfall       = 8
      WaterfallCrest  = 9
      TallGrass       = 10
      UnderwaterGrass = 11
      Ice             = 12
      Neutral         = 13
      SootGrass       = 14
      Bridge          = 15 
      RadioActiveGrass = 17
      RadioActiveWater = 18
    end
      
    def pbIsSurfableTag?(tag)
      return pbIsWaterTag?(tag)
    end
    
    def pbIsWaterTag?(tag)
      return tag==PBTerrain::DeepWater ||
             tag==PBTerrain::Water ||
             tag==PBTerrain::StillWater ||
             tag==PBTerrain::WaterfallCrest ||
             tag==PBTerrain::Waterfall
    end
    
    def pbIsPassableWaterTag?(tag)
      return tag==PBTerrain::DeepWater ||
             tag==PBTerrain::Water ||
             tag==PBTerrain::StillWater ||
             tag==PBTerrain::WaterfallCrest
    end
    
    def pbIsJustWaterTag?(tag)
      return tag==PBTerrain::DeepWater ||
             tag==PBTerrain::Water ||
             tag==PBTerrain::StillWater
    end
    
    def pbIsGrassTag?(tag)
      return tag==PBTerrain::Grass ||
             tag==PBTerrain::TallGrass ||
             tag==PBTerrain::UnderwaterGrass
    end
    
    def pbIsJustGrassTag?(tag)
      return tag==PBTerrain::Grass
    end
    
    
    #Define radLevel for the trainer, and allow it to work in existing save files
    class PokeBattle_Trainer
    
      DEFAULTRADLEVEL = 0
    
      attr_writer :radLevel
      def radLevel
        if !@radLevel
          @radLevel = DEFAULTRADLEVEL;
        end
        return @radLevel
      end
    end
      #alias our module methods so water will still function like normal water too
    
      def initaliazeRadEvent
        return Event.onStepTakenFieldMovement
    #Register each step taken on radioactive tiles
    Events.onStepTakenFieldMovement+=proc{|sender,e|
      event=e[0] # Get the event affected by field movement
      thistile=$MapFactory.getRealTilePos(event.map.map_id,event.x,event.y)
      map=$MapFactory.getMap(thistile[0])
      for i in [2, 1, 0]
        tile_id = map.data[thistile[1],thistile[2],i]
        next if tile_id == nil
        if map.terrain_tags[tile_id] &&
          (map.terrain_tags[tile_id]==PBTerrain::RadioActiveGrass)
          $Trainer.radLevel+=1
          break
        end
      end
    }

    I removed the water check for now and then I put in a constant to initialize the event.... For some reason the code ran the rest of the script after the module ended so put in an extra end there to quit it reading as the module and start reading the rest. I'm not sure i did the def initialize correctly because it said there was some sort of initialization error
    ...

    at least the game is satified enough to play until I attempt to do something:

    Code:
    ---------------------------
    Pokemon Fusion Alpha
    ---------------------------
    Exception: NoMethodError
    
    Message: undefined method `>' for nil:NilClass
    
    Game_Map:272:in `playerPassable?'
    
    Game_Map:252:in `each'
    
    Game_Map:252:in `playerPassable?'
    
    Game_Map:188:in `follow_passable?'
    
    Pokemon_Follower:1748:in `passable?'
    
    Game_Character:108:in `passableEx?'
    
    Game_Character:127:in `passable?'
    
    Game_Player:248:in `passable?'
    
    Walk_Run:49:in `character_name'
    
    Sprite_Character:81:in `update_or'
     
    Last edited:
    Wow! Thanks! I just updated to 16.2 so the terrain defs might have been written a bit differently than what you have as when I run your script in a separate script:

    Script .... line 11:NameError occurred. undefined method isWater? for class 'nilClass.'

    I don't have enough coding knowledge to change it to a module name that works. I've tried pbIsWater? to no progress and I am perplexed

    I wrote this in v16.2. Ensure you updated properly, because it should work correctly.
    Also make sure you're coping using Show Printable Version
     
    check to both of them. it works fine without the water checks. I can worry about that later when I am working on developing surfing encounters after the third underground boss.

    onto rotom geiger interfaces. for the alpha they're going to be rather simple... key items that tell you whether or not you should get rad pills....applying it to the individual pokemon...well that is going to be a bit more difficult but for the alpha this works
     
    Hey all! The radioactive tiles work nicely. Now I'm working on the Geiger Counter interface (I'll make it exclusive to Rotom perhaps in the next update). So far right now it is a key item and I'm having some issues with the code.

    Code:
    ItemHandlers::UseInField.add(:GEIGERINTERFACE,proc{|item|
      map=$MapFactory.getMap(thistile[0])
       if !pbIsRadioactiveTag?(terrain) || (!thistile[0])
         Kernel.pbMessage(_INTL("This tile is radioactive. It will increase your accumulation counter by 1"))
       if $Trainer.radlevel =< 4000
          Kernel.pbMessage(_INTL("You're fine. Though remember to take rad pills.")
          next
         if $Trainer.radlevel =<5000
            Kernel.pbMessage(_INTL("You're approaching your max capacity. Please consider taking a radpill.")
           next
            if $Trainer.radlevel =<6000 
             Kernel.pbMessage(_INTL("You're greater than half past capaciy. Please take a radpill.")
             next 
             if $Trainer.radlevel =<10000
                 Kernel.pbMessage(_INTL("You're nearing full capacity of your accumulation. Please take a radpill.")
        next
      else
         Kernel.pbMessage(_INTL("This tile isn't radioactive. It will not increase your accumulation counter by 1"))
         if $Trainer.radlevel =< 4000
           Kernel.pbMessage(_INTL("You're fine. Though remember to take rad pills.")
          if $Trainer.radlevel =<5000
            Kernel.pbMessage(_INTL("You're approaching your max capacity. Please consider taking a radpill.")
           if $Trainer.radlevel =<6000 
             Kernel.pbMessage(_INTL("You're greater than half past capaciy. Please take a radpill.")
              if $Trainer.radlevel =<10000
                 Kernel.pbMessage(_INTL("You;re nearing full capacity of your accumulation. Please take a radpill.")
        end
      end
    })

    I'm probably not formatting the conditional statements correctly. "The less than or equal to" sign is what in this coding language?
     
    Hey all! The radioactive tiles work nicely. Now I'm working on the Geiger Counter interface (I'll make it exclusive to Rotom perhaps in the next update). So far right now it is a key item and I'm having some issues with the code.

    Code:
    ItemHandlers::UseInField.add(:GEIGERINTERFACE,proc{|item|
      map=$MapFactory.getMap(thistile[0])
       if !pbIsRadioactiveTag?(terrain) || (!thistile[0])
         Kernel.pbMessage(_INTL("This tile is radioactive. It will increase your accumulation counter by 1"))
       if $Trainer.radlevel =< 4000
          Kernel.pbMessage(_INTL("You're fine. Though remember to take rad pills.")
          next
         if $Trainer.radlevel =<5000
            Kernel.pbMessage(_INTL("You're approaching your max capacity. Please consider taking a radpill.")
           next
            if $Trainer.radlevel =<6000 
             Kernel.pbMessage(_INTL("You're greater than half past capaciy. Please take a radpill.")
             next 
             if $Trainer.radlevel =<10000
                 Kernel.pbMessage(_INTL("You're nearing full capacity of your accumulation. Please take a radpill.")
        next
      else
         Kernel.pbMessage(_INTL("This tile isn't radioactive. It will not increase your accumulation counter by 1"))
         if $Trainer.radlevel =< 4000
           Kernel.pbMessage(_INTL("You're fine. Though remember to take rad pills.")
          if $Trainer.radlevel =<5000
            Kernel.pbMessage(_INTL("You're approaching your max capacity. Please consider taking a radpill.")
           if $Trainer.radlevel =<6000 
             Kernel.pbMessage(_INTL("You're greater than half past capaciy. Please take a radpill.")
              if $Trainer.radlevel =<10000
                 Kernel.pbMessage(_INTL("You;re nearing full capacity of your accumulation. Please take a radpill.")
        end
      end
    })

    I'm probably not formatting the conditional statements correctly. "The less than or equal to" sign is what in this coding language?

    EDIT: It keeps saying I have a syntax error at the brace, but I need it there to close the proc. I've updated it somewhat and removed some of the code.

    Code:
    ItemHandlers::UseInField.add(:GEIGERINTERFACE,proc{|item|
       if $Trainer.radlevel < 4000
          Kernel.pbMessage(_INTL("You're fine. Though remember to take rad pills."))
       else if $Trainer.radlevel < 5000
          Kernel.pbMessage(_INTL("You're approaching half capacity. Please consider taking a radpill."))
       else if $Trainer.radlevel < 6000 
          Kernel.pbMessage(_INTL("You're greater than half capaciy. Please take a radpill."))
       else if $Trainer.radlevel < 10000
          Kernel.pbMessage(_INTL("You're nearing full capacity of your accumulation. Please take a radpill."))
        end
    })

    it says the last line is the problem line but I just copied and pasted another item proc.
     
    Last edited:
    Back
    Top