Calintz's Scripting Questions(Mainly Snippets)

Started by Calintz, February 19, 2009, 02:58:28 am

Previous topic - Next topic

Calintz

Haha, yes Game_Guy...you solved the problem.

I had never actually thought about changing the (X, Y) values of the default placement in Ccoa's script. I knew how, but it hadn't crossed my mind.

Thank you very much Game_Guy XD.

Calintz is now.. .. ..a...
!! LEXIMAN WARRIOR !!


Calintz

Haha thanks Reno...
I might have some more questions soon.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

If you ever want to create your own gold window through script command again use "$gold" instead of "@gold" and see if that works.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Calintz

March 07, 2009, 11:23:09 pm #45 Last Edit: March 07, 2009, 11:24:11 pm by Calintz16438
I just used it on any old map Blizz...
I have found a way around this problem Ryexander, but thanks anyway buddy...

**Thanks to gameguy

fugibo

*only read the first post and the last 4-5 on this page* Zooming in on the map isn't supported in RGSS :(

Blizzard

Doesn't mean it can't be done by using a Tilemap rewrite. <_<;
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

try searching on creation asylum calintz. I saw one there and I tried it and it was pretty good.

Landith

Yeah, there was one there too, it was even used in this one game, although I forgot what it was.
They zoomed in the map for cutscenes, and stuff like that. The only thing wrong with it was that it was pixelated when you zoomed in, but I believe that's near impossible to fix.

Calintz

Of course it's gonna pixelate...Just don't radically zoom in, Lol.
Zoom in to a maximum of 125% or so for a decent effect.

I will look, thanks everyone.

Calintz



Ryex

March 14, 2009, 08:11:03 pm #53 Last Edit: March 14, 2009, 08:15:11 pm by Ryexander
Isn't there a built in method to add hews to a bitmap?

Quote from: Rgss reference
Sprite
The sprite class. Sprites are the basic concept used to display characters, etc. on the game screen.

flash(color, duration)
Begins flashing the sprite. duration specifies the number of frames the flash will last.

If color is set to nil, the sprite will disappear while flashing.

color
The color (Color) to be blended with the sprite. Alpha values are used in the blending ratio. (uses a color object)

Handled separately from the color blended into a flash effect. However, the color with the higher alpha value when displayed will have the higher priority when blended.

tone
The sprite's color tone (Tone). (uses a Tone object not a color object)



Color
The RGBA color class. Each component is handled with a floating point value (Float).

SuperclassObject
Class MethodColor.new(red, green, blue[, alpha])
Creates a Color object. If alpha is omitted, it is assumed at 255.

Methodset(red, green, blue[, alpha])
Sets all components at once.

Propertiesred
The red value (0-255). Values out of range are automatically corrected.

green
The green value (0-255). Values out of range are automatically corrected.

blue
The blue value (0-255). Values out of range are automatically corrected.

alpha
The alpha value (0-255). Values out of range are automatically corrected.



The color tone class. Each component is handled with a floating point value (Float).

SuperclassObject
Class MethodTone.new(red, green, blue[, gray])
Creates a Tone object. If gray is omitted, it is assumed at 0.

Methodset(red, green, blue[, gray])
Sets all components at once.

Propertiesred
The red balance adjustment value (-255 to 255). Values out of range are automatically corrected.

green
The green balance adjustment value (-255 to 255). Values out of range are automatically corrected.

blue
The blue balance adjustment value (-255 to 255). Values out of range are automatically corrected.

gray
The grayscale filter strength (0 to 255). Values out of range are automatically corrected.

When this value is not 0, processing time is significantly longer than when using tone balance adjustment values alone.






If I understand it correctly basically to blink an icon you would have to do this.  any one else feel free to correct me.

#create sprite use this cone to create a sprite
@icon = Sprite.new
@icon.bitmap = Bitmap.new(width, height)
@icon.bitmap.blt(x, y, RPG::Cache.icon("Icon_name_here"), Rect.new(x, y, width, height))
@icon_alpha = 0
@icon_mode = 1
#flash icon call the method every frame that you are flashing the icon
def flash_icon
    if @icon_mode == 1
         @icon_alpha += 5
         if @icon_alpha > 255
              @icon_alpha = 255
         end
         if @icon_alpha == 255
              @icon_mode = 0
         end
    elsif @icon_mode == 0
         @icon_alpha _= 5
         if @icon_alpha < 0
              @icon_alpha = 0
         end
         if @icon_alpha == 0
              @icon_mode = 1
         end
    end
    icon_color = Color.new(255, 255, 255, @icon_alpha)
    @icon.color = icon_color
end


The code creates a sprite object and then the  flash_icon method blends a wight color with the sprite and changes tha alpha of the blended color depending on the previous alpha. feel free to change the color blended or the alpha limits.

please note that I have not tested this so I'm not sure that the commands for creating the bitmap in the sprite or changing the icons color are correct, but the idea should be right.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Reno-s--Joker

From Game_Map:
To the person who wants to help with the tile jumping: ShowHide
  #--------------------------------------------------------------------------
  # * Determine if Passable
  #     x : x-coordinate
  #     y : y-coordinate
  #     d : direction (0,2,4,6,8)
  #         * 0 = Determines if all directions are impassable (for jumping)
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
      # impassable
      return false
    end
    # If through is ON
    if @through
      # passable
      return true
    end
    # If unable to leave first move tile in designated direction
    unless $game_map.passable?(x, y, d, self)
      # impassable
      return false
    end
    # If unable to enter move tile in designated direction
    unless $game_map.passable?(new_x, new_y, 10 - d)
      # impassable
      return false
    end
    # Loop all events
    for event in $game_map.events.values
      # If event coordinates are consistent with move destination
      if event.x == new_x and event.y == new_y
        # If through is OFF
        unless event.through
          # If self is event
          if self != $game_player
            # impassable
            return false
          end
          # With self as the player and partner graphic as character
          if event.character_name != ""
            # impassable
            return false
          end
        end
      end
    end
    # If player coordinates are consistent with move destination
    if $game_player.x == new_x and $game_player.y == new_y
      # If through is OFF
      unless $game_player.through
        # If your own graphic is the character
        if @character_name != ""
          # impassable
          return false
        end
      end
    end
    # passable
    return true
  end

You'd probably have to incorporate it with your jumping script.

I changed my mind, but I haven't tested it: ShowHide
case $game_player.direction
  when 2
    if $game_map.passable?($game_player.x, $game_player.y+2, 0)
      disable_jump
    end
  when 4
    if $game_map.passable?($game_player.x-2, $game_player.y+2, 0)
      disable_jump
    end
  when 6
    if $game_map.passable?($game_player.x+2, $game_player.y+2, 0)
      disable_jump
    end
  when 8
    if $game_map.passable?($game_player.x, $game_player.y-2, 0)
      disable_jump
    end
  end
   

Calintz

March 15, 2009, 04:26:00 am #55 Last Edit: March 15, 2009, 04:29:34 am by Calintz16438
I'm not using a script.
My Running and Jumping System is event oriented. XD

But hopefully, your post will aide someone else.

edit
I thought for sure it was gonna have something to do with this...
# If unable to enter move tile in designated direction
    unless $game_map.passable?(new_x, new_y, 10 - d)
      # impassable
      return false
    end

G_G

are you wanting to see how many members are the party? If so


if $game_party.actors == 1
  Blah here
else
  if $game_party.actors == 2
    blah here
  else
    if $game_party.actors == 3
      blah here
    else
      if $game_party.actors == 4
        blah here
      end
    end
  end
end
[code]

Just select teh code thing in the 4th tab in a Conditional branch.
[/code]

Calintz


G_G

Yes I've used it when I created a custom menu asystem before

Calintz

Okay thank you...I will go test now, and...
*power up*