 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Sephiron Master Cheater
Reputation: 34
Joined: 23 Aug 2008 Posts: 292 Location: JAPAN circa 1653, fucking some seagulls
|
Posted: Wed Sep 23, 2009 5:32 pm Post subject: Can someone edit this? RGSS question. |
|
|
This is RGSS.
I've taken someone else's script and messed around with it alot.
I've already drawn the first variable named "hunger" on the screen and want to draw my second variable "sleep" in the same window but next to hunger.
Anyone want to help me out?
| Code: | #==============================================================================
# Hunger_Hud
#------------------------------------------------------------------------------
# By: L0rdPh0enix
# Helped by: Khmp, Gando
# 5/4/2008
#------------------------------------------------------------------------------
#==============================================================================
HUD_SWITCH = 1
Variablehunger = 1
class Hunger_Hud < Window_Base
Max_Hunger = 100
Hunger_Bar = 'Hunger_100'
Hunger_Empty = 'Hunger_0'
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize
super(0, 0, 384, 61)
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(0, 3, @empty_bar,
Rect.new(0, 0, @empty_bar.width, @empty_bar.height))
# Now draw the bar.
self.contents.blt(0, 3, @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 if @variablehunger != $game_variables[Variablehunger]
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 |
_________________
| Nirojan wrote: | | picked up 1,.5 g and them budduty picled up quarter o today we blase all of |
 |
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Wed Sep 23, 2009 5:35 pm Post subject: |
|
|
| Sorry, but just to be completely clear, RGSS 1 or 2?
|
|
| Back to top |
|
 |
Sephiron Master Cheater
Reputation: 34
Joined: 23 Aug 2008 Posts: 292 Location: JAPAN circa 1653, fucking some seagulls
|
Posted: Wed Sep 23, 2009 5:36 pm Post subject: |
|
|
| Cryoma wrote: | | Sorry, but just to be completely clear, RGSS 1 or 2? |
1, but since this project is very important to me, i will switch to RMVX if you find a solution.
_________________
| Nirojan wrote: | | picked up 1,.5 g and them budduty picled up quarter o today we blase all of |
 |
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Wed Sep 23, 2009 5:39 pm Post subject: |
|
|
Never used RGSS 1 but this looks like the image and positioning bit:
| Code: | def initialize
super(0, 0, 384, 61)
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 |
Mess around with the 384 and 61 part to position sleep next to hunger.
|
|
| Back to top |
|
 |
Sephiron Master Cheater
Reputation: 34
Joined: 23 Aug 2008 Posts: 292 Location: JAPAN circa 1653, fucking some seagulls
|
Posted: Wed Sep 23, 2009 5:51 pm Post subject: |
|
|
| Cryoma wrote: | Never used RGSS 1 but this looks like the image and positioning bit:
| Code: | def initialize
super(0, 0, 384, 61)
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 |
Mess around with the 384 and 61 part to position sleep next to hunger. |
I already knew that, and that did absolutely nothing.
It's still initializing the hunger variable, and adding
| Code: | def initialize
super(0, 0, 384, 61)
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 |
With changed height and width didn't make a second bar appear...
_________________
| Nirojan wrote: | | picked up 1,.5 g and them budduty picled up quarter o today we blase all of |
 |
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Wed Sep 23, 2009 5:53 pm Post subject: |
|
|
| No idea man, even if you do get it to work, I'd still suggest switching to VX.
|
|
| Back to top |
|
 |
Sephiron Master Cheater
Reputation: 34
Joined: 23 Aug 2008 Posts: 292 Location: JAPAN circa 1653, fucking some seagulls
|
Posted: Wed Sep 23, 2009 5:55 pm Post subject: |
|
|
| Cryoma wrote: | | No idea man, even if you do get it to work, I'd still suggest switching to VX. |
Does VX let you "spawn" an event at player location?
If so, i would, but adding my own content in xv will be a shit on my parade... I heard that it's like 100 times harder than xp to add your own tileset.
_________________
| Nirojan wrote: | | picked up 1,.5 g and them budduty picled up quarter o today we blase all of |
 |
|
| Back to top |
|
 |
Cryoma Member of the Year
Reputation: 198
Joined: 14 Jan 2009 Posts: 1819
|
Posted: Wed Sep 23, 2009 6:12 pm Post subject: |
|
|
Yes, you can spawn at player location.
And adding tilesets is the same, it's making tilesets that's harder.
VX uses a advanced tileset system that has shadows and rounded corners automatically.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|