Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - newold

1
Doodad's Editor
Authors: Newold
Version: 1.0
Type: Custom Mapping System
Key Term: Game Utility



Introduction

With this tool you can enrich your maps with different images (even animated images). In game, you press F8 and the Doodads's Editor appear (only available in Debug Mode).


Features


  • Easy manager for your doodads with a beauty external editor

  • Auto installable

  • Compatible with RPG Maker XP, VX and VX ACE projects

  • Press F1 in the Doodad's Editor to display help

  • 2 DLL included: One with the embedded doodads editor and another lighter version without the editor (with light dll the doodads can not be edited)




Screenshots

Video available Here => https://www.youtube.com/watch?v=pJU2QAhAI84




Demo

Download Here (installer program): http://www.mediafire.com/file/aze4r7pgv6t5tg6/Doodads_Editor.rar/file


Script




Instructions

Installation is very simple. Just download the installer program. Unzip to the folder of your choice (rar file) and run executable Doodads Editor Installer.exe




Compatibility

This program required .NET Frameworks 2.0 (for the light dll) or  .NET Frameworks 4.0 (for the full dll)


Credits and Thanks


  • Me for sure ;)

  • and ForeverZer0 for Rpg.NET Export




Author's Notes

Enjoy
2
Sea of Code / Re: Help with dll to use with RPG Maker
September 05, 2018, 05:06:12 am
Thanks for the info! I could solve the problem. In ruby pack i needed use 'p' for string, my string in ruby needed fixed length and in my dll i need use memcpy to change string. Now works perfet Thanks.
3
Sea of Code / Help with dll to use with RPG Maker
September 04, 2018, 05:56:16 pm
Hi all. I have the following problem:

In RPG Maker i have an array with this struct: [long, long, string]. Then, using Ruby function pack, i create this string:  [long, long, string].pack("lla*") and then i pass this string to my dll and i try change values with my function in dll. I can change value 0 and value 1, but not my string (value 2)

c++ DLL:

#include "stdafx.h"
#include <iostream>
#include <windows.h>

#define RGSSApi extern "C" __declspec(dllexport)

// I pass this struct from RPG Maker
struct ALGO
{
long value1;
long value2;
char * value3;
};


// This function is called by rpg maker and modify values.
RGSSApi void prueba(ALGO * object)
{
object->value1 = 100;
object->value2 += 200;
object->value3 = (char *)"other text";

}


RGSS script:

# My DLL
f = Win32API.new("f/MyDll.dll", "prueba", "P", "")

a = [1, 10, "Initial Text"] # My array

t = a.pack("lla*") # Pack array to string

# Show array 'a' contents, current 't' and 't' unpack
# a[0] = 1,  a[1] = 10,  a[2] = "Initial Text"
p a, t, t.unpack("lla*")

f.call(t) # Call function in c++ passing the value 't'

# Show array 'a' contents, current 't' and 't' unpack
# a[0] = 100,  a[1] = 210,  a[2] = value is wrong (it is different to "initial Text" (defined in rgss) and different to "other text" (defined in dll))
p a, t, t.unpack("lla*")

exit




any help here? im stuck :(
4
RMXP Script Database / Tetra Master [XP][VX][VXA]
March 18, 2017, 04:22:27 pm
TETRA MASTER
Authors: NEWOLD
Version: 0.1 - alpha
Type: CARDS MINI GAME (TETRA MASTER - FF IX)
Key Term: Minigame



Introduction

TETRAMASTER  is the game of cards of Final Fantasy 9. You can add it to RPG Maker XP, VX or ACE and works as minigame for your games.


Features


  • RPG MAKER XP, VX and ACE compatible

  • Easy config tool to config scripts

  • Scripts auto-installables

  • You can create custom messages for each enemies, for each turns, when win game, when lose game and when draw games

  • Support animate cards image

  • Include differents rules and pay methods when finish a battle

  • Script can activate/deactivate local switches and switches or change variable values when you lose or win a battle of cards

  • You can create uniq cards (Uniq cards there is only one. If you lose a uniq card, you can play with enemy that stole it to try recover the card if he play it)

  • If you lose a normal card, it is lose forever

  • You can create blocks that when it get destroyed, can give a buf/debuf at your cards or enemy cards

  • During the fighting, cards can show animations (animations from your game database)

  • Custom windows

  • Shop to sell/buy cards

  • Cards Album




Screenshots
Current Version Preview (no available for download yet)


Editor preview



Demo

Version alpha 0.1 (i upload current version in a few days)
Editor: Edtor Tetra Master
Demo: DEMO RPG MAKER XP (You can play the mini game "TetraMaster" talking to NPCs with the "D" key on your keyboards)


Script

see demo


Instructions

see editor


Compatibility




Credits and Thanks


  • Script Circular Gauges by efeberk

  • Galenmereth / Tor Damian Design (Formulas used in script 05 - Alter Motion)




Author's Notes

Scripts are in development phase. Stay tuned for updates
5
Scene Flying Letters
Authors: Newold
Version: 1.0
Type: Scene Flying letters
Key Term: Misc Add-on



Introduction

Create a scene how Star Wars intro


Features


  • Plug & Play

  • RPG Maker XP compatible

  • RPG Maker VX compatible

  • RPG Maker VX ACE compatible




Screenshots


Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide



Demo

no available.


Script

Spoiler: ShowHide
=begin
==============================================================================

SCRIPT CREADO POR NEWOLD
DE USO LIBRE PARA JUEGOS NO COMERCIALES

Título: Star Wars Letters
Para qué Sirve: Simula el efecto de letras volando por el espacio de star wars.
Fecha de Creación: 12-09-2014
Versión: 1.0

SI QUIERES USARLO EN UN PROYECTO COMERCIAL PONTE EN CONTACTO CONMIGO
todobasura31@hotmail.es

Instalación: Colocarlo encima del main (Compatible con RPG Maker XP, VX y ACE)

Para inicializar el script poner esto:

 scene = StarWarsLetters.new
 
Para configurar los diferentes apartados del script usad estos comandos:
-----------------------------------------------------------------------------
* Tipografía del texto:

scene.fontName = 'Nombre de la fuente'

* Color del texto:

scene.fontColor= color # color = Color.new(r,g,b,a)
                       # r,g,b,a = número entre 0-255

* Tamaño del texto:

scene.fontSize = número

* Altura máxima que alcanza el texto:

scene.top = número

* Tiempo en segundos en alcanzar el máximo alto:

scene.time = número

* Sesgado del texto

scene.angled = número

* Máximo zoom:

scene.maxZoom = número

* Espacio en píxels entre un texto y otro:

scene.margin = número

* Resolución del maker horizontal:

scene.w = número

* Resolución del maker vertical:

scene.h = número

* Añadir un fondo con o sin movimiento:

scene.set_background('Dirección imagen',velocidad X, Velocidad Y)

* Añadir música de fondo:

scene.set_music('Dirección música',volumen)

* Añadir el texto que vuela por la pantalla:

scene.data = ['Texto1', 'Texto2', '...', 'textoN']

* Añadir Título/s inical/es antes de que vuele el texto:

scene.set_title(title,fontName,fontSize,fontColor, align, zoom, time,timeout)

 title = ['Texto para ese título']  # ['line1','line2','...','lineN']
 fontName = 'Nombre de la tipografía'
 fontSize = número # Tamaño del texto
 fontColor = color
 # color = Color.new(r,g,b,a) || r,g,b,a = número entre 0-255
 align = número # Alineación del texto || 0 = Izquierda, 1 = Centro, 2 = Derecha
 zoom = número # Zoom para el texto.
               # Si pones un zoom diferente de 1 se producirá un efecto
               # de zoom-out. Si lo pones en 1 el efecto será opacity-out.
 time = número # Tiempo en segundos que tarda en aparecer el texto
 timeout = número # Tiempo en segundos que tarda en desaparecer el texto
 
-----------------------------------------------------------------------------

Una vez configurado el script usa el comando

scene.preload

para realizar una precarga de datos y usa el comando

scene.start para mostrar el resultado.

(Nota: El script termina cuando el texto volador se pierde en el horizonte
o cuando se pulsa B y ya no se está mostrando ningún título inicial.
Si se pulsa B mientras se muestra un título éste termina y se muestra el
siguiente si ubiera o se empieza a mostrar el texto volador)
 
==============================================================================
=end


# ==============================================================================
class Point # by Newold
 #--------------------------------------------------------------------------
 attr_accessor  :x
 attr_accessor  :y
 #--------------------------------------------------------------------------
 def initialize(x=0,y=0)
   @x = x; @y = y
 end
 #--------------------------------------------------------------------------
 def ==(point)
   return (self.x == point.x and self.y == point.y)
 end
 #--------------------------------------------------------------------------
 def ===(point)
   return (self.x.eql?(point.x) and self.y.eql?(point.y))
 end
 #--------------------------------------------------------------------------
 def to_a
   return [self.x.floor,self.y.floor]
 end
 #--------------------------------------------------------------------------
 def to_s
   return "[#{self.x.to_i}x, #{self.y.to_i}y]"
 end
 #--------------------------------------------------------------------------
 def dup
   return Point.new(@x,@y)
 end
 #--------------------------------------------------------------------------
 def _dump(d=0)
   s = [3].pack('L')
   s = [@x].pack("F")
   s << [@y].pack("F")
   s
 end
 #--------------------------------------------------------------------------
 def self._load(s)
   x = s[0,4].unpack("F")[0]
   y = s[4,4].unpack("F")[0]
   point = Point.new(x,y)
   return point
 end
end
# ==============================================================================

#===============================================================================
class Bitmap # << by NEWOLD
 #--------------------------------------------------------------------------
 #  transferPoint:
 
 #  Transfiere un punto de una imagen a otra deformada tomando en cuenta las
 #  4 esquinas de la imagen normal y las 4 esquinas de la imagen deformada

 #  Parámetetros:
 
 #  xI = Coordenada x en la imagen original
 #  yI = Coordenada y en la imagen original

 #  source = Array de esquinas de la imagen original
 #  (siguiendo el sentido de las agujas del reloj
 #  desde esquina superior izquierda a esquina inferior izquierda)
 #  Ejemplo:
 #  source = [];
 #  source[0] = Point.new(0, 0);
 #  source[2] = Point.new(200,100);

 #  destination = Array de esquinas de la imagen distorsionada (perspectiva)
 #  (siguiendo el sentido de las agujas del reloj
 #  desde esquina superior izquierda a esquina inferior izquierda)
 #  Ejemplo:
 #  destination = [];
 #  destination[n] = Point.new(0, 0); # n= 0...4
 
 #--------------------------------------------------------------------------
 def transferPoint (xI, yI, source, destination)
   adding = 0.001; # (para evitar dividir por 0)
 
   xA = source[0].x.to_f;
   yA = source[0].y.to_f;
 
   xC = source[2].x.to_f;
   yC = source[2].y.to_f;
     
   xAu = destination[0].x.to_f;
   yAu = destination[0].y.to_f;
 
   xBu = destination[1].x.to_f;
   yBu = destination[1].y.to_f;
 
   xCu = destination[2].x.to_f;
   yCu = destination[2].y.to_f;
 
   xDu = destination[3].x.to_f;
   yDu = destination[3].y.to_f;
 
   # Cálculos
   # (si los puntos son iguales hay que añadir 'adding' para evitar división 0)
   if (xBu==xCu); xCu+=adding; end;
   if (xAu==xDu); xDu+=adding; end;
   if (xAu==xBu); xBu+=adding; end;
   if (xDu==xCu); xCu+=adding; end;
   kBC = (yBu-yCu)/(xBu-xCu);
   kAD = (yAu-yDu)/(xAu-xDu);
   kAB = (yAu-yBu)/(xAu-xBu);
   kDC = (yDu-yCu)/(xDu-xCu);
 
   if (kBC==kAD); kAD+=adding; end;
   xE = (kBC*xBu - kAD*xAu + yAu - yBu) / (kBC-kAD);
   yE = kBC*(xE - xBu) + yBu;
 
   if (kAB==kDC); kDC+=adding; end;
   xF = (kAB*xBu - kDC*xCu + yCu - yBu) / (kAB-kDC);
   yF = kAB*(xF - xBu) + yBu;
 
   if (xE==xF); xF+=adding; end;
   kEF = (yE-yF) / (xE-xF);
 
   if (kEF==kAB); kAB+=adding; end;
   xG = (kEF*xDu - kAB*xAu + yAu - yDu) / (kEF-kAB);
   yG = kEF*(xG - xDu) + yDu;
 
   if (kEF==kBC); kBC+=adding; end;
   xH = (kEF*xDu - kBC*xBu + yBu - yDu) / (kEF-kBC);
   yH = kEF*(xH - xDu) + yDu;
 
   rG = (yC-yI)/(yC-yA);
   rH = (xI-xA)/(xC-xA);
 
   xJ = (xG-xDu)*rG + xDu;
   yJ = (yG-yDu)*rG + yDu;
 
   xK = (xH-xDu)*rH + xDu;
   yK = (yH-yDu)*rH + yDu;
 
   if (xF==xJ); xJ+=adding; end;
   if (xE==xK); xK+=adding; end;
   kJF = (yF-yJ) / (xF-xJ);
   kKE = (yE-yK) / (xE-xK);
 
   if (kJF==kKE); kKE+=adding; end;
   xIu = (kJF*xF - kKE*xE + yE - yF) / (kJF-kKE);
   yIu = kJF * (xIu - xJ) + yJ;
 
   b=Point.new(xIu.floor,yIu.floor);
   return b;
 end
 #--------------------------------------------------------------------------
end
#===============================================================================


# ==============================================================================
class StarWarsLetters
 #--------------------------------------------------------------------------
 attr_accessor :fontName, :fontSize, :fontColor, :data, :top, :time, :angled,
               :maxZoom, :margin, :w, :h
 #--------------------------------------------------------------------------
 def initialize(*args)
   @fontName = args[0].nil? ? ['Verdana','Times New Roman','Arial'] : args[0]
   @fontSize = args[1].nil? ? 46 : [args[1].to_i,6].max
   @fontColor = args[2].nil? ? Color.new(255,255,0) : args[2]
   @data = args[3].nil? ? [] : args[3]
   @top = args[4].nil? ? 270 : args[4].to_i
   @time = args[5].nil? ? 35 : [args[5].to_i,1].max
   @angled = args[6].nil? ? 85.0 : ([args[6].to_i,0].max).to_f
   @maxZoom = args[7].nil? ? 2.5 : ([args[7].to_i,0.1].max).to_f
   @margin = args[8].nil? ? -30 : args[8].to_i
   @background = nil
   @vx = 0
   @vy = 0
   @ox = @oy = 0
   @music = nil
   @maxVol = 100
   @vol = 0
   @sprites = []
   @points = {}
   @w = 640
   @h = 480
   @title = []
 end
 #--------------------------------------------------------------------------
 def set_title(title,fontName='Verdana',fontSize=36,
   fontColor=Color.new(0,0,160), align=0, zoom=1.0, time=3,timeout=4)
   timer = time * Graphics.frame_rate * 1.0
   timer2 = timeout * Graphics.frame_rate * 1.0
   b = Bitmap.new(1,1)
   b.font.name = fontName
   b.font.size = fontSize
   w = h = 1
   for i in 0...title.size
     size = b.text_size(title[i].to_s)
     w = size.width if w < size.width
     h = size.height if h < size.height
   end
   s = Sprite.new
   s.bitmap = Bitmap.new(w,h*(title.size > 0 ? title.size : 1))
   s.bitmap.font.name = fontName
   s.bitmap.font.size = fontSize
   s.bitmap.font.color = fontColor
   for i in 0...title.size
     s.bitmap.draw_text(0,h*i,w,h,title[i],align)
   end
   s.zoom_x = s.zoom_y = zoom
   s.opacity = 0
   s.x = (@w/2) - (s.bitmap.width * s.zoom_x / 2)
   s.y = (@h/2) - (s.bitmap.height * s.zoom_y / 2)
   @title << [s,timer,timer2,true,zoom,zoom/(timer+timer2)]
 end
 #--------------------------------------------------------------------------
 def set_background(dir,vx=0,vy=0)
   @background = Plane.new
   @background.bitmap = Bitmap.new(dir)
   @background.visible = false
   @vx = vx.to_f
   @vy = vy.to_f
 end
 #--------------------------------------------------------------------------
 def set_music(dir,vol=100)
   @music = dir
   @maxVol = vol
 end
 #--------------------------------------------------------------------------
 def find_zoom(text)
   b = Bitmap.new(1,1)
   b.font.name = @fontName
   b.font.size = @fontSize
   zoom = 1
   size = b.text_size(text)
   if size.width == 0 or size.height == 0
     p "Font <#{@fontName}> incompatible with this RPG MAKER"
     p "Using font... ['Verdana','Times New Roman','Arial']"
     @fontName = ['Verdana','Times New Roman','Arial']
     find_zoom(text)
     return
   end
   while size.height * zoom < 115
     zoom += 0.1
   end
   while size.width * zoom > @w + 384
     zoom -= 0.1
   end
   @maxZoom = zoom
 end
 #--------------------------------------------------------------------------
 def start
   
   b = Bitmap.new(1,1)
   b.font.name = @fontName
   b.font.size = @fontSize
   size = b.text_size(' ')
   if size.width == 0 or size.height == 0
     p "Font <#{@fontName}> incompatible with this RPG MAKER"
     p "Using font... ['Verdana','Times New Roman','Arial']"
     @fontName = ['Verdana','Times New Roman','Arial']
   end
   Graphics.freeze
   unless @background.nil?
     @background.visible = true
   end
   Graphics.transition(20)
   while @data.size > 0 or @sprites.size > 0
     Input.update
     update
     update_background
     update_music
     Graphics.update
     if Input.trigger?(Input::B)
       if @title.size > 0
         obj = @title.shift
         obj[0].dispose
       else
         break
       end
     end
   end
   Graphics.freeze
   dispose
   Graphics.transition(20)
 end
 #--------------------------------------------------------------------------
 def update
   if @title.size > 0
     obj = @title[0]
     if obj[3]
       obj[1] -= 1
       obj[3] = false if obj[1] <= 0
       obj[0].opacity += 1
     else
       obj[2] -= 1
       if obj[2] < 22
         obj[0].opacity -= 12
       end
       if obj[2] <= 0
         @title.delete(obj)
         return
       end
     end
     if obj[4] != 1.0
       obj[0].zoom_x -= obj[5]
       obj[0].zoom_y = obj[0].zoom_x
       obj[0].x = (@w/2) - (obj[0].bitmap.width * obj[0].zoom_x / 2)
       obj[0].y = (@h/2) - (obj[0].bitmap.height * obj[0].zoom_y / 2)
     end
     return
   end
   if (@sprites.size == 0) or
     (@sprites[-1][0].y + @margin +
     @sprites[-1][0].bitmap.height * @sprites[-1][0].zoom_y <= @h)
     draw
   end
   timer = @time * Graphics.frame_rate * 1.0
   ratioZoom = @maxZoom / timer
   @sprites.each {|obj|
     obj[2] = obj[2] + ((@top - obj[2]) / timer)
     obj[0].y = [obj[2],@top].max - (obj[0].bitmap.height * obj[0].zoom_y / 2)
     if obj[0].y <= @top or obj[0].zoom_x < 0.4
       obj[0].opacity -= 2
       if obj[0].opacity == 0
         @sprites.delete(obj)
       end
     else
       obj[0].opacity += 2
     end
     obj[0].x = @w/2 - (obj[0].bitmap.width * obj[0].zoom_x / 2)
     ratioZoom = obj[0].zoom_x / timer
     obj[0].zoom_x -= ratioZoom
     obj[0].zoom_y = obj[0].zoom_x
   }
 end
 #--------------------------------------------------------------------------
 def update_background
   return if @background.nil?
   @ox += @vx
   @oy += @vy
   @background.ox = @ox
   @background.oy = @oy
 end
 #--------------------------------------------------------------------------
 def update_music
   return if @music.nil?
   Audio.bgm_play(@music,@vol)
   @vol = [@vol+5,@maxVol].max
 end
 #--------------------------------------------------------------------------
 def preload
   data = @data.dup
   while @data.size > 0
     draw(true)
   end
   @data = data
 end
 #--------------------------------------------------------------------------
 def draw(pl = false)
   text = @data.shift
   return if text.nil?
   b = Bitmap.new(10,10)
   b.font.name = @fontName
   b.font.size = @fontSize
   size = b.text_size(' ')
   s = Sprite.new
   s.bitmap = Bitmap.new(@w,size.height)
   s.bitmap.font.name = @fontName
   s.bitmap.font.size = @fontSize
   s.bitmap.font.color = @fontColor
   while s.bitmap.text_size(text).width > @w
     s.bitmap.font.size -= 1
   end
   s.bitmap.draw_text(0,0,@w,size.height,text,1)
   
   if @points.size == 0
     sz = s.bitmap.text_size(' ')
     source = [Point.new(0.0,0.0),nil,
     Point.new(s.bitmap.width.to_f+sz.width,s.bitmap.height.to_f+sz.height),nil]
     
     point1 = Point.new(@angled,0.0)
     point2 = Point.new(s.bitmap.width-@angled,0.0)
     point3 = Point.new(s.bitmap.width.to_f,s.bitmap.height.to_f)
     point4 = Point.new(0.0,s.bitmap.height.to_f)
     
     destination = [point1,point2,point3,point4]
     
     for y in 0...s.bitmap.height
       for x in 0...s.bitmap.width
         point = b.transferPoint(x.to_f, y.to_f, source, destination)
         @points[[x,y]] = [point.x,point.y]
       end
     end
   end
   if pl
     s.dispose
     return
   end
   b = s.bitmap.dup
   s.bitmap.clear
   for y in 0...s.bitmap.height
     for x in 0...s.bitmap.width
       color = b.get_pixel(x,y)
       s.bitmap.set_pixel(@points[[x,y]][0],@points[[x,y]][1],color)
     end
   end
   
   s.zoom_x = s.zoom_y = @maxZoom
   s.x = @w/2 - (s.bitmap.width * s.zoom_x / 2)
   s.y = @h + (s.bitmap.height * s.zoom_x / 2)
   s.opacity = 0
   
   @sprites << [s,s.x,s.y]
 end
 #--------------------------------------------------------------------------
 def dispose
   @sprites.each {|obj| obj[0].dispose}
   @sprites = []
   @title.each {|obj| obj[0].dispose}
   @title = []
 end
 #--------------------------------------------------------------------------
end
# ==============================================================================



Instructions


  • Put Script over main in you proyect

  • SET A NEW SCENE:

  • Command Initialize Script: scene = StarWarsLetters.new

  • CONFIGURE SCRIPT:

  • Font Name: scene.fontName = 'Font Name'

  • Font Color: scene.fontColor = color # color = Color.new(r,g,b,a) || r,g,b,a = number between 0-255

  • Font Size: scene.fontSize = number

  • Horizon height: scene.top = number

  • Time to reach the horizon: scene.time = number

  • Perspective Text Size (see explanatory image): scene.angled = number
    ]

  • Max Zoom: scene.maxZoom = number

  • Space between lines in flying text: scene.margin = number

  • Horizontal Screen Size (Width): scene.w = number

  • Vertical Screen Size (Height): scene.h = number

  • Add Background with/out movement: scene.set_background('Image dir',velocity X, Velocity Y)

  • Add background Music: scene.set_music('Music dir',volume)

  • Add Flying Text over Screen: scene.data = ['Text1', 'Text2', '...', 'textN']

  • Add Initial titles (see it before flying text): scene.set_title(title,fontName,fontSize,fontColor, align, zoom, time,timeout)
    title = ['Text for this title'] # ['Line1','Line2','...','LineN']
    fontName = 'Font Name'
    fontSize = number# Text Size
    fontColor = color # color = Color.new(r,g,b,a) || r,g,b,a = number between 0-255
    align = number# Text Align || 0 = Left, 1 = Center, 2 = Right
    zoom = number# Text Zoom || <> 1 effect zoom-out. == 1 effect opacity-out.
    time = number # Initial time in seconds (appearing text)
    timeout = number# Final time in seconds (disappearing text)

  • END CCONFIGURATION:

  • SHOW RESULT

  • scene.preload
    scene.start




