• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OpenTibia SpellCreator: A graphical spell creation enviroment

I got this error when I was trying to change the area effect:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: value
at System.Windows.Forms.ImageList.ImageCollection.Add(Image value)
at  .[T](Dictionary`2 , String , String , Form )
at  .(Object , EventArgs )
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3634 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
SpellCreator
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///E:/Myteka%209.6/Mystic%20Spirit/data/spells/spell%20maker/SpellCreator.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3637 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3634 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3639 (GDR.050727-3600)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Also, it gave me 50 bajillion errors about parsing the .spr file or something like that when I tried it with a 9.6 spr file.
 
Well, the .dat parser is a bit outdated so it probably fails with later versions, and I should update it someday so it parses correctly.
Keep in mind you can safely use an older dat/spr.
 
Ok, I guess I'll just stick with 8.6 for now. Also, how do I make the damage go up according to magic level? I know which feature to set it to, just not what to put in the divisors and addition thingies.
 
I severely recommend you to use a custom damage formula, this is easier to understand.

A custom damage formula, for example, is this:

Minimum damage: 10 * maglevel + 5 * level + 500
Maximum damage: 20 * maglevel + 8 * level + 600

If you'd have 10 magic levels and you're level 10, this would cause the damage to be between: 100 + 50 + 500 = 650 (min) and 200 + 80 + 600 = 880 (max) damage. This scales with level and magic level.

Try a custom formula, much easier to understand.
 
u can easy use the later versions, you only have to edit the combat types or click the right one but you will see a strange preview since it shows another effect then it is on the script but whatever its very easy to fix that on notepad++ :p
 
Have you given any thought to keeping the code cross-platform friendly for Linux/Mono? I'm about to check for myself anyway, but I was curious if that had ever crossed your mind or was a concern at all.

It's nice when a C# program just happens to work under Mono, but it's better when the programmer kept that in mind as he was writing it.
 
Have you given any thought to keeping the code cross-platform friendly for Linux/Mono? I'm about to check for myself anyway, but I was curious if that had ever crossed your mind or was a concern at all.

It's nice when a C# program just happens to work under Mono, but it's better when the programmer kept that in mind as he was writing it.

No, I haven't ever cared about such things to be working for 'nix since the great majority of the users will be using Windows for this. Since I barely have any linux experience/interests it will probably not work since I never cared about it. However, this application uses 0 external dependencies, so it [might] work (no idea tho, no idea how Mono works).
 
Code:
[B][FONT=lucida console]Mono Ahead of Time compiler - compiling assembly /xaekai/workspace/SpellCreator/SpellCreator.exe
Code: 450377 Info: 10812 Ex Info: 9103 Unwind Info: 1963 Class Info: 14347 PLT: 1221 GOT Info: 29634 GOT: 15888 Offsets: 17393
Compiled 1959 out of 1959 methods (100%)
Methods without GOT slots: 1202 (61%)
Direct calls: 171 (13%)
JIT time: 606 ms, Generation time: 97 ms, Assembly+Link time: 25 ms.[/FONT][/B]

It would work just fine it seems... if it weren't for your use of hard coded path separators, aka '\', making a file that is most definitely present not locatable, See Path Separators. This shouldn't be too much work at all
 
I get an error saying:
Unable to add AreaEffect

and

Failed to parse sprite images from .spr.
Unable to read beyond the end of the stream.
 
I get an error saying:
Unable to add AreaEffect

and

Failed to parse sprite images from .spr.
Unable to read beyond the end of the stream.

What .spr/.dat do you use? If you use 9.6, it's a known 'issue' since the .dat parser does not support market names etc. yet, which messes some things up (currently a bug for 9.6 files). You can, however, safely use other .spr and .dat files. It will still work.

It would work just fine it seems... if it weren't for your use of hard coded path separators, aka '\', making a file that is most definitely present not locatable, See Path Separators. This shouldn't be too much work at all

I'll look into it in a week, got some other things to do at the moment. Can't test it myself tho, since I don't have any linux VM or so and I can't be bothered setting it up too.
 
Damn, it seems you are also using some P/Invokes for some WinAPI calls that are most definitely not portable.

[DllImport("kernel32.dll")]
What functions are you importing from this? Perhaps there are managed alternatives. MSDN Win32 to .NET API Map. I understand if you are too busy or if it seems like the benefit doesn't justify the effort. In which case I'll just wait for you to release the source and I'll send you patches for review.

I have no problem carrying out testing from a native Linux platform for you.
 
I only use kernel32.dll to read/write settings.ini, besides that no other dll imports are used. Since using that dll is the easiest/shortest way to achieve it, I'm using it.
The functions WritePrivateProfileString and GetPrivateProfileString are imported.

Well, writing/reading the ini should be do-able on another way, just can't be bothered finding one now =P.
 
@TGYoshi. Hey use the settings option in your project settings instead.
Basically it saves it in XML, but you wont need dependancies for it.

zvAvZ.png


The settings will be loaded automatically on startup.
But you can reset them to default value within the code if soemthing would be fishy
 
The 'best practices' would be to switch to XML.

However there is also this or this or this.

Well, as I've stated I still had to search for such an alternative. Oh well, thanks anyway. Will consider some new ini handling 'soon', maybe. =P

@TGYoshi. Hey use the settings option in your project settings instead.
Basically it saves it in XML, but you wont need dependancies for it.

The settings will be loaded automatically on startup.
But you can reset them to default value within the code if soemthing would be fishy

Well, that could work, but I just severely enjoy editing settings via notepad etc., it's a lot more user friendly and open.
I actually hate xml as well.

Might as well use JSON to save settings actually.


Oh well, the whole project's structure is quite weird built up. I'd almost just rewrite the whole thing.

Thanks for the suggestions tho, guess I'd take the JSON path or some 3rd party ini class.
 
guys iam still be a stupid cuz i can't understand how to make alot of brunsh in same place
i mean u wanna spell hit alot of elements in same place and also wanna make it hit with alot of turns like holy first then ice then energy but with fast hit

- - - Updated - - -

i mean like what zoom did xD

- - - Updated - - -

it's nice can u post video or learn me how u made it
 
Back
Top