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 - Cremno

1
Quote from: KK20 on August 12, 2014, 07:44:17 pmI'm not sure of the exact numbers at the moment but how #repeat? works is that the first frame the key is held down, it returns true. It then returns false for some few frames, and then returns true again until the key is released.
c == 1 || c >= 24 && c % 6 == 0
c is the repeat counter that is incremented or reset by Input.update (usually called once per frame).

It's the same for RGSS2. RGSS1 uses different (lower) numbers.
2
Quote from: Terv on August 10, 2014, 03:31:14 pm
Once again, a heads-up for all those tormented by 1.05: RPGXPU by Cremno
Please note that it doesn't work with the Steam version. Yes, I didn't end the previous sentence with "yet".

Quote from: LiTTleDRAgo on August 10, 2014, 07:30:13 pmLoad RTP Script (now RTP.dll is not needed)
It's great that you're using the "Unicode" functions (well, only in 2 of 3 cases). Not many people do that! But I have to tell you that I'm thinking about writing my own version of it.

By the way, did you know that the RGSS supports up to 9 RTP?
3
Script Troubleshooting / Re: for i in x loop[Resolved]
August 04, 2014, 12:37:37 am
for i in 1..3 do end
p i  #=> 3
(1..3).each do |j| end
p j # => NameError: undefined local variable or method `j' for main:Object


You can also write (which is much clearer than for-loops and #each):
1.upto(3) { |i| do_something(i) }
4
AddFontResource != AddFontResourceEx (especially with FR_PRIVATE)

I think RGSS1 has an internal font list which is initialized at start and that's why calling AddFont* functions don't work afterwards.
5
I don't know exactly why it doesn't work, but it's neither the fault of the (unnecessary) SendMessage call nor Windows 8. Does it work for you or someone else? It doesn't even work for me under the good old Windows XP SP3.

By the way, it works if you write your own Game.exe.
6
Sea of Code / Re: [c] non constant int
August 01, 2011, 05:18:22 pm
To compare two strings in C you have to use strcmp (string.h) or a similiar function. It returns zero when both strings are identical.
DLLIMPORT int code (char s[]) {
if (!strcmp(s, "string1")) return 1;
if (!strcmp(s, "string2")) return 2;
return 0;
}

Notice the removed 20. Strings in C aren't easy to handle as in other languages. And are you sure about the 'S'? If you use the RGSS it has to be 'P'.
7
General Discussion / Re: Decryption Test
July 19, 2011, 05:47:26 pm
"Graphics/Pictures/pedo_corner.jpg"
"Audio/ME/Victory 1.mid"
"pedo_peekaboo"

:3
8
ARC Reactor Engine / Re: Win32API
April 26, 2011, 03:23:06 pm
Thank you but I just tested it and it doesn't compile. It gives me fatal error:
QuoteNMAKE : fatal error U1073: don't know how to make '/include/ruby/ruby.h'

When I first compiled Ruby it worked but that was some Ruby 1.8 version. Ruby on Windows is a pain in the ass but I'll take a look into it.

If you are going to mention me in the credits you can use my nick name.

Edit: Don't forget that you're using Ruby 1.9.2! Enterbrain's DLL uses Ruby 1.8.1 and therefore it misses much features. It's also packed (and crypted). Unpacked it's about 1.5 MB. Another reason for the "small" size is that the RGSS itself uses much Win API calls so code for rendering and bitmap manipulation is provided by Windows and not by self written DLLs.
9
ARC Reactor Engine / Re: Win32API
April 26, 2011, 03:04:04 pm
I used VS2010 because you've also used it to compile the Ruby interpreter. If you include it then don't forget to read the license..

And just to make sure: the RGSS-Win32API is not the same as Ruby 1.9 ones. The original is written in C and was compiled into the RGSS-DLL (not Game.exe). The other one is based on DL and written in Ruby.
If I remember right you can compile DL and Win32API into your Ruby-DLL (msvcr100-ruby191.dll) when you remove the Sharp (#) in front of them in the \ext\Setup file. But as I already said Win32::API is the better choice!


It would be great when you change my name into Cremno.


Edit: I wrote this before I read your edit.
10
ARC Reactor Engine / Re: Win32API
April 26, 2011, 09:14:03 am
No, of course it doesn't work. If you want to have a multi-platform possibility to call dynamic library functions then use Ruby FFI. It's more complex and heavily differs from Win32API and win32-api. Take a look the wiki for more information!

Btw, on Win32 platforms you could provide a Win32API wrapper based on Ruby FFI so it doesn't break compatibility with existing RGSS scripts.
11
ARC Reactor Engine / Re: Win32API
April 26, 2011, 07:02:07 am
Hello guys,

I would appreciate it if you use win32-api instead of the old and crappy Win32API. It's from the same guy and a great successor. The Win32API version in the current Ruby versions isn't.
Either you compile the api.c from the win32-api sources into one of your DLLs or distribute it as SO/DLL. Because of the lack of the (Ruby) header and libs it was a bit time-consuming (distribute them too so users can compile their own extensions!) but I managed to build one: http://cremno.bplaced.net/tmp/api.so

If you download it into Data you can use following code:
require_relative 'api'
include Win32
hwnd = API.new('GetForegroundWindow', 'V', 'L', 'user32').call
mb = API.new 'MessageBox', 'LSSI', 'I', 'user32'
mb.call hwnd, RUBY_DESCRIPTION, 'ARC - win32-api test', 0



And sorry about my username - your spam protection didn't like me  :<_<: