Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: dullman on July 26, 2014, 02:59:11 pm

Title: About making a dll library for use by game
Post by: dullman on July 26, 2014, 02:59:11 pm
Hello i have a problem, im in moment when i need to modify sprite (100 pixels height) with given colors by function, so i know the use of ruby is slow and would take forever, on other hand if i could create a dll which use win32api function it will resolve lags in game, but my problem is i can't find any tutorials on writing win32api dll's (or it's a question if i write a standard dll in c it will work??) I will be very grateful for fast answer.
Title: Re: About making a dll library for use by game
Post by: KK20 on July 26, 2014, 06:45:57 pm
There's a few good links posted in here to get you started.
http://forum.chaos-project.com/index.php/topic,14127.0.html
Have fun learning bitmaps
Title: Re: About making a dll library for use by game
Post by: dullman on July 27, 2014, 12:49:02 pm
Thanks it helps a lot, i write a library that change color on sprite and it's a hell faster than in ruby, now i want to create editor that will modify base rxdata files and save additional stats for all characters (e.g. like charisma eventually the character will loosely based on dnd), and also load them by load_data so i need to modify dll file to support more complicated stuff like custom classes etc. is it even possible and if yes could you give me an example (a simple one is the best)
Title: Re: About making a dll library for use by game
Post by: ThallionDarkshine on July 27, 2014, 02:03:16 pm
Saving and loading custom data structures from files in c++ is a lot more difficult than in ruby (especially if you want them to be readable from ruby). I was pretty sure that there was a library for c++ to save and load files made with Marshal.dump. However, I don't remember the name of it at the moment. My advice would be to create a custom file format for the different types of data you need to manipulate and create loading and saving methods in c++ and ruby.
Title: Re: About making a dll library for use by game
Post by: Blizzard on July 27, 2014, 02:07:06 pm
The funny thing is that Marshal with Ruby classes is actually pretty fast. So you might want to consider using Ruby for "simple" data classes that are supposed to be serialized and don't contain any CPU-heavy methods since they will be much easier to write and fast to serialize and deserialize.
Title: Re: About making a dll library for use by game
Post by: dullman on July 27, 2014, 02:40:03 pm
Hmm you say using a marshal, but what i planned to do is write editor in c# so i don't know if i could have access to ruby methods (marshal in that case) if there is a dll written in c++/c# that serialize files with marshal compatible i want to know, if not then i should write editor with ruby but it's pain in ass to create window application in it.

Edit : I didn't see the answer before blizzard post
if there exist such library i want her, but as loading from ruby i was working on project which loading files from xml takes about 15 sec (need to use graphic.update during it) and it on desktop computer, on weakers it takes more so i wanted to use something which is really fast to load custom database i want to create.
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on July 27, 2014, 04:14:47 pm
I have always used IronRuby embedded in C# to read RMXP data.

IronRuby's Zlib#deflate is not compatible with native Ruby's. I entered a ticket, but development has ceased. I did find a work-around using another Zlib library, though. I can pull up some old source code if you want.
Title: Re: About making a dll library for use by game
Post by: Blizzard on July 27, 2014, 04:51:13 pm
IronRuby uses Marshal 4.8 like RMXP's version 1.8.1 of Ruby?
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on July 27, 2014, 09:09:29 pm
I never even checked which version of Marshal it uses, but I know it works.
I can save/load data back and forth between RMXP and whatever app I am making with no problem. The only I ever has was using Zlib to compress the scripts. RMXP couldn't read the format. Using zlib.net solves that problem, though.
Title: Re: About making a dll library for use by game
Post by: dullman on July 27, 2014, 09:54:37 pm
so if i understand well you use ironruby to read data, whilst zlib.net to pack data and that's enough to be readable by game, and yes source codes are always welcome (since i learning from it much more than books)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on July 28, 2014, 08:00:01 am
No, IronRuby can be used to Marshal data both ways. Zlib only needs used with Scripts.rxdata. The text of the scripts are not saved as just plain strings, but are compressed with Zlib first. You will only need the Zlib library for compressing the scripts before using IronRuby's Marshal to actually save them.

Honestly, I would highly recommend you familiarize yourself with the data structures and formats before taking this on. You are going to need to be in order to make anything work. I can show you some source code which will put you far ahead, but you still won't be able to work with it until you understand it.

And as KK20 pointed out, Bitmap's are a whole different animal. You have to understand exactly how they are structured in memory, and work directly with the memory to make any changes. This requires the use of pointers, or at the very least using LockBits and UnlockBits, which if you are unfamiliar with, you will have to learn as well.

And finally there is the fact that Ruby cannot just use Win32API to work with .NET assemblies by default, like it could with a C library. I did create a tool that will allow you to decorate your methods to export in the same way, but it does add complication.  I don't mean to discourage you, and I will help you out by imparting any knowledge I have about the matter, but attempting this without fully understanding it is going to lead to only frustration. I am pretty good with both languages, and probably more familiar than anyone about interop between C# and RMXP (as far as I am aware, the only one to do it), and it is not a simple thing. I will pull together some code to help out with what I can.
Title: Re: About making a dll library for use by game
Post by: dullman on July 28, 2014, 09:53:55 am
Hmm you sound like it is a hard to do something like that. As for being familiar with datastructures and formats maybe i didn't say it clearly but i want to add entirely new properties to class e.g. for Stats instead of modifying the old ones properties i want to add new one hash with 7 different stats as Keys and it's value will be a value of stats (we will be able to increase stat by one every 4 levels, also it will be modified by traits, states and items). Also it will be modified in Game Character class since i want enemies with similar build (which i make to use new stats by blizz-abs). Second problem is to create completely new classes like Game_item (a class for items, weapons, armors that will have availbility to create a single weapon with random stats - similar to diablo). And because of this i need to create a custom editor. As for sample code i just need to see how it's achieved and with trials and errors i can make it work somehow, if not then the last thing is call for help on forum)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on July 28, 2014, 11:10:36 am
You specified two things you are trying to do:
Quote from: dullman on July 26, 2014, 02:59:11 pm
Hello i have a problem, im in moment when i need to modify sprite (100 pixels height) with given colors by function, so i know the use of ruby is slow and would take forever, on other hand if i could create a dll which use win32api function it will resolve lags in game.


This, the original question, is more complicated, and what I was referring to.


Quote from: dullman on July 27, 2014, 02:40:03 pm
...but what i planned to do is write editor in c# so i don't know if i could have access to ruby methods (marshal in that case) if there is a dll written in c++/c# that serialize files with marshal compatible i want to know

This is much easier, but you still need to have a good understanding of how it works.
Title: Re: About making a dll library for use by game
Post by: dullman on July 28, 2014, 11:20:52 am
Quote from: ForeverZer0 on July 28, 2014, 11:10:36 am
You specified two things you are trying to do:
Quote from: dullman on July 26, 2014, 02:59:11 pm
Hello i have a problem, im in moment when i need to modify sprite (100 pixels height) with given colors by function, so i know the use of ruby is slow and would take forever, on other hand if i could create a dll which use win32api function it will resolve lags in game.


This, the original question, is more complicated, and what I was referring to.


Quote from: dullman on July 27, 2014, 02:40:03 pm
...but what i planned to do is write editor in c# so i don't know if i could have access to ruby methods (marshal in that case) if there is a dll written in c++/c# that serialize files with marshal compatible i want to know

Yes i know i tried to use this topic and ask new question without opening new topic it's my fault that you misunderstood
This is much easier, but you still need to have a good understanding of how it works.
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on July 28, 2014, 12:46:53 pm
RPG Module (Ruby Script) (http://pastebin.com/9zhByR7C)

RMXP Hidden Classes (Ruby Script) (http://pastebin.com/ffjEtmKH)

Ruby Class (C#) (http://pastebin.com/DcyLfmpE)

Add references to:


To load data:
dynamic actors = Ruby.MarshalLoad(@"Data\Actors.rxdata")


To save data:
Ruby.MarshalDump(@"Data\Actors.rxdata", actors)


There are a few things you need to be careful about, such as handling strings and string encoding, how to dynamically add data to Ruby classes at run-time, etc., but you seem to know what you are doing with that. Let me know if you need anything else.
Title: Re: About making a dll library for use by game
Post by: dullman on August 08, 2014, 08:18:52 pm
So i was following you instruction (I know it's late but decided to rewrite base classes first) and what i get is error (null reference even though the data is array of byte), is there any other thing to take care of??

EDIT: Sorry i resolved a problem just forgot to initialize ruby class, now i have a question how to add to ruby object new field (like for actor field attack) also new class object (like add new actor to Actors).

I thought about way around this just save modified class one more time from game, but it will require to do that every time i want to add new skill/trait/actor etc.


Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 08, 2014, 10:56:06 pm
To create a new Ruby object in C#:

dynamic actors = Ruby.Eval("$data_actors");
dynamic actor = Ruby.Eval("RPG::Actor.new")
actors.Add(actor)
Title: Re: About making a dll library for use by game
Post by: dullman on August 09, 2014, 02:30:31 am
Eval there isn't any method in Ruby class with this name, so it causes an error.
ps. After tinkering with editor in c# i'm starting thinking that keeping values in xml files(or json i don't still know which is faster to read) is easier and much more desirable since i made many changes in Game_battler since i wanted game_enemies and game_actors similar to each other (e.g. both have levels, traits, the same way hp and mp are counted etc.). Even if i had a long time loading new actors, that on other hand easier to make editor for game (or even without it will be fine if i know the file structure), so what do you think which approach will be better for me?
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 09, 2014, 05:52:39 am
Oops, I thought I included the method in the code I gave you.
Spoiler: ShowHide
		public static dynamic Eval(string code)
{
return Engine.Execute(code, Scope);
}

public static T Eval<T>(string code)
{
return Engine.Execute<T>(code, Scope);
}


I personally don't see any reason to use XML or JSON, IronRuby interops very well with C#, allowing you to call C# code from Ruby, and Ruby code from C#, I would highly suggest you look into it, it is actually quite simple if you have a pretty good grasp on both languages.

I built an editor for RMXP using C#, actually just needed to finish the animation tab in the database, and make some tweeks, and it was easy using the two together.

If you are unfamiliar with the "dynamic" keyword in C#, it makes all this very easy, and you do not even need to build C# classes for anything. For example, using the code above I gave you:

Spoiler: ShowHide
			var weapons = Ruby.MarshalLoad(@"Data\Weapons.rxdata");
var actors = Ruby.MarshalLoad(@"Data\Actors.rxdata");
var firstActor = actors[1];
var weapon = weapons[firstActor.weapon_id];
MessageBox.Show(weapon.name.ToString());


Just remember that a Ruby string is a MutableString, not a System.String, so you will need to convert it to a System.String before you can use it as such, simply by using #.ToString() on it. I made an extension method to convert it back to a MutableString.

Spoiler: ShowHide
		public static MutableString ToRubyString(this string clrString)
{
return MutableString.Create(clrString, RubyEncoding.UTF8);
}

Title: Re: About making a dll library for use by game
Post by: dullman on August 09, 2014, 10:25:06 am
Quote
Just remember that a Ruby string is a MutableString, not a System.String, so you will need to convert it to a System.String before you can use it as such, simply by using #.ToString() on it. I made an extension method to convert it back to a MutableString.


Uuu it's means that i need write a converter for all strings (i use wpf application so to easy to Bind to value (although there where some problems with it but resolved)).
Also one more question to access hash from ruby e.g. i have a stats hash which keep the stats for both actor and enemies, so access i need write something like that:
actor.stats['stat_name'] = value

or it's wrong way to access from c# to hash value?

ps. I resigned from keeping values in external json or xml files since i don't want to spend my time for writing library in ruby to parse them (since using require doesn't work, althougth i read that json library is included in 1.9.2 Core libs in ruby so if i wanted to use XPA it will be possible)

EDIT One more question is there a clone method for dynamic object (like i want to clone system when making some changes)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 09, 2014, 11:08:32 am
Yes, you can reference a hash that way, but you will need to use double-quotes, since-single quotes in C# are for chars.

You do not need to write a converter, just make sure that any string that will be loaded by RMXP is not a System.String. You can simply use the extension method I gave you.

actor.name = "This is a C# string".ToRubyString();


// To use as a system string in C#
var name = actor.name.ToString();




Title: Re: About making a dll library for use by game
Post by: dullman on August 09, 2014, 12:41:58 pm
I asked in previous post after editing, but it seems it was after you answered so i ask one more time in new post.
Is there any clone method that return you a new copy of object for dynamic type?? Or i need to create it myself??
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 09, 2014, 01:06:15 pm
Have you tried this?

var copy = Ruby.Eval("some_object.clone")


If not, I have made a deep-clone method, but it I have never tested it on IronRuby types. It would normally require the object be serializable, but I am not sure if Ruby automatically makes objects serializable or not.

If not, you can just make modification of it to use Marshal instead of a BinaryWriter and BinaryReader.
Spoiler: ShowHide
		using System.Runtime.Serialization;
        using System.Runtime.Serialization.Formatters.Binary;

public static object CloneObject(object obj)
{
using (var memStream = new MemoryStream())
{
var binaryFormatter = new BinaryFormatter(null,
new StreamingContext(StreamingContextStates.Clone));
binaryFormatter.Serialize(memStream, obj);
memStream.Seek(0, SeekOrigin.Begin);
return binaryFormatter.Deserialize(memStream);
}
}
Title: Re: About making a dll library for use by game
Post by: dullman on August 10, 2014, 12:50:58 am
I wrote my own clone method for system class, because i tried some method with serialization and error cames that it ruby objects are not serializable.
But it's not what i wanted to ask, my question for today is how to add new key and value to hash simply accessing through array gives an error that value does not exist, also the second question is how to check if key exists in hash.

ps. sorry for asking many question but after i write editor it should be less question from my end.

EDIT : there is one thing i wanted to ask is there a good reason to keep in arrays a nil object on 0 index?? is there needed by game if yes where?? I Ask since my arrays are keep objects from index 0, so they don't have a nil object in the beginnig.

EDIT2 : i found how to set up a new value in hash (it seems that has the same methods as hastable class of c#)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 10, 2014, 05:47:52 am
Quote from: dullman on August 10, 2014, 12:50:58 am
...also the second question is how to check if key exists in hash.


If I remember correctly, you can use a hash exactly the same as C# Dictionary<object, object>, since that is the actual underlying type being used. I am pretty sure methods like "hash.ContainsKey(keyName)" work.

Quote from: dullman on August 10, 2014, 12:50:58 am
ps. sorry for asking many question but after i write editor it should be less question from my end.


It's not a problem, that's what this section of the forum is for.

Quote from: dullman on August 10, 2014, 12:50:58 am
EDIT : there is one thing i wanted to ask is there a good reason to keep in arrays a nil object on 0 index?? is there needed by game if yes where?? I Ask since my arrays are keep objects from index 0, so they don't have a nil object in the beginnig.


Yes, to be compatible with RMXP, you need null at the beginning. It's annoying always having to check if an element is not null when using "foreach" iterators, but that's the way Enterbrain designed it. It's simply so that all the database items "id" property match up o the corresponding array index.
Title: Re: About making a dll library for use by game
Post by: dullman on August 10, 2014, 07:29:32 am
QuoteYes, to be compatible with RMXP, you need null at the beginning. It's annoying always having to check if an element is not null when using "foreach" iterators, but that's the way Enterbrain designed it. It's simply so that all the database items "id" property match up o the corresponding array index.

I think I let myself to rewrite this and use objects that doesn't nil in the beginning at least for all class I will rewrite, like animation class I believe that don't need to be changed (at least now in the beginning of writing my own game, in the future maybe it will be changed)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 10, 2014, 08:01:49 am
Compatibility is not something to take lightly, and "re-writing" the core classes is not a good idea at all if you want someone to ever actually use this. You basically are making it incompatible with the majority of existing scripts out there, just because you don't want to have to check if an item is null inside a loop. It's really not that difficult to do or work with.

			// With a "for" loop
for (var id = 1; id < actors.size; id++)
{
// Do stuff with actors
}

// With a "foreach" loop
foreach (dynamic actor in actors)
{
if (actor == null)
continue;
// Do stuff with actors
}


And if that is too difficult, you could always just write up a quick custom enumerator.

It's going to be especially horrible if you decide to have some use a 0 index, while others use a starting index of 1. That's just plain old bad programming. It's your project, and you do with it what you please, but I am just giving you a little insight from experience and knowledge I have gained: If you decide to take this route, my opinion is your project is going to fail.
Title: Re: About making a dll library for use by game
Post by: dullman on August 10, 2014, 08:28:46 am
Quote from: ForeverZer0 on August 10, 2014, 08:01:49 am
Compatibility is not something to take lightly, and "re-writing" the core classes is not a good idea at all if you want someone to ever actually use this. You basically are making it incompatible with the majority of existing scripts out there, just because you don't want to have to check if an item is null inside a loop. It's really not that difficult to do or work with.

			// With a "for" loop
for (var id = 1; id < actors.size; id++)
{
// Do stuff with actors
}

// With a "foreach" loop
foreach (dynamic actor in actors)
{
if (actor == null)
continue;
// Do stuff with actors
}


And if that is too difficult, you could always just write up a quick custom enumerator.

It's going to be especially horrible if you decide to have some use a 0 index, while others use a starting index of 1. That's just plain old bad programming. It's your project, and you do with it what you please, but I am just giving you a little insight from experience and knowledge I have gained: If you decide to take this route, my opinion is your project is going to fail.


I know it's some bad programming but i'm too lazy to rewrite entire rpg maker engine (i waited few years to arc engine to be completed :) ). Also here the difference that will make my own classes unique and probably increase resources requirements, the RPG keep objects static in $data arrays, all other object keep their id as identifier whilst my modified class will keep an instance of object and to identify object use their name (like class name, also it the reason i use hash for stats since i want in the middle of development add freely new stat, class etc.), the id property i keep only for compatibility with RPG standard classes and editor. The only modified class by me that will be kept and used like standard RPG Maker is Skill class but it because i didn't want to rewrite Blizz-Abs script (i believe it should have some AI o decide if enemy|actor use skill in battle and since battle systems are the only systems that i failed to create)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 10, 2014, 09:18:11 am
What you are saying does not make sense. You cannot remove the nil value at the beginning of the data array, and somehoe expect that the array can still be referenced the same by RMXP and other scripts. You say that you are not rewriting the engine, but your removing the nil element is going to require you do that. Sure, your project might be able to find the correct item if its comparing the class, but nothing else in the engine or scripts does that, so their screwed.

If all you are trying to do is dynamically add new stats, you are going completely the wrong way about doing it. Google "Ruby meta-programming". Ruby is dynamic, you can build new classes and methods dynamically at run-time without totally throwing compatibility out the window. Your classes are going to be unique in the regard that they cannot work with anything other than your project.

What exactly are you trying to re-write here? Are you talking about re-writing the RPG module and classes, and basically a new editor for the database?
Title: Re: About making a dll library for use by game
Post by: dullman on August 10, 2014, 09:54:34 am
Basically yes i'm talking about rewriting many of base class from RPG Module so is that why i need an editor, I know that i need to rewrite many scripts but it will be done, the only what i can't do is to write my own BattleSystem (although i use a few scripts that i made compatible with my changes like your CMS), the only i can is minor fixes to that so basically i left BS as i received from forum (i rewrited damage, maxhp, hit tests to fit my idea what ideal battle should look like ( i like games based on DnD rules so it will pretty similar)). E.g For classes i added few improvements (for now i see in future that will add more when i have a basic editor completed), half properties i keep only for compatibility with RPGMaker editor(but it also could be removed since my game will not use them at all - I will remove all references to them), and other half i will use in game. The new properties i added to class is e.g. type_of_weapons that class can use so if weapon tags include tag from type_of_weapons the actor can use a weapon.

ps. I will basically re-write many of RPG modules, some fixes to BlizzAbs, Add Many new function since game will be basically a sim game with rpg elements, Many of Windows because i want the main controller of game will be mouse (Although i'm pretty satisfied how your CMS work with mouse_controller from blizzard), Scenes since base res will be 1024x768, and also add many new scenes to make possible to manage sim character of game, after i complete editor i will search for script that enlarge tiles to make it compatible with sprites about 120 pixels height, and might change sprite class to support more than four frames in sprites (since i want an animation of every work for every sprite), Many Game classes will be also rewrote to fit them to sim character of my game, basically i rewrite everything besides maps and classes that are bound with Map and Graphics (besides res script). Since From the beginning i wanted to use Xna and C# to make my own engine, but to lazy to write editor with maps so i decided to go with rpg maker.
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 10, 2014, 10:31:52 am
Sound like the editor is as big as project as a the game itself. If this for a game you yourself are creating, why even make an editor? Everything you just said is easier to just script it.
Title: Re: About making a dll library for use by game
Post by: dullman on August 10, 2014, 10:55:11 am
In the game that i'm in team (at least was) we have currently 400+ actors, all include in the script is pain to ass.

Also second argument i want to be able easy adjustment to their strength, traits (add or remove depends on if it fits to character).

Third argument after i'm making a tech demo i will go crowdfunding to find money to pay for spriters to make custom animation (if i will have enough also custom tilesets, and everything else that i might need to game, Also i know that first i need to ask authors of script if I can use in semi-commercial project like that, although the game will be free, the same with source code i plan to release dlc to game with new class, actors etc. depends on the money i gained through crowdfunding). Also i want find some team members who will share their vision of game with me, help me with base project, write events, add new ideas (like classes, jobs, traits or even stats) so i want to have a tool that they could work on game along with me.

Fourth argument i want the game to be easy moddable, so everyone interested can add to game their own events, actors, class and much more.

Fifth argument i don't like keep information of objects in scripts, it not easy moddable and everytime i want to change value i need to open RPG Maker XP or Gemini.

I know it will be many work in this game so i give myself a few years to complete project but when i have time and will i will work during free time on it.
Also i want to see more games that are using many custom scripts, so i have a hope that i inspire someone to make new game (although only in xp because i hate chibi sprites in VX and Ace)
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 10, 2014, 11:05:22 am
I don't know, my opinion is unchanged, still easier to script, you have to open an editor either way. I don't mean to turn you off to the idea, I have created many things that are actually unnecessary just to have fun creating it, so I understand that completely.
Title: Re: About making a dll library for use by game
Post by: dullman on August 10, 2014, 09:19:46 pm
Quote from: ForeverZer0 on August 10, 2014, 11:05:22 am
I don't know, my opinion is unchanged, still easier to script, you have to open an editor either way. I don't mean to turn you off to the idea, I have created many things that are actually unnecessary just to have fun creating it, so I understand that completely.


Every one has their opinion i like to keep all base information in separate files or objects, but your approach to keep all in scripts have also some pros, first and mos important all changes are compatible with saves, on other hand i prefer decreased time in creating new actor, class etc when i would have an editor.

Also as the this part is used to ask question i have another:
what i want to is to add a value to database, and also modifying existing scripts in rpg maker, so i have a condition name for adding bonus to actors, when i add to DB in editor i want to add in four places information about that: three are methods get_bonus(value = 0) in trait, base_item and state class and one is a const in module that keep information regarding how const is named in hash with bonuses. So my question is how to access script data, and if there a function that after accessing i can find a chosen fragment of texts (like regexp for ironruby or find option).
Title: Re: About making a dll library for use by game
Post by: ForeverZer0 on August 10, 2014, 10:24:48 pm
This is what I meant when you need to understand the data structure of RMXP very well before doing this. This is why I included the Zlib methods in the Ruby class I showed you.

var scripts = Ruby.MarshalLoad(@"Data\Scripts.rxdata");

foreach (var script in scripts)
{
    var id = script[0]; // Unique ID assigned to every script
    var title = script[1].ToString(); // Script title
    var compressedText = script[2]; // IronRuby.MuteableString compressed with Zlib
    var text = Ruby.ZlibInflate(compressedText); // This is your script text as a System.String
}


Title: Re: About making a dll library for use by game
Post by: dullman on August 21, 2014, 07:25:35 am
I need a help with editor, what i want is to add item to loot but to do that in proper way i need to find if item is Weapon, Armor Or Item class, if i getType() it returns RubyObject, so is there any way to check in c# what type of ruby object is it??
Title: Re: About making a dll library for use by game
Post by: G_G on August 21, 2014, 10:09:39 am
Do your eval function.

var isItem = Ruby.Eval("item.is_a?(RPG::Item)");