Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Tycoon Script request

Hello, this is quite a complicated script, but it would be great it you would link me to it or make it...

I need this for my anthill tycoon game, here is a list of what I need:
  • After a period of time, the "food" level drops by the amount of ants in the hill. If there is not enough food the ants that didn't get food will die.
  • Room system. You buy a Room maker, for example Food Storage Room, and you equip it inside the tunnel, and press Enter on an empty part of tunnel, then it makes it into a Food Storage square.
  • Storage Limit. If the food storage rooms are full, you can't get any more food.
  • Worker system. if there is food at the top of the anthill the workers will go and get it. and if there is a hostile ant up there the army ants will kill it.
  • Above ground system. When you leave the anthill, you are teleported to the top of the anthill. When you go back into the anthill the tunnels still work.
  • HUD. Shows AE(ant economy), Ant Health, Food in storage, Recourses in storage, Money in storage, and Colony balance(shows how good the colony is)
  • Transform system. If you push enter on another ant and select control you control that ant.
  • Random events up the top of the anthill. For example a humand might stomp on the hill destroying some of the tunnels, or a beetle might appear and you workers will go kill it.
  • Ally/Enemy system

If someone made this script it would be helping many people. It would be a great script.

Thanks,
Vazoh
 
Ok check this out :tongue: that's not just 1 script but alot. Alot of that can be done by events/common events. As for huds here's what you can do...

You can use this script.
Code:
#==============================================================================
# Hunger_Hud
#------------------------------------------------------------------------------
# By: L0rdPh0enix
# Helped by: Khmp, Gando  
# 5/4/2008
#------------------------------------------------------------------------------
#==============================================================================
  HUD_SWITCH = 2
  Variablehunger = 22
  
class Hunger_Hud < Window_Base
  Max_Hunger = 100
  Hunger_Bar = 'Hunger_100'
  Hunger_Empty = 'Hunger_0'
  #--------------------------------------------------------------------------
  # * Initialize             
  #--------------------------------------------------------------------------
  def initialize
    super(138, 0, 96, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 200
    self.visible = false
    @hunger_bar = Bitmap.new('Graphics/Pictures/' + Hunger_Bar)
    @empty_bar = Bitmap.new('Graphics/Pictures/' + Hunger_Empty)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    reset_variables
        # How full are we?
    percent = [@variablehunger / Max_Hunger.to_f, 1.0].min

    bar_width = (@hunger_bar.width * percent).to_i

    # First clear the bar's position. Draw the old bar first
    self.contents.blt(1, 1, @empty_bar, 
      Rect.new(0, 0, @empty_bar.width, @empty_bar.height))
    # Now draw the bar.
    self.contents.blt(1, 1, @hunger_bar, 
      Rect.new(0, 0, bar_width, @hunger_bar.height))
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    super()
    @hunger_bar.dispose unless @hunger_bar.disposed?
    @empty_bar.dispose unless @empty_bar.disposed?
  end

  def reset_variables
    @variablehunger = $game_variables[Variablehunger]
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    super
    refresh 
  end 
end

#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map

  alias hungerhud_main main
  alias hungerhud_update update
  def main
    @hungerhud = Hunger_Hud.new
    hungerhud_main
    @hungerhud.dispose
  end
  def update
    if $game_switches[HUD_SWITCH]
      @hungerhud.visible = true
    else
      @hungerhud.visible = false
    end
    @hungerhud.update
    hungerhud_update
  end
end

You'll need 1 variable, and 2 pictures in the Picture folder.
I use this hud script for my hunger system but it can be used for anything that uses a variable. 1picture is used as the bar base and the 2nd picture will be drawn in to proportion of the variable between 0-100.
Code:
  def initialize
    super(138, 0, 96, 64)
is where you change the location and size of the hud.
Code:
class Hunger_Hud < Window_Base
changing 'Hunger_Hud' to whatever you want the hud to be for (i.e. AE_Hud) lets you have multiple huds. SO that solves your hud request.

Above ground system. When you leave the anthill, you are teleported to the top of the anthill. When you go back into the anthill the tunnels still work.
No script needed here, just use the normal 'Transfer Player..." option on the 2nd page of the event command window.

Ally/Enemy system
Variables are your friend, along with common events.
Simply set up a variable for each 'enemy' or 'ally' you have and have a parallel common event running to watch over these variables. When ever you help or hinder an ally or enemy it either adds or subtracts from their variable. You can set up their events with different event pages so that when their variable is at so much of a value it changes how they act.

Example: at level 10-20 for an ally ant they come towards you. BUT if it's 0-9 they run from you.

Pretty much anywhere you want a random event to happen or you want a room to have a set limit to hold you'll used conditional branches and variables. Such as when you have a room that holds 25 food units every time your ant adds a food unit to the room event it adds 1 to the rooms variable. A conditional branch in the event will check if the variable is greater then or equal to 25. If it's less it'll allow the addition to the variable. If it's more it'll tell you the room is full.

As far as...
Worker system. if there is food at the top of the anthill the workers will go and get it. and if there is a hostile ant up there the army ants will kill it.
goes you might want to take a look at Mr. Mo's ABS.

After a period of time, the "food" level drops by the amount of ants in the hill. If there is not enough food the ants that didn't get food will die.
You guessed it, a variable. When a new ant is made it subtracts 1 from the food variable. When the food variable is 0 you can't make any more. Also might want to set up the ants/events so they have random count down to take out a food variable. That way when some hit the count down time for taking out food and there isn't any their event is erased. Doing it randomly means that not all of the ants are erased when they hit their count down.

If you need any help with these Ideas drop me a pm. Good luck.
 
Wow thanks! This is all very confusing to me so could you please go to the trouble of making a demo for me? You are the only person who hasn't flamed me on recourse requests! Thanks!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top