[XP] MCES

Started by nathmatt, May 19, 2011, 10:39:04 am

Previous topic - Next topic

nathmatt

May 19, 2011, 10:39:04 am Last Edit: May 19, 2011, 11:58:09 am by nathmatt
ok so i am trying to get true event clicking so i am trying to create a table of the events visible pixel locations but i cant seem to figure out how to do it so far i have this

class Game_Event < Game_Character
 
 def mouse_over?
   return if !$scene.is_a?(Scene_Map)
   return check_sprite[$mouse.x,$mouse.y] == 0x01
 end
 
 def get_sprite
   return if !$scene.is_a?(Scene_Map)
   $scene.spriteset.character_sprites.each{|s|return s if s.character == self}
 end
 
 def check_sprite
   s = get_sprite
   a = Table.new($game_map.width*32, $game_map.height*32)
   w,h,x,y = s.src_rect.width,s.src_rect.height,s.src_rect.x,s.src_rect.y
   (x..w).each{|xs|(y..h).each{|ys| pix = s.bitmap.get_pixel(xs,ys)
   p s.x-xs/32,s.y-ys/32
   a[s.x-xs,s.y-ys] = 0x01 if pix.alpha == 255}}
   return a
 end
   
end
class Scene_Map;        attr_reader :spriteset         end
class Spriteset_Map;    attr_reader :character_sprites end
class Sprite_Character; attr_reader :ch,:cw            end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Twb6543

This was included in Wora's Christmas Giftbox 2008 over at rmrk.net I believe, you may get a few ideas over there try this link.
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

nathmatt

that doesn't help at all i have already created a script i call (MCES) Mouse Controller Enhancement Script
which is a add_on for Blizzards Mouse controller im trying to rewrite it making it better and im trying to make true event clicking that goes by the pixels of the visible sprite so that it knows the size of the events sprite and create a table to store where those pixels are in relation to the map
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


PhoenixFire

And if I recall correctly, The Wora Xmas pack was for VX...? :P
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

nathmatt

yea it was lol but i checked it they didn't do true event clicking 
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Twb6543

May 19, 2011, 12:31:19 pm #5 Last Edit: May 19, 2011, 12:32:38 pm by Twb6543
Whoops sorry I automatically go to RMVX, sorry about that ..
For the size surely you can just load the sprite into a variable and then use
width = *.bitmap.width
height = *.bitmap.height
// with * being the variable, this would set the width and height variables to the height and width of the bitmap of a sprite.

would that help in any way...
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

PhoenixFire

Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

nathmatt

actually you use
*.src_rect.width
*.src_rect.height

but that doesn't help either somewhere where i am calculating the range of positioning im messing up
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Twb6543

May 19, 2011, 03:42:20 pm #8 Last Edit: May 19, 2011, 03:52:30 pm by Twb6543
Really I shouldn't try to help anyone at this level I'll just stick to my Plain old simple scripts much easier to explain and help, also I think I should mainly stick to VX sorry if I was no help at all, (I know I wasn't)...
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

nathmatt

thats ok doesn't bother me any lol
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

Are you factoring in the sprite's viewport origin?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

i believe so what i doing is first im going through the entire sprites src_rect for pixels with alpha > 0
with that im creating an array of arrays with the current pixel being checked and adding the sprites x & y but its always off
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

What do you by its "off"?
Like it just doesn't register blank pixels of the sprite correctly, or it does, but left/right/above/down of where the sprite actually is?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

May 20, 2011, 11:22:57 am #13 Last Edit: June 04, 2011, 08:03:02 am by nathmatt
how can i put a sprite below a character but above the ground ?

any1 im trying to create a set sprite that shows the location you are moving to but if you click behind an event the image is displayed on top them
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script