Post subject: Back to noob
Joined: 10/2/2015
Posts: 91
I'm having trouble now finding the RAM values I desire... I'm looking for hit box addresses... I need tips. Do hit boxes come in pairs? or in fours? Also, are hit boxes unique to a particular enemy? For example, is EVERY koopa a separate address? What happens when more than one are loaded at once?
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Depends on the game.
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Hitboxes can be inferred from the game code in the ROM. Sometimes, the x offset, y offset, width and height are written in the RAM (e.g. SNES' The Flintstones), but not always. Sometimes, there's a pose address that can affect the dimensions (SNES' The Mask, DKC). Really depends on the game. What's it?
"Also, are hit boxes unique to a particular enemy? For example, is EVERY koopa a separate address?"
Usually, if the sprite type is the same, the rules are equal.
Editor, Expert player (2327)
Joined: 5/15/2007
Posts: 3927
Location: Germany
In Super Mario Land, hitboxes may consist of one value that tells how big the square is. But that's not confirmed. I think that editing said value had a direct influence on how big an enemy's hitbox was, though. So I suppose in some gameboy games, you could try looking for enemy's RAM slots and try editing values there and see if their hitboxes are affected.
Joined: 10/2/2015
Posts: 91
Amaraticando wrote:
Sometimes, there's a pose address that can affect the dimensions (SNES' The Mask, DKC). Really depends on the game. What's it?
LOL dkc
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
To be sure, I've only investigated DKC2 and seen the script of DKC3. I have to verify the 1st game.
Joined: 10/2/2015
Posts: 91
is there an "onloadstate" method for lua? it would really help...
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
BizHawk: event.onloadstate string event.onloadstate(func luaf, [string name = null]) Fires after a state is loaded. Receives a lua function name, and registers it to the event immediately following a successful savestate event Lsnes: on_post_load Called if loading savestate or movie succeeded. Parameter: String name Parameter: boolean is_state. The name of savestate/movie is name. is_state is true if savestate, false for movies. Snes9x 1.51: function savestate.registerload(function func) Registers a function to be called when a state is loaded. Function can be nil. The previous function is returned, possibly nil. The function is passed parameters, if any, returned from a function registered from registersave.
Joined: 10/2/2015
Posts: 91
Amaraticando wrote:
BizHawk: event.onloadstate string event.onloadstate(func luaf, [string name = null])
I essentially want to do something specific WHEN a save state is loaded. How can I make an if statement out of this? Or do I need to instead call a function?
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
RainbowSprinklez wrote:
I essentially want to do something specific WHEN a save state is loaded. How can I make an if statement out of this? Or do I need to instead call a function?
e.g.:
Language: lua

local function LoadStateCallback(...) print("State loaded", ...) -- the vararg is just because I don't know if there're arguments here -- there WAS a bug: paint callback was called before loadstate callback local someAddress = mainmemory.read_u8(0x00f0) if someAddress == 0 then print"address is zero" end end event.onloadstate(LoadStateCallback, "optional name or id")
Joined: 10/2/2015
Posts: 91
ok, thanks. upon reviewing this, it made sense. only question i have now is does this works for ALL savestates? or a specific one?
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Joined: 10/2/2015
Posts: 91
what does this error typically mean? http://imgur.com/a/ANO13
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Masterjun
He/Him
Site Developer, Skilled player (1986)
Joined: 10/12/2010
Posts: 1185
Location: Germany
Syntax Error in your script.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Joined: 10/2/2015
Posts: 91
kind of a big question for you guys... i'm in the market for a new pc... what am i looking for in regards to TASing?
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Player (36)
Joined: 9/11/2004
Posts: 2630
RainbowSprinklez wrote:
kind of a big question for you guys... i'm in the market for a new pc... what am i looking for in regards to TASing?
Typically, the only thing that really matters is your single core CPU speed.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Joined: 10/2/2015
Posts: 91
memory doesn't play any role? sorry, completely ignorant on this and don't want to waste money :/
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Player (36)
Joined: 9/11/2004
Posts: 2630
RainbowSprinklez wrote:
memory doesn't play any role? sorry, completely ignorant on this and don't want to waste money :/
As long as you have sufficient memory, then the only thing you need to worry about with respect to it is its speed and latency (and by extension your motherboard's North Side Bus speed.) But generally, that's not as important as a fast CPU, because most emulation doesn't use a significant amount of memory.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
RainbowSprinklez wrote:
memory doesn't play any role?
- Memory is how much data can be loaded. - CPU speed is how fast this data can be processed. (Clock speed * instructions per clock cycle.) - Number of CPU cores is how many threads/processes can theoretically run in parallel. Most emulators create only one thread. - Graphics card power (almost) doesn't matter (yet). Currently the CPU with the best single-core performance is the i7-4790K. You'll need a motherboard with a matching CPU socket (I got myself a GIGABYTE GA-Z97X-Gaming 5).
Editor, Skilled player (1534)
Joined: 7/9/2010
Posts: 1319
You want to have a good PC if you're looking forward to make TASes with TAStudio/etc. for modern console games. You want have a fast CPU because you almost will never frame-advance, lots of memory for greenzoning. A more outdated PC will be fine, if you only TAS older games. For now multi threading doesn't matter much, but you'll never now what awesome tools will be coming up next. In case you're TASing the tradional method it's fine if you have at least some decent PC.
Favorite animal: STOCK Gt(ROSA)26Sortm1.1(rtTA,EGFP)Nagy Grm7Tg(SMN2)89Ahmb Smn1tm1Msd Tg(SMN2*delta7)4299Ahmb Tg(tetO-SMN2,-luc)#aAhmb/J YouTube Twitch
Joined: 10/2/2015
Posts: 91
i want to create a script that 'maps' out a lvl. i know how to write this in lua, it's pretty basic, my only snag though is getting the script to OUTPUT. i want to write a script that every 60 frames outputs position as well as the camera positions. i have the ram value for these, i just need to know the outputs so i can study the file. Also, in dkc, how can i go about making diddy invincible? by deleting the hitbox or by forcing the game to never let you die?
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Joined: 10/2/2015
Posts: 91
also, is it possible to duplicate the screens? like if i wanted to include a second view fir some reason?
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Joined: 10/2/2015
Posts: 91
Duplicate displays?
No, not quite. What I'm looking for is to pull my game up a second time in the same session. My ultimate goal, is a particular stage the camera is wonky. I;m writing a camera hack for it, but i want to see BOTH where I am and where the camera thinks i am at all times[/quote]
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Joined: 10/2/2015
Posts: 91
What am I doing wrong here?
local frames = 0
local seconds = 0

local function LoadStateCallback('...')
  frames = 0
end

function savestate.registerload(function LoadStateCallback) 


while true do
  local test = frames % 60
  if (test == 0) then
    seconds = seconds + 1
  end  
  gui.text(0,130, "Seconds"..seconds)
  
  emu.frameadvance()
  frames = frames + 1
end
I'm using snes9x btw
I didn't kill donkey, I saved it. Current projects: Misc Donkey hacks :) Past projects: Pacifist DKC1 DKC1 Entrance randomizer DKC2 Entrance randomizer DKDC (a troll hack of DKC1) DKC1 Enemy randomizer (among other things)
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
RainbowSprinklez wrote:
What am I doing wrong here?
function savestate.registerload(function LoadStateCallback) 
This syntax doesn't make sense, for 3 reasons: 1) savestate.registerload returns the previous function registered (or nil). You can't use function before, because that's the way to declare it. 2) you already declared LoadStateCallback before. Using function inside the parenthesis is only for anonymous ones. 3) The vararg is ... without quotes. Not sure why you need that in the first place.
Language: lua

local function LoadStateCallback(...) -- you don't need ... frames = 0 end local PreviousFunction = savestate.registerload(LoadStateCallback) -- you don't need PreviousFunction, do you?
or
Language: lua

savestate.registerload(function() frames = 0 end)