Compatibility



Credits and Thanks


  • me!




Author's Notes


  • Script finish when all text disappear in a horizont or player press B button.

  • You can define 1 o more titles

  • Instruction in script are in spanish

  • You can use this script for non comercial games only

6
Quote from: Blizzard on September 05, 2014, 03:01:04 pm
I think you might have to use RegisterClass or RegisterClassEx first to make this work properly.


i dont know what is the code to create a class window with rgss, i did this:

newClass = Struct.new(:cbSize,:style,:lpfnWndProc,:cbClsExtra,:cbWndExtra,
   :hInstance,:hIcon,:hCursor,:hbrBackground,:lpszMenuName,:lpszClassName,
   :hIconSm)
   
 wndclass = newClass.new

 wndclass.cbSize = wndclass.size
 wndclass.style = 0
 wndclass.lpfnWndProc = 0
 wndclass.cbClsExtra = 0
 wndclass.cbWndExtra = 0
 wndclass.hInstance = nil
 wndclass.hIcon = nil
 wndclass.hCursor = nil
 wndclass.hbrBackground = 5 # COLOR_WINDOW
 wndclass.lpszMenuName = nil
 wndclass.lpszClassName = "testclass"
 wndclass.hIconSm = nil

registerClass = Win32API.new('user32','RegisterClass','i','i')
aTom = registerClass.call(??????????)


i dont know how send wndclass to registerClass.call()




Quote from: ForeverZer0You can take a look at what I did here.

http://forum.chaos-project.com/index.php/topic,7829.0.html

Might help you figure out your problem.


Your window dont is child from parent window, it work but i want my window be a child from parent (if you move parent window, child window move too)
7
I am trying do a textbox with win32API with this code in rpg maker

#___________________________________________________________________________
ini = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')
@title = "\0" * 256
ini.call('Game', 'Title', '', @title, 256, '.\\Game.ini')
@title.delete!("\0")
# Getel hwnd from rgss player
@hwnd = Win32API.new('user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', @title)

@create_window = Win32API.new('user32','CreateWindowEx','lpplllllllll','l')
# Build textbox
#style = WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|ES_MULTILINE
style = 0x40000000|0x02000000|0x00200000|0x0004
x, y, w, h = 100, 100, 160, 120
@script_window = @create_window.call(0, 'Edit', '', style, x, y, w,h, @hwnd, 0, 0, 0)
#___________________________________________________________________________

i want create the window edit as child of parent window (rgss player). With that code i get create de window as chlid but it appear behind of the parent window. If you put de mouse over edit window it blink, shown by an instant and sets again behind the parent window (the edit window work but it is behind the parent window).

How i get that my child window set over the parent window and dont blink or get behind again?
8
RMXP Script Database / [XP][VX][VXA] New Transition script
September 20, 2013, 03:45:14 pm
NEW TRANSITION FOR ALL RPG MAKERS
Authors: NEWOLD
Version: 1.0
Type: Displays a transition similar to Paper Mario game in Game Cube
(Great for use before changing scene!!!)

Key Term: Misc Add-on



Introduction

I bring a new transition for all rpg makers (yes, compatible with xp, vx and vx ace.)
you only must copy this script over main and read the instructions in the script


Features


  • Easy install

  • Easy command

  • Cool transition if you're bored of the old transitions




Screenshots

no screenshots available.


Demo

no demo available.


Script

XP and VX use this script:
Spoiler: ShowHide
=begin

 SCRIPT CREATED BY NEWOLD
 20-09-2013
 FREE USE
 DESCRIPTION
 
   Displays a transition similar to Paper Mario game in Game Cube
   (Great for use before changing scene!!!)
   
   (You can watch a preview in this video in minute 3:13
   
   http://www.youtube.com/watch?v=RayrWDD7O10
   
   )
   
   
******************************** INSTRUCTION ********************************

Put over main script.

You call this transition using command call script and write this code

---------------------------------------------------------------------------
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

PPT.set(
'image*',
'fx*',
Columns*,Rows*,EventsList*)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---------------------------------------------------------------------------

and change values marked with * with the following:

--------------------------------------------------------------------------------

- image* : filename of the image to display in your game folder.
You can add an animated image that is divided into several rows and columns
adding at the end the name of the image as follows:

[a number]  (Example: [7]) indicates that the image is divided into
x columns (7 columns in the example)

[a number, other number] (Ejemplo: [7,5]) indicates that the image is divided into
x columns and y rows (7 columns and 5 rows in the example)

examples:

flower      <- image called flower divided into 1 column and 1 row
flower[2]   <- image called flower divided into 2 column and 1 row
flower[2,2] <- image called flower divided into 2 columns and 2 rows

--------------------------------------------------------------------------------

- fx* : filename of the sound to play when each image appear.
(nil if you don't want to put a sound)

--------------------------------------------------------------------------------

- Columns* : Number of columns of images that will be on display

--------------------------------------------------------------------------------

- Rows* : Number of rows of images that will be on display

--------------------------------------------------------------------------------

- EventsList* : List of ids corresponding to events that will be updated
while playing the transition ([ID 1, ID 2, ID 3, ...])

--------------------------------------------------------------------------------


Global Example:

PPT.set(
'Graphics/Pictures/Image01[6,1]',
'Audio/SE/sound01',
5,4,[5,6,1,16])

=end


#==============================================================================
module PPT
 #--------------------------------------------------------------------------
 def PPT.set(image,fx=nil,dH=16,dV=16,events_list=[])
     @fx = fx
     @dH = dH
     @dV = dV
     @max = @dH * @dV
     @x, @y = 0, 0
     @hidden = false
     @sprites = []
     @mode1 = 0
     @mode2 = 0
     @cnt = 1
     @events_list = events_list
     if defined?(Graphics.width) and defined?(Graphics.height)
        @w, @h = Graphics.width, Graphics.height
     else
        @w, @h = 640, 480
     end
     w, h = @w/@dH,@h/@dV
     @modX = (@w - (w * @dH)) / 2
     @modY = (@h - (h * @dV)) / 2
     @b = Bitmap.new(@w/@dH,@h/@dV)
     image.match(/\[(\d+)]|\[(\d+),(\d+)]/)
     unless $2.nil?
        @frameW, @frameH = [$2.to_i,1].max, [$3.to_i,1].max
     else
        @frameW = $1.nil? ? 1 : [$1.to_i,1].max
        @frameH = 1
     end
     begin
        @pattern = Bitmap.new(image)
     rescue => e
        @pattern = Bitmap.new(1,1)
     end
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.stretch_blt(@b.rect,@pattern,rect)
     self.run
  end
  #--------------------------------------------------------------------------
 def PPT.eliminate_sprites
   @showing_sprites = false
   z = 255.0 / @sprites.size
   z2 = 255 - z
   @sprites.reverse.each {|s|
     Audio.se_play(@fx) rescue nil
     @background.opacity = z2
     z2 -= z
     for i in 0...5
       s.zoom_x -= 0.2
       if $scene.is_a?(Scene_Map)
         $scene.update
       end
       Graphics.update
     end
     s.dispose
   }
   @background.dispose; @background = nil;
   @sprites = []
   set_finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.set_finish_process(v=true)
   @finish_process = v
 end  
 #--------------------------------------------------------------------------
 def PPT.showing_sprites?
   return @showing_sprites
 end
 #--------------------------------------------------------------------------
 def PPT.in_process?
   return false if @sprites.nil?
   return @sprites.size > 0
 end
 #--------------------------------------------------------------------------
 def PPT.finish_process?
   return false if @finish_process.nil?
   return @finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.events_list
   return @events_list
 end
 #--------------------------------------------------------------------------
 private
 #--------------------------------------------------------------------------
 def self.run
   @background = Sprite.new
   @background.bitmap = Bitmap.new(@w,@h)
   @background.bitmap.fill_rect(0,0,@w,@h,Color.new(0,0,0))
   @background.z = 50000000
   @background.opacity = 0
   z = (255.0/(@dH*@dV))
   z2 = z
   while @max > 0
       self.create_sprite
       @background.opacity = z2
       z2 += z
       @max -= 1
   end
   @background.opacity = 255
   self.animation_sprites
   @showing_sprites = true
   set_finish_process
 end
  #--------------------------------------------------------------------------
 def self.create_sprite
   Audio.se_play(@fx) rescue nil
   w, h = @w/@dH,@h/@dV
   s = Sprite.new
   s.bitmap = @b
   s.x = @x + @b.width / 2 + @modX
   s.y = @y + @modY
   s.ox = @b.width / 2
   s.zoom_x = 0.2
   s.z = 50000000
   Graphics.update
for i in 0...4
     s.zoom_x += 0.2
     Graphics.update
end
   @sprites << s
   if @mode1 == 0 and @mode2 == 0
     if @cnt == @dH or exist_sprite_in(@x + w,@y)
       @mode2 = 1; @y += h; @cnt = 2
     else
       @x += w; @cnt += 1
     end
   elsif @mode1 == 0 and @mode2 == 1
     if @cnt == @dV or exist_sprite_in(@x,@y+h)
       @mode1 = 1; @x -= w; @cnt = 2
     else
       @y += h; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 1
     if @cnt == @dH or exist_sprite_in(@x - w,@y)
       @mode2 = 0; @y -= h; @cnt = 2
     else
       @x -= w; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 0
     if @cnt == @dV or exist_sprite_in(@x,@y-h)
       @mode1 = 0; @x += w; @cnt = 2
     else
       @y -= h; @cnt += 1
     end
   end
 end
  #--------------------------------------------------------------------------
 def self.exist_sprite_in(x,y)
   @sprites.each {|s| return true if s.x - s.ox - @modX == x and s.y - @modY == y}
   return false
 end
  #--------------------------------------------------------------------------
 def self.animation_sprites
     frameW, frameH = 0, 0
     n = (@frameW > 1 or @frameH > 1) ? 60 : 30
     n.times {
        Graphics.update
        if Graphics.frame_count % 2 == 0
           w = @pattern.width/@frameW * frameW
           h = @pattern.height/@frameH * frameH
           frameW += 1
           if frameW >= @frameW
              frameW = 0
              frameH += 1
              if frameH >= @frameH
                 frameH = 0
              end
           end
           rect = Rect.new(w,h,@pattern.width/@frameW,@pattern.height/@frameH)
           @b.clear
           @b.stretch_blt(@b.rect,@pattern,rect)
        end
     }
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.clear
     @b.stretch_blt(@b.rect,@pattern,rect)
     Graphics.update
 end
  #--------------------------------------------------------------------------
end
#==============================================================================

#==============================================================================
class Game_Event < Game_Character
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   if (PPT.in_process? and PPT.events_list.include?(@id)) or
     not PPT.in_process?
     newUpdateByNewold
   end
 end
end
#==============================================================================

#==============================================================================
if Window_Message.superclass.name == 'Window_Selectable'
 t = "class Window_Message < Window_Selectable;"
else
 t = "class Window_Message < Window_Base"
end
t += "
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   unless PPT.in_process?
     newUpdateByNewold
   end
 end
end"
eval t
#==============================================================================

#==============================================================================
module Graphics
  class << self
     unless defined?(Graphics.updateGraphicsBynewold)
        alias updateGraphicsBynewold update
     end
     def update
       if PPT.showing_sprites?
         PPT.eliminate_sprites
       end
       if PPT.finish_process?
         PPT.set_finish_process(false)
       end
       updateGraphicsBynewold
     end
     unless defined?(Graphics.transitionGraphicsBynewold)
        alias transitionGraphicsBynewold transition
     end
     def transition(*args)
       if PPT.in_process? or PPT.finish_process?
         transitionGraphicsBynewold(0)
       else
         transitionGraphicsBynewold(*args)
       end
     end
     if defined?(Graphics.brightness)
       unless defined?(Graphics.brightnessGraphicsBynewold)
         alias brightnessGraphicsBynewold brightness
       end
       def brightness(*args)
         unless PPT.in_process? or PPT.finish_process?
           brightnessGraphicsBynewold(*args)
         else
           return 0
         end
       end
     end
  end
end
#==============================================================================


VX ACE use this script:
Spoiler: ShowHide
=begin

 SCRIPT CREATED BY NEWOLD
 20-09-2013
 VERSION: ONLY FOR    --  RPG MAKER VX ACE  --
 FREE USE
 DESCRIPTION
 
   Displays a transition similar to Paper Mario game in Game Cube
   (Great for use before changing scene!!!)
   
   (You can watch a preview in this video in minute 3:13
   
   http://www.youtube.com/watch?v=RayrWDD7O10
   
   )
   
   
******************************** INSTRUCTION ********************************

Put over main script.

You call this transition using command call script and write this code

---------------------------------------------------------------------------
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

PPT.set(
'image*',
'fx*',
Columns*,Rows*,EventsList*)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---------------------------------------------------------------------------

and change values marked with * with the following:

--------------------------------------------------------------------------------

- image* : filename of the image to display in your game folder.
You can add an animated image that is divided into several rows and columns
adding at the end the name of the image as follows:

[a number]  (Example: [7]) indicates that the image is divided into
x columns (7 columns in the example)

[a number, other number] (Ejemplo: [7,5]) indicates that the image is divided into
x columns and y rows (7 columns and 5 rows in the example)

examples:

flower      <- image called flower divided into 1 column and 1 row
flower[2]   <- image called flower divided into 2 column and 1 row
flower[2,2] <- image called flower divided into 2 columns and 2 rows

--------------------------------------------------------------------------------

- fx* : filename of the sound to play when each image appear.
(nil if you don't want to put a sound)

--------------------------------------------------------------------------------

- Columns* : Number of columns of images that will be on display

--------------------------------------------------------------------------------

- Rows* : Number of rows of images that will be on display

--------------------------------------------------------------------------------

- EventsList* : List of ids corresponding to events that will be updated
while playing the transition ([ID 1, ID 2, ID 3, ...])

--------------------------------------------------------------------------------


Global Example:

PPT.set(
'Graphics/Pictures/Image01[6,1]',
'Audio/SE/sound01',
5,4,[5,6,1,16])

=end


#==============================================================================
module PPT
 #--------------------------------------------------------------------------
 def PPT.set(image,fx=nil,dH=16,dV=16,events_list=[])
     @fx = fx
     @dH = dH
     @dV = dV
     @max = @dH * @dV
     @x, @y = 0, 0
     @hidden = false
     @sprites = []
     @mode1 = 0
     @mode2 = 0
     @cnt = 1
     @events_list = events_list
     if defined?(Graphics.width) and defined?(Graphics.height)
        @w, @h = Graphics.width, Graphics.height
     else
        @w, @h = 640, 480
     end
     w, h = @w/@dH,@h/@dV
     @modX = (@w - (w * @dH)) / 2
     @modY = (@h - (h * @dV)) / 2
     @b = Bitmap.new(@w/@dH,@h/@dV)
     image.match(/\[(\d+)]|\[(\d+),(\d+)]/)
     unless $2.nil?
        @frameW, @frameH = [$2.to_i,1].max, [$3.to_i,1].max
     else
        @frameW = $1.nil? ? 1 : [$1.to_i,1].max
        @frameH = 1
     end
     begin
        @pattern = Bitmap.new(image)
     rescue => e
        @pattern = Bitmap.new(1,1)
     end
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.stretch_blt(@b.rect,@pattern,rect)
     self.run
  end
  #--------------------------------------------------------------------------
 def PPT.eliminate_sprites
   if @cnt2 > 0
     @cnt2 -= 1; return
   end
   @showing_sprites = false
   z = 255.0 / @sprites.size
   z2 = 255 - z
   @sprites.reverse.each {|s|
     Audio.se_play(@fx) rescue nil
     @background.opacity = z2
     z2 -= z
     for i in 0...5
       s.zoom_x -= 0.2
       if $scene.is_a?(Scene_Map)
         $scene.update
       end
       Graphics.update
     end
     s.dispose
   }
   @background.dispose; @background = nil;
   @sprites = []
   set_finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.set_finish_process(v=true)
   @finish_process = v
 end  
 #--------------------------------------------------------------------------
 def PPT.showing_sprites?
   return @showing_sprites
 end
 #--------------------------------------------------------------------------
 def PPT.in_process?
   return false if @sprites.nil?
   return @sprites.size > 0
 end
 #--------------------------------------------------------------------------
 def PPT.finish_process?
   return false if @finish_process.nil?
   return @finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.events_list
   return @events_list
 end
 #--------------------------------------------------------------------------
 private
 #--------------------------------------------------------------------------
 def self.run
   @background = Sprite.new
   @background.bitmap = Bitmap.new(@w,@h)
   @background.bitmap.fill_rect(0,0,@w,@h,Color.new(0,0,0))
   @background.z = 50000000
   @background.opacity = 0
   z = (255.0/(@dH*@dV))
   z2 = z
   while @max > 0
       self.create_sprite
       @background.opacity = z2
       z2 += z
       @max -= 1
   end
   @background.opacity = 255
   self.animation_sprites
   @showing_sprites = true
   set_finish_process
   @cnt2 = 1
 end
  #--------------------------------------------------------------------------
 def self.create_sprite
   Audio.se_play(@fx) rescue nil
   w, h = @w/@dH,@h/@dV
   s = Sprite.new
   s.bitmap = @b
   s.x = @x + @b.width / 2 + @modX
   s.y = @y + @modY
   s.ox = @b.width / 2
   s.zoom_x = 0.2
   s.z = 50000000
   Graphics.update
for i in 0...4
     s.zoom_x += 0.2
     Graphics.update
end
   @sprites << s
   if @mode1 == 0 and @mode2 == 0
     if @cnt == @dH or exist_sprite_in(@x + w,@y)
       @mode2 = 1; @y += h; @cnt = 2
     else
       @x += w; @cnt += 1
     end
   elsif @mode1 == 0 and @mode2 == 1
     if @cnt == @dV or exist_sprite_in(@x,@y+h)
       @mode1 = 1; @x -= w; @cnt = 2
     else
       @y += h; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 1
     if @cnt == @dH or exist_sprite_in(@x - w,@y)
       @mode2 = 0; @y -= h; @cnt = 2
     else
       @x -= w; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 0
     if @cnt == @dV or exist_sprite_in(@x,@y-h)
       @mode1 = 0; @x += w; @cnt = 2
     else
       @y -= h; @cnt += 1
     end
   end
 end
  #--------------------------------------------------------------------------
 def self.exist_sprite_in(x,y)
   @sprites.each {|s| return true if s.x - s.ox - @modX == x and s.y - @modY == y}
   return false
 end
  #--------------------------------------------------------------------------
 def self.animation_sprites
     frameW, frameH = 0, 0
     n = (@frameW > 1 or @frameH > 1) ? 60 : 30
     n.times {
        Graphics.update
        if Graphics.frame_count % 2 == 0
           w = @pattern.width/@frameW * frameW
           h = @pattern.height/@frameH * frameH
           frameW += 1
           if frameW >= @frameW
              frameW = 0
              frameH += 1
              if frameH >= @frameH
                 frameH = 0
              end
           end
           rect = Rect.new(w,h,@pattern.width/@frameW,@pattern.height/@frameH)
           @b.clear
           @b.stretch_blt(@b.rect,@pattern,rect)
        end
     }
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.clear
     @b.stretch_blt(@b.rect,@pattern,rect)
     Graphics.update
 end
  #--------------------------------------------------------------------------
end
#==============================================================================

#==============================================================================
class Game_Event < Game_Character
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   if (PPT.in_process? and PPT.events_list.include?(@id)) or
     not PPT.in_process?
     newUpdateByNewold
   end
 end
end
#==============================================================================

#==============================================================================
if Window_Message.superclass.name == 'Window_Selectable'
 t = "class Window_Message < Window_Selectable;"
else
 t = "class Window_Message < Window_Base"
end
t += "
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   unless PPT.in_process?
     newUpdateByNewold
   end
 end
end"
eval t
#==============================================================================

#==============================================================================
if Scene_Map.superclass.name == "Scene_Base"
 class Scene_Map < Scene_Base
   def fade_loop(duration)
     return if PPT.showing_sprites?
     duration.times do |i|
       yield 255 * (i + 1) / duration
       update_for_fade
     end
   end
   def update
     super
     $game_map.update(true)
     $game_player.update
     $game_timer.update
     @spriteset.update
     update_scene if scene_change_ok?
     if PPT.showing_sprites?
       PPT.eliminate_sprites
     end
   end
 end
end
#==============================================================================

#==============================================================================
class Game_Player < Game_Character
 attr_reader :transferring
end
#==============================================================================

#==============================================================================
module SceneManager
 def SceneManager.scene?
   return @scene
 end
end
#==============================================================================

#==============================================================================
module Graphics
  class << self
     unless defined?(Graphics.updateGraphicsBynewold)
        alias updateGraphicsBynewold update
     end
     def update(force_old_update=false)
       if force_old_update
         updateGraphicsBynewold
         return
       end
       if PPT.showing_sprites? and (not $game_player.transferring or
         $game_player.transferring.nil?) and SceneManager.scene?.nil?
         PPT.eliminate_sprites
       end
       if PPT.finish_process?
         PPT.set_finish_process(false)
       end
       updateGraphicsBynewold
     end
     unless defined?(Graphics.transitionGraphicsBynewold)
        alias transitionGraphicsBynewold transition
     end
     def transition(*args)
       if PPT.in_process? or PPT.finish_process?
         transitionGraphicsBynewold(0)
       else
         transitionGraphicsBynewold(*args)
       end
     end
     if defined?(Graphics.brightness)
       unless defined?(Graphics.brightnessGraphicsBynewold)
         alias brightnessGraphicsBynewold brightness
       end
       def brightness(*args)
         unless PPT.in_process? or PPT.finish_process?
           return 0
         else
           brightnessGraphicsBynewold(*args)
         end
       end
     end
  end
end
#==============================================================================




Instructions

Put over main and read the instructions in the script.


Compatibility


  • VX ACE only work with transitions between maps, not transition from map - to menu.

  • VX transition between menus and map not is perfect



Credits and Thanks


  • I'm the script creator so, thanks at me ;)




Author's Notes

Enjoy it!
9
Hi, i want SHBrowseForFolder function in my RGSS, i have this code:

# =============================================================================
module SHBrowseForFolder# by Newold
 #--------------------------------------------------------------------------
 # Open finder folder dialog
 SHBrowseForFolder = Win32API.new('shell32', 'SHBrowseForFolder', 'p', 'l')
 # Get path
 SHGetPathFromIDList = Win32API.new('shell32', 'SHGetPathFromIDList', 'lp', 'l')
 # send msg
 SendMessage       = Win32API.new('User32','SendMessage','lllp','l')
 # last dir checked
 @pidlRoot = 0
 @lastBuffer = ""
 #--------------------------------------------------------------------------
 module_function
 #--------------------------------------------------------------------------
 def new(hWndOwner=0,pIDLRoot=0,pszDisplayName="\0" * 260,
   lpszTitle="Select Folder with a RPG Maker proyect:",
   ulFlags=0,lpfnCallback=nil,lParam=0,iImage=-1)
   begin
     buffer = "\0" * 260
     browseInfo = [hWndOwner.to_i,pIDLRoot.to_i,pszDisplayName,
     lpszTitle,ulFlags.to_i,lpfnCallback,lParam.to_i,
     iImage.to_i].pack("llpplpll")
     @pidlRoot = idList = SHBrowseForFolder.(browseInfo) rescue 0
     return false if idList == 0
     SHGetPathFromIDList.(idList,buffer)
     buffer.delete!("\0")
     @lastBuffer = buffer.dup
     buffer.gsub!("\\","/")
     unless buffer.match(/\/$/) or buffer.size == 0
       buffer << '/'
     end
     return buffer
   rescue Exception => e
     return ''
   end
 end
 #--------------------------------------------------------------------------
 def lastPID
   return @pidlRoot
 end
 #--------------------------------------------------------------------------
end
# =============================================================================


I can get a path from dir with this, (DIR = SHBrowseForFolder.new) but i dont know how set initial dir in find folder dialog.

I know i have to pass a BrowseCallbackProc  at param lpfnCallback in my function

def browseCallbackProc(hwnd, uMsg, lParam, lpData)
   case uMsg
   when BFFM_INITIALIZED
     if(lpData)
       SendMessage.(hwnd, BFFM_SETSELECTION, 1, lpData);
     end
   when BFFM_SELCHANGED
   when BFFM_VALIDATEFAILED
   else
   end
   return 0;
 end


As I do then to set a default directory, for example "c:\ program files"

I have another problem. When i call finder folder dialog i need to use a rescue because some times, after you select a folder and press ok button, it go to crash and i dont know why :(
10
First question: If i use 'p ', i get error: cannot convert float into string. I can convert float into string with to_s and change param in c function for char (1.85 => "1.85"), then how i convert in c this char into float

Second question. I know how to pack and unpack in ruby but no in c.

ruby ===> float = 15.5      pack ==>  packed = [15.5].pack("f")     unpack =>>> packed.unpack("f")[0]
c => Recive packed param (using 'p')    how i unpack this value??


PS: I Know, i have very low nivel in c :D
11
Hi all. See if you can help me.

FirstQuestion

I have a function in C for a dll.

 DllImport float sum (float a, float b)
{
     return a + b;
}


How do I give to that function float values ​​from RGSS?
My code in RGSS (i cant use 'f' or 'd' as param):

 n = Win32API.new ('test', 'sum', 'ii', 'i')
a = 5.10
b = 8.90
n.call p (a, b)


Last Question

I defined a point class in RGSS

class Point # by Newold
  #--------------------------------------------------------------------------
  attr_accessor   :x
  attr_accessor   :y
  #--------------------------------------------------------------------------
  def initialize(x=0,y=0)
    @x = x; @y = y
  end
  #--------------------------------------------------------------------------
end


in dll i defined this struct:

struct point
{
    float x;
    float y;
};


How do I give to a function a point ​​from RGSS? i want say, If i have this point in RGSS => Point.new(150,150), how i pass this point to a function in c as struct point.
12
Error after the intro in the demo:



This script requires a specific audio codec?
13
Quote from: LiTTleDRAgo on January 22, 2012, 09:26:41 pm
the editor is weird, I can't use < > / ? [ ] ' " etc at the notes




Works for me (I use a QWERTY Keyboard).





may have a problem with the full keyboard script. I use this:


#-------------------------------------------------------------------------------
# Script original: Cybersam
# Añadidas teclas en español: houndninja@gmail.com
# Readaptado por NEWOLD
#-------------------------------------------------------------------------------

module Keyb
  $keys = {}
  $keys["MouseL"] = 0x01 # Botón Izquierdo
  $keys["MouseR"] = 0x02 # Botón Derecho
  $keys["MouseM"] = 0x04 # Botón medio
  $keys["Mouse4"] = 0x05 # Cuarto Botón
  $keys["Mouse5"] = 0x06 # Quinto Botón
  # Teclas de Controles
  $keys["Back"] = 0x08 # Tecla Retroceder/Borrar
  $keys["Tab"] = 0x09 # Tecla Tab
  $keys["Enter"] = 0x0D # Tecla Enter
  $keys["Shift"] = 0x10 # Tecla Shift
  $keys["Ctrl"] = 0x11 # Tecla Control
  $keys["Alt"] = 0x12 # Tecla Alt
  $keys["Pause"] = 0x13 # Tecla de Pausa
  $keys["Caps"] = 0x14 # Tecla Bloq Mayus
  $keys["Esc"] = 0x1B # Tecla Escape (ESC)
  $keys["Space"] = 0x20 # Tecla Espaciadora
  $keys["AvPag"] = 0x21 # Tecla Siguiente
  $keys["RePag"] = 0x22 # Tecla Anterior
  $keys["End"] = 0x23 # Tecla Fin
  $keys["Home"] = 0x24 # Tecla Inicio
  # Teclas de Direcciones
  $keys["Left"] = 0x25 # Tecla Flecha Izquierda
  $keys["Up"] = 0x26 # Tecla Flecha Arriba
  $keys["Right"] = 0x27 # Tecla Flecha Derecha
  $keys["Down"] = 0x28 # Tecla Flecha Abajo
  $keys["Select"] = 0x29
  # Otras teclas
  $keys["Print"] = 0x2A # Tecla Imprimir
  $keys["Snapshot"] = 0x2C # Tecla Capturar Pantalla
  $keys["Ins"] = 0x2D # Tecla Insert
  $keys["Del"] = 0x2E # Tecla Suprimir
  # Teclas Numéricas Superiores
  $keys["0"] = 0x30
  $keys["1"] = 0x31
  $keys["2"] = 0x32
  $keys["3"] = 0x33
  $keys["4"] = 0x34
  $keys["5"] = 0x35
  $keys["6"] = 0x36
  $keys["7"] = 0x37
  $keys["8"] = 0x38
  $keys["9"] = 0x39
  # Teclas de Windows
  $keys["Lwin"] = 0x5B # Tecla Windows Izquierda
  $keys["Rwin"] = 0x5C # Tecla Windows Derecha
  $keys["Apps"] = 0x5D # Tecla Aplicaciones
  # Teclas del Pad Numérico
  $keys["Pad0"] = 0x60
  $keys["Pad1"] = 0x61
  $keys["Pad2"] = 0x62
  $keys["Pad3"] = 0x63
  $keys["Pad4"] = 0x64
  $keys["Pad5"] = 0x65
  $keys["Pad6"] = 0x66
  $keys["Pad7"] = 0x67
  $keys["Pad8"] = 0x68
  $keys["Pad9"] = 0x69
  $keys["Multiply"] = 0x6A # Tecla Multiplicar
  $keys["Add"] = 0x6B # Tecla Sumar
  $keys["Separator"] = 0x6C
  $keys["Substract"] = 0x6D # Tecla Restar
  $keys["Decimal"] = 0x6E
  $keys["Divide"] = 0x6F # Tecla Dividir
  # Teclas de Funciones
  $keys["F1"] = 0x70
  $keys["F2"] = 0x71
  $keys["F3"] = 0x72
  $keys["F4"] = 0x73
  $keys["F5"] = 0x74
  $keys["F6"] = 0x75
  $keys["F7"] = 0x76
  $keys["F8"] = 0x77
  $keys["F9"] = 0x78
  $keys["F10"] = 0x79
  $keys["F11"] = 0x7A
  $keys["F12"] = 0x7B
  $keys["Numlock"] = 0x90
  $keys["Scroll"] = 0x91 # Tecla Bloq Despl
  # Teclas de cada letra
  $keys["A"] = 0x41
  $keys["B"] = 0x42
  $keys["C"] = 0x43
  $keys["D"] = 0x44
  $keys["E"] = 0x45
  $keys["F"] = 0x46
  $keys["G"] = 0x47
  $keys["H"] = 0x48
  $keys["I"] = 0x49
  $keys["J"] = 0x4A
  $keys["K"] = 0x4B
  $keys["L"] = 0x4C
  $keys["M"] = 0x4D
  $keys["N"] = 0x4E
  $keys["O"] = 0x4F
  $keys["P"] = 0x50
  $keys["Q"] = 0x51
  $keys["R"] = 0x52
  $keys["S"] = 0x53
  $keys["T"] = 0x54
  $keys["U"] = 0x55
  $keys["V"] = 0x56
  $keys["W"] = 0x57
  $keys["X"] = 0x58
  $keys["Y"] = 0x59
  $keys["Z"] = 0x5A
  # Teclas de Signos de Puntuación
  $keys["Sep"] = 0xBC # Tecla Coma , ;
  $keys["Dash"] = 0xBD # Tecla Guión - _
  $keys["Dott"] = 0xBE # Tecla Punto . :
  # Teclas de carácteres especiales
  $keys["Ç"] = 0xBF # ç Ç }
  $keys["Ñ"] = 0xc0# ñ Ñ
  $keys["Ac1"] = 0xde # Acento y Diéresis ´¨
  $keys["Ac2"] = 0xBA # Acento al revés `^
  $keys["Plus"] = 0xBB # + * ]
  $keys["Prg2"] = 0xdb # ' ?
  $keys["Ord"] = 0xdc # º ª \
  $keys["Prg1"] = 0xdd # ¡ ¿
  $keys["Cmp"] = 0xe2 # Comparación < >
  # Teclas de Control Específicas
  $keys["Lshift"] = 0xA0 # Shift izquierdo
  $keys["Rshift"] = 0xA1 # Shift derecho
  $keys["Lctrl"] = 0xA2 # Ctrl izquierdo
  $keys["Rctrl"] = 0xA3 # Ctrl derecho
  $keys["Lalt"] = 0xA4 # Alt izquierdo
  $keys["Ralt"] = 0xA5 # Alt derecho
  #--------------------------------------------------------------------------
  # Nombres de cada tecla
  #--------------------------------------------------------------------------
  Names = {
  0x20 => [" "," "," "],
  0xdc => ["º","ª","\\"], 0x31 => ["1","!","|"],  0x32 => ["2",'"',"@"],
  0x33 => ["3","·","#"],  0x34 => ["4","$","~"],  0x35 => ["5","%","€"],
  0x36 => ["6","&","¬"],  0x37 => ["7","/",nil],  0x38 => ["8","(",nil],
  0x39 => ["9",")",nil],  0x30 => ["0","=",nil],  0xdb => ["'","?",nil],
  0xdd => ["¡","¿",nil],  0x41 => ["a","A",nil],  0x42 => ["b","B",nil],
  0x43 => ["c","C",nil],  0x44 => ["d","D",nil],  0x45 => ["e","E","€"],
  0x46 => ["f","F",nil],  0x47 => ["g","G",nil],  0x48 => ["h","H",nil],
  0x49 => ["i","I",nil],  0x4A => ["j","J",nil],  0x4B => ["k","K",nil],
  0x4C => ["l","L",nil],  0x4D => ["m","M",nil],  0x4E => ["n","N",nil],
  0xc0 => ["ñ","Ñ",nil],  0x4F => ["o","O",nil],  0x50 => ["p","P",nil],
  0x51 => ["q","Q",nil],  0x52 => ["r","R",nil],  0x53 => ["s","S",nil],
  0x54 => ["t","T",nil],  0x55 => ["u","U",nil],  0x56 => ["v","V",nil],
  0x57 => ["w","W",nil],  0x58 => ["x","X",nil],  0x59 => ["y","Y",nil],
  0x5A => ["z","Z",nil],  0xe2 => ["<",">",nil],  0xBA => ["`","^","["],
  0xBB => ["+","*","]"],  0xde => ["´","¨","{"],  0xBF => ["ç","Ç","}"],
  0xBC => [",",";",nil],  0xBE => [".",":",nil],  0xBD => ["-","_",nil],
  0x6F => ["/","/","/"],  0x6A => ["*","*","*"],  0x6D => ["-","-","-"],
  0x6B => ["+","+","+"],  0x6E => [".",".","."],  0x60 => ["0","0","0"],
  0x61 => ["1","1","1"],  0x62 => ["2","2","2"],  0x63 => ["3","3","3"],
  0x64 => ["4","4","4"],  0x65 => ["5","5","5"],  0x66 => ["6","6","6"],
  0x67 => ["7","7","7"],  0x68 => ["8","8","8"],  0x69 => ["9","9","9"],
  "Special" => [
      [["á","Á"],["é","É"],["í","Í"],["ó","Ó"],["ú","Ú"]],
      [["ä","Ä"],["ë","Ë"],["ï","Ï"],["ö","Ö"],["ü","Ü"]],
      [["à","À"],["è","È"],["ì","Ì"],["ò","Ò"],["ù","Ù"]],
      [["â","Â"],["ê","Ê"],["î","Î"],["ô","Ô"],["û","Û"]]
    ]
  }
  #--------------------------------------------------------------------------
  # Variable especial para guardar los acentos y diéresis
  #--------------------------------------------------------------------------
  @store_key = nil
  #--------------------------------------------------------------------------
  # Creamos las variables de llamada Win32api
  #--------------------------------------------------------------------------
  GetKeyState = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
  GetKeyboardState = Win32API.new("user32","GetKeyState",['i'],'i')
  #--------------------------------------------------------------------------
  # Otras Variables
  #--------------------------------------------------------------------------
  KeyRepeatCounter = {}
  # Letras a las que les afecta el caps lock
  @caps_letters = [0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,
                   0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,
                   0x57,0x58,0x59,0x5A,0xc0,0xBF]
  #--------------------------------------------------------------------------
  # Métodos del módulo
  #--------------------------------------------------------------------------
  def Keyb.update
    for key in KeyRepeatCounter.keys
      if KeyRepeatCounter[key] != nil
        if GetKeyState.call(key) != 0
          KeyRepeatCounter[key] += 1
          KeyRepeatCounter[key] = 1 if KeyRepeatCounter[key] > 1000
        else
          KeyRepeatCounter[key] = nil
        end
      elsif KeyRepeatCounter[key] != nil
          KeyRepeatCounter[key] = nil
      end
    end
  end
  #--------------------------------------------------------------------------
  def Keyb.press?(key)
    return false if key == nil
    return true unless KeyRepeatCounter[key].nil?
    return key_pressed?(key)
  end
  #--------------------------------------------------------------------------
  def Keyb.trigger?(key)
    return false if key == nil
    return false if GetKeyState.call(key) == 0
    KeyRepeatCounter[key] = 0 if KeyRepeatCounter[key].nil?
    return (KeyRepeatCounter[key] == 0)
  end
  #--------------------------------------------------------------------------
  def Keyb.trigger2?(key)
    return Keyb.trigger?(key)
  end
  #--------------------------------------------------------------------------
  def Keyb.repeat?(key)
    return false if key == nil
    count = KeyRepeatCounter[key]
    return true if count == 0
    if count.nil?
      return key_pressed?(key)
    else
      return (count >= 23 and (count - 23) % 6 == 0)
    end
  end
  #--------------------------------------------------------------------------
  def Keyb.repeat_fast?(key)
    return false if key == nil
    count = KeyRepeatCounter[key]
    return true if count == 0
    if count.nil?
      return key_pressed?(key)
    else
      return (count >= 7 and (count - 7) % 3 == 0)
    end
  end
  #--------------------------------------------------------------------------
  def Keyb.key_pressed?(key)
    if (GetKeyState.call(key).abs & 0x8000 == 0x8000)
      KeyRepeatCounter[key] = 0
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  def Keyb.block(key) # Condición de teclas bloqueadas
    GetKeyboardState.call(key) == 1
  end
  #--------------------------------------------------------------------------
  def Keyb.getKey(key)
    if Keyb.caps_effects.include?(key)
      if Keyb.block($keys["Caps"])
        index = Keyb.press?($keys["Shift"]) ? 0 : 1
      elsif Keyb.press?($keys["Shift"])
        index = 1
      elsif Keyb.press?($keys["Ralt"])
        index = 2
      else
        index = 0
      end
    else
      if Keyb.press?($keys["Shift"])
        index = 1
      elsif Keyb.press?($keys["Ralt"])
        index = 2
      else
        index = 0
      end
    end
    name = (Names[key] != nil) ? Names[key][index] : nil
    return nil if name.nil?
    if (key == 0xde or key == 0xBA) and Keyb.store_key == nil and index != 2
      Keyb.store_key = Names[key][index]; return nil
    elsif Keyb.store_key != nil
      dec = Keyb.store_key
      Keyb.store_key = nil
      case dec
      when "`": pos = 0
      when "¨": pos = 1
      when "`": pos = 2
      when "^": pos = 3
      else
        pos = 0
      end
      case name
      when "a": return Names["Special"][pos][0][0]
      when "e": return Names["Special"][pos][1][0]
      when "i": return Names["Special"][pos][2][0]
      when "o": return Names["Special"][pos][3][0]
      when "u": return Names["Special"][pos][4][0]
      when "A": return Names["Special"][pos][0][1]
      when "E": return Names["Special"][pos][1][1]
      when "I": return Names["Special"][pos][2][1]
      when "O": return Names["Special"][pos][3][1]
      when "U": return Names["Special"][pos][4][1]
      else
        return dec + name
      end
    else
      return name
    end
  end
  #--------------------------------------------------------------------------
  def Keyb.store_key=(val)
    @store_key = val
  end
  #--------------------------------------------------------------------------
  def Keyb.store_key
    return @store_key
  end
  #--------------------------------------------------------------------------
  def Keyb.caps_effects
    return @caps_letters
  end
  #--------------------------------------------------------------------------
  def Keyb.count(key)
    return (KeyRepeatCounter[key].nil?) ? 0 : KeyRepeatCounter[key]
  end
  #--------------------------------------------------------------------------
  def Keyb.clear
    KeyRepeatCounter.clear
  end
  #--------------------------------------------------------------------------
  def Keyb.clear_left_click
    KeyRepeatCounter.delete(0x01)
  end
  #--------------------------------------------------------------------------
end



Can you review it to see if it is compatible with the English keyboard?

14
Quote from: EricandTheCheat on January 21, 2012, 03:06:54 am
Can you reupload the demo please? Megaupload is shut down for some reason.


The demo is available now in mediafire. The link is update in main post
15
Quote from: djskagnetti on January 12, 2012, 08:40:05 pm
What does it look like in-game when you call, can you post a screen of that?


This Editor, just add notes to database (maps, items, weapons, armors, states, elements, chipsets, common events, classes, skills, enemies, troops and animations), This notes can be used for another scripts (just as RPG maker VX or ACE). (for example, XAS (VX or ACE version) use notes to create weapons and skills)

When you call a note of a data, you receive a text string with the contents of that note (for example: "note line 1\nnote line 2\nlast line of the note"). If a data set does not have a note, you get an empty string.
16
RMXP Script Database / Re: [XP] Perishable Items
January 12, 2012, 12:23:28 pm
Quote from: mad.array on January 12, 2012, 11:09:11 am
@newold: That. Is. Awesome.

I did consider a configuration program but it's not my speciality (If I could be said to have one). I'll add a request for credit to the main post, as well as a link, if you want.


ok, perfect!  :D
17
NOTE EDITOR
Authors: NEWOLD
Version: 1.1
Type: Database Notes Editor for RPG MAKER XP
Key Term: Scripting Tool



Introduction

This editor lets you create notes for almost any data from the database in RPG MAKER XP. These notes can be used by other scripts in a simple (as in RPG MAKER VX and ACE)


Features


  • create notes for almost any data from the database in RPG MAKER XP (maps, common events, armors, items, elements, states...)




Screenshots




Demo

http://www.megaupload.com/?d=W0JR9B2Y dead forever?
http://www.mediafire.com/?21pvvlrpb3q6r30 Working


Script

None.


Instructions

1) Download Editor: http://www.megaupload.com/?d=W0JR9B2Y or http://www.mediafire.com/?21pvvlrpb3q6r30
2) Unzip the editor and put it in a valid RPG MAKER XP Project.
3) Run it to Edit notes from data in database (Use the 'Expand DataBase Editor.exe' to edit the notes of the different data).
4) How to access the notes in game:

* Actors:         $data_actors[ID].note
* Clases:              $data_classes[ID].note
* Skills:                $data_skills[ID].note
* Items:               $data_items[ID].note
* Weapons:          $data_weapons[ID].note
* Armors:         $data_armors[ID].note
* States:             $data_states[ID].note
* Elements:          element_note[ID]
* Enemies:           $data_enemies[ID].note
* Troops:         $data_troops[ID].note
* Animations:        $data_animations[ID].note
* Tile Sets:           $data_tilesets[ID].note
* Common Events:  $data_common_events[ID].note
* Maps:                map_note[ID]



Compatibility

None.


Credits and Thanks


  • Me ;)




Author's Notes

The text of the notes can contain line breaks represented by \n.

Comment if you like, and if not too  :naughty:
18
MULTI-LANGUAJE
Authors: NEWOLD
Version: 1.0
Type: Script to help the translation of a project in multiple languages
Key Term: Message Add-on



Introduction

This script is designed so you can keep the text that appears in your project in a separate text file, so you can quickly change the texts and / or put them in another language



Features

  • The text file can have comments for a better understanding (comments start with #).

  • You can create very large messages (if message has more four lines, it be splitted in several messages of four lines each).

  • You can use the commands you use with the Message System you use.

  • You can use any type of ID (text / number) to identify the messages in the file lang.

  • You can translate any word in the database too ;)




Screenshots

No representative screen shots.


Demo

No demo at the moment. Sorry!


Script

Scripts very long, you can download it from here:

http://www.megaupload.com/?d=15WPNUXZ



Instructions


  • Place the SCRIPT 1 on top.

  • Place the SCRIPT 2 under SCRIPT 1.

  • Only if you use the RPG Maker XP - Place the SCRIPT 3 over main script.

  • Only if you use the RPG Maker VX - Place the SCRIPT 4 over main script.

  • Place the SCRIPT 5 over main script.

  • Create a folder in your project folder and call it Lang.

  • Inside the folder Lang create a file with the name lang.ini

  • Open the file lang.ini with text editor and type in lang = eng

  • Create other file in Lang folder named as you put in file lang.ini ending in .lang (Ex: eng.lang).
    The structure of the text file is as follows: (ID::Text)
    Ex:

    1::Text 1
    # Comment 1
    ID Text2::Text 2
    3::Text 3 # Comment 2
    # Comment 3
    4:: Text 4, line 1
    Text 4, line 2
    Text4, line X
    1000000::Text 1000000


  • Create multiple files as above for each language.

  • Go to the initialize method of the script SCRIPT 1 and configured as specified in the same

  • Put the pictures of the flags in the Lang folder of your proyect

  • all Ready ;)



With a command Show Text in events, you can use now \lang[id Message] for show the message with that ID.

In database you can use now \lang[ID Text] in each fild name or comment



Compatibility

Found no compatibility issues.


Credits and Thanks


  • me ;)




Author's Notes

You can download a pack with two flags (English and Spanish flag) from here:

http://www.megaupload.com/?d=2KH57WWK or
http://www.mediafire.com/?ccsw9wiy2iv6izu
19
RPG Maker Scripts / Re: [XP]New Editor - By me ;)
November 03, 2011, 01:18:24 pm
I will definitely continue building the Editor by encoding it in RGSS because C exceeds my limits right now XD
20
RPG Maker Scripts / Re: [XP]New Editor - By me ;)
November 02, 2011, 03:50:36 pm
I would like to see the source code of Gemini. I've been testing the IronRuby a few minutes) but I have not found the help of it and when I create a WinForms project with IronRuby I can not create a visual form, just to code, and I dont know which code to use to create each control the form and position in the window. I saw also that the IronRuby project does not have auto-complete feature implemented: (

Also if Zlib is not working properly, I can not compress anything:)

And the last problem, how I can I use sprites in the form without the module Sprite from RGSS (animated and static sprites as actors or icons)?

PS: I've put the framerate to 60;)