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.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 »
226
Programming Help / Re: How are instances working?
« on: February 23, 2015, 08:45:55 am »
Maybe it's because of the pointer. But it should still show. Templates are the only thing I know which makes the function invisible. Sadly the parser doesn't output anywhere when LGM uses it, so we cannot tell where the error is. Where is lua_State defined? Maybe it cannot find that, so it errors.
Quote
EDIT: I just tested draw_string(..., ..., string str) in lua with draw_string(..., ..., 1) and it worked, mysterious...I guess LUA can cast numbers to strings automatically.
227
Programming Help / Re: How are instances working?
« on: February 23, 2015, 05:13:24 am »
Yeah, you need to add variant as a type. I don't know if you can do that in LUA. I can do it in AS, but it's not that trivial (as variant isn't actually that trivial).
If you need to make wrappers anyway, then you could wrap the thing like you suggest:
If you need to make wrappers anyway, then you could wrap the thing like you suggest:
Code: (edl) [Select]
void draw_text(gs_scalar x, gs_scalar y, string str){
draw_text(x, y, str); //This calls draw_text(gs_scalar x, gs_scalar y, variant str)
}
Then of course some things won't work, like this:Code: (edl) [Select]
draw_text(x, y, 5.3);
Which is valid in EDL and GML, as reals can be cast to variant, but they cannot be cast to strings (stl strings have special casting functions for that). I want to implement variant and varargs in AS, but have put that on a backburner right now, as I don't actually need to use EDL in AS. I just need it working in ENIGMA so I can use the few functions I need.
228
Programming Help / Re: Am I using the BasicGUI extension correctly?
« on: February 23, 2015, 05:05:05 am »
Yeah, I haven't made doc's yet, because I haven't finished the extension. I want to add textboxes, scroll bars and stuff like that.
You are doing everything correctly as far as I can see. Callback is just a script that is called. When you left click the button, the script should be executed. It should also pass arguments to it identifying the event, button id and so on. I haven't found a better way to do this, as don't support Lambda functions or the like. The extension is far more advanced in the branch here: https://github.com/enigma-dev/enigma-dev/tree/GL3.3NormalMatrix
I am saying that, because I can make you an example, but it will only work in that branch, as many things have changed. For example, in the callback function you can actually specify the event (right now it can be pressed, released or hover). Or the windows can be resized.
I have attached a simple example. It shows how many elements work, including toggles, buttons, windows, groups, sliders, styles, skins and callbacks.
I would appreciate feedback on how to progress with it. Originally I took Unity3D as reference, but because of the way EGL/GML works I was quite limited. For example, I cannot create one function window_add_element which adds buttons, toggles, other windows etc. I have to create a function for every element type. Callbacks calling scripts is also the only way I know how they could work. But as everything is calculated in _draw function, then the callback calls the script inside that object as well. So if you want a button to do something for another object, you have to do "with (obj_){}" inside the callback. None of this is particularly ugly, as that is how GM done it for years, so most people got used to it. But I personally want this to be prettier.
Another thing I want to do is allow "texture" to be set as image or as content. So you can have the regular button style, but the content is not text, but another image. I want this so I could add surfaces as backgrounds. Right now you have _set_sprite, which uses a sprite. If I want to use backgrounds, I will need to add _set_background, for surfaces _set_surface. It multiplies the number of functions for no good reason. I could add _set_texture which would replace all of the functions, but then you would have to call _set_texture(sprite_get_texture(spr_button, 0)) which is not pretty again. And sprites can be animated, which is not possible with textures without you incrementing the second argument explicitly.
Here is screenshot for the example:
I put an ugly ass ghost image in the background to check transparency. I should probably replace it.
You are doing everything correctly as far as I can see. Callback is just a script that is called. When you left click the button, the script should be executed. It should also pass arguments to it identifying the event, button id and so on. I haven't found a better way to do this, as don't support Lambda functions or the like. The extension is far more advanced in the branch here: https://github.com/enigma-dev/enigma-dev/tree/GL3.3NormalMatrix
I am saying that, because I can make you an example, but it will only work in that branch, as many things have changed. For example, in the callback function you can actually specify the event (right now it can be pressed, released or hover). Or the windows can be resized.
I have attached a simple example. It shows how many elements work, including toggles, buttons, windows, groups, sliders, styles, skins and callbacks.
I would appreciate feedback on how to progress with it. Originally I took Unity3D as reference, but because of the way EGL/GML works I was quite limited. For example, I cannot create one function window_add_element which adds buttons, toggles, other windows etc. I have to create a function for every element type. Callbacks calling scripts is also the only way I know how they could work. But as everything is calculated in _draw function, then the callback calls the script inside that object as well. So if you want a button to do something for another object, you have to do "with (obj_){}" inside the callback. None of this is particularly ugly, as that is how GM done it for years, so most people got used to it. But I personally want this to be prettier.
Another thing I want to do is allow "texture" to be set as image or as content. So you can have the regular button style, but the content is not text, but another image. I want this so I could add surfaces as backgrounds. Right now you have _set_sprite, which uses a sprite. If I want to use backgrounds, I will need to add _set_background, for surfaces _set_surface. It multiplies the number of functions for no good reason. I could add _set_texture which would replace all of the functions, but then you would have to call _set_texture(sprite_get_texture(spr_button, 0)) which is not pretty again. And sprites can be animated, which is not possible with textures without you incrementing the second argument explicitly.
Here is screenshot for the example:
I put an ugly ass ghost image in the background to check transparency. I should probably replace it.
229
Programming Help / Re: How are instances working?
« on: February 22, 2015, 09:50:08 am »
instance_t is defined in "instance_system_base.h" which is included from "Universal_System/instance_iterator.h" (which is what I include in my project). There you can see that instance_t is just typedef for int. So in AngelScript I do this for all the types we have typedef'd. I do have problems with more complex types, like vararg.
Code: (edl) [Select]
r = engine->RegisterObjectType("ma_scalar", sizeof(ma_scalar), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("cs_scalar", sizeof(cs_scalar), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("as_scalar", sizeof(as_scalar), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("gs_scalar", sizeof(gs_scalar), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("char", sizeof(char), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("time_t", sizeof(time_t), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("instance_t", sizeof(instance_t), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("size_t", sizeof(size_t), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("uint32_t", sizeof(uint32_t), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
r = engine->RegisterObjectType("long", sizeof(long), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_C); assert( r >= 0 );
Header having this:Code: (edl) [Select]
using enigma::instance_t;
230
Issues Help Desk / Re: Extension .egm does not match EGM?
« on: February 20, 2015, 10:56:35 am »
Actually XML parsing with things like RapidXML takes almost the same amount of cycles as strlen. I believe current YAML implementations take more.
But my beef isn't about the speed or the features we will never use, it's about the whole thing being ugly to use, just like python is ugly to use because of the indent bullshit. But I guess all of that is subjective, so save it as you want. Just make sure every parameters is optional, so EGM never breaks again.
But my beef isn't about the speed or the features we will never use, it's about the whole thing being ugly to use, just like python is ugly to use because of the indent bullshit. But I guess all of that is subjective, so save it as you want. Just make sure every parameters is optional, so EGM never breaks again.
231
Off-Topic / Re: what if Atari bought GM instead?
« on: February 19, 2015, 07:51:55 pm »
They still plan to release GM2 later this year.
Also, they cannot "disallow people using ENIGMA". They cannot disallow anything. Just like YYG couldn't.
Also, they cannot "disallow people using ENIGMA". They cannot disallow anything. Just like YYG couldn't.
232
Issues Help Desk / Re: Extension .egm does not match EGM?
« on: February 19, 2015, 09:47:13 am »
You can use attributes in XML though, which greatly reduces verbosity.
Your example in xml:
Your example in xml:
Code: (xml) [Select]
<room name="room_0" background_color="00C0FF">
<background name="bkg_3" depth="1000" h-repeat="yes" v-repeat="no"/>
<background name="bkg_overlay" depth="-1000" h-repeat="no" v-repeat="no"/>
<view id="0">
<viewport x="0" y="0" w="640" h="480" />
<projection x="0" y="0" w="640" h="480" />
<follow object="obj_player" border_w="32" border_h="24" speed_w="4" speed_h="4" />
</view>
<object_list>
<obj name="obj_player" id="0" />
<obj name="obj_dirtwall" id="1" />
<obj name="obj_7" id="2" />
<object_list/>
<inst id="1000001" obj="0" x="64" y="400"/>
<inst id="1000002" obj="1" x="0" y="432"/>
<inst id="1000003" obj="1" x="32" y="432"/>
<inst id="1000004" obj="1" x="64" y="432"/>
<inst id="1000006" obj="1" x="128" y="432"/>
<inst id="1000007" obj="1" x="160" y="432"/>
<inst id="1000008" obj="1" x="192" y="432"/>
<inst id="1000009" obj="2" x="32" y="432"/>
<crc ind="1000001">
can_fly = false;
</crc>
<crc ind="1000008">
text = "To jump, press [space].";
</crc>
</room>
And it can be less verbose than that. I just like xml syntax more than YAML (I hate when tabs count as syntax), but I really don't like any of them.
233
Announcements / Re: Google Summer of Code
« on: February 18, 2015, 04:50:46 pm »
Can't use the EDC Rackspace account for developing?
234
Off-Topic / Re: what if Atari bought GM instead?
« on: February 18, 2015, 01:38:01 pm »
Nothing to do with GM has ever influenced ENIGMA. It has been a burden in some regards (because of some developers push for 100% GM compatibility), but other than that it has never been an influence. Heck, I haven't used GM in years now and don't follow anything they do.
I do have a plan to experimentally fork ENIGMA and get rid of at least 50% of useless crap in it. Like probably GL1 together with both DX will be dropped. So will many other systems. Maintaining 20 things for 3 developers is really impossible and me alone even more so. Compatibility wise nothing much will change though, it just won't support GM5 and other prehistoric things like that. Right now I will maybe do this in my branch and see if I have to really fork anything. I want to add textures pages, default to per-pixel lighting (with plans to go deferred shading by default later) and other things.
I do have a plan to experimentally fork ENIGMA and get rid of at least 50% of useless crap in it. Like probably GL1 together with both DX will be dropped. So will many other systems. Maintaining 20 things for 3 developers is really impossible and me alone even more so. Compatibility wise nothing much will change though, it just won't support GM5 and other prehistoric things like that. Right now I will maybe do this in my branch and see if I have to really fork anything. I want to add textures pages, default to per-pixel lighting (with plans to go deferred shading by default later) and other things.
235
Programming Help / Re: How are instances working?
« on: February 16, 2015, 01:41:42 pm »
I made a parser that takes the function list that LGM makes and creates C++ code that registers the functions. I don't write all of them by hand either. I would probably go insane after only a hundred.
236
Programming Help / Re: How are instances working?
« on: February 16, 2015, 12:08:00 pm »
You mean from an C++ extension? I haven't done that previously, but Josh should know. I think it's possible, but can be very dangerous. I guess this is connected to your Lua extension? Right now I'm working on AngelScript and for that I can register functions and variables quite easily. But I don't think that I will support getting user variables though. Like "int x= 10; instance_create(x,10,obj_1);" will work (and it does now) from the script file, but something like "instance_create(obj_0.variables,obj_3.other_variable)" will probably never work. This would require me to register the whole runtime engine, which would be painful to do. Right now I'm trying to register all 1.6k ENIGMA functions and I'm making progress.
237
Programming Help / Re: How are instances working?
« on: February 16, 2015, 11:45:54 am »
Each object you create is generated as a struct (thought there is very little difference between struct and class in C++). It is then cast or inherits some other things when needed (enigma::object_basic when used in iteration or enigma::object_graphics when needed for drawing etc.).
You can see the generated code in "C:\ProgramData\ENIGMA\Preprocessor_Environment_Editable" after you press compile for the first time. IDE_EDIT_object_switch.h, IDE_EDIT_objectaccess.h, IDE_EDIT_objectdeclarations.h and IDE_EDIT_objectfunctionality.h deal with objects. IDE_EDIT_objectfunctionality.h has the parsed version of your code.
You can see the generated code in "C:\ProgramData\ENIGMA\Preprocessor_Environment_Editable" after you press compile for the first time. IDE_EDIT_object_switch.h, IDE_EDIT_objectaccess.h, IDE_EDIT_objectdeclarations.h and IDE_EDIT_objectfunctionality.h deal with objects. IDE_EDIT_objectfunctionality.h has the parsed version of your code.
238
Issues Help Desk / Re: ENIGMA not working with JAVA 8 WTF!
« on: February 13, 2015, 09:08:46 pm »
We can put a giant notice around Java errors, so people knows it's Java.
239
Issues Help Desk / Re: ENIGMA not working with JAVA 8 WTF!
« on: February 13, 2015, 10:41:59 am »
So if you open cmd and type "java -version" you get "java version "1.8.0_31""?
Here is what I get:
Try adding path to the ini like it says in the wiki. I have a feeling it defaults to something else. When I had your problem (which you would know I had if you read the topic I posted) I just uninstalled Java7 and it worked.
The error is actually BY Java, not by us. It has zero things to do with ENIGMA.
http://stackoverflow.com/questions/26324486/properly-installing-java-8-along-with-java-7
You probably have some java.exe files in system32 or symlinks somewhere else. There are plenty of topics about this problem.
edit:
edit2: I think this might be your problem: http://stackoverflow.com/a/27756484
Here is what I get:
Quote
C:\>java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)
Quote
and yes the PATH is correct, why wouldn't it beThat is hardly technical thinking there. It's like saying you have BSOD because of GPU driver, yet no need to check as it is up-to-date, why wouldn't it be?
Try adding path to the ini like it says in the wiki. I have a feeling it defaults to something else. When I had your problem (which you would know I had if you read the topic I posted) I just uninstalled Java7 and it worked.
The error is actually BY Java, not by us. It has zero things to do with ENIGMA.
Quote
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion' has value '1.8', but '1.7' is required.http://stackoverflow.com/questions/15277496/registry-key-has-value-1-7-but-1-6-is-required-java-1-7-is-installed
http://stackoverflow.com/questions/26324486/properly-installing-java-8-along-with-java-7
You probably have some java.exe files in system32 or symlinks somewhere else. There are plenty of topics about this problem.
edit:
Quote
perhaps enigma should be updated to support future JAVA versions.This is nothing to do with ENIGMA or LGM.
The problem is ENIGMA.EXE
edit2: I think this might be your problem: http://stackoverflow.com/a/27756484
240
Issues Help Desk / Re: ENIGMA not working with JAVA 8 WTF!
« on: February 13, 2015, 03:07:00 am »
I have Java version 1.8.0_25 (which is Version 8 build 25) and I run LGM fine. So there must be another issue. Clearly if it cannot find Java then it's a problem with PATH. Does "java -version" work for you in cmd? And what bit version is it? LGM is a 32bit jar, so it requires a 32bit Java. You can see how to install both, but use 32bit in the wiki (http://enigma-dev.org/docs/Wiki/Install:Parallel_Java).
I know that newest install package has it's problems (hint: egm), but blaming everything on ENIGMA seems absurd. I have zero problems with it.
Edit: All of this was mentioned in Java8 topic as well http://enigma-dev.org/forums/index.php?topic=2307.0 .
I know that newest install package has it's problems (hint: egm), but blaming everything on ENIGMA seems absurd. I have zero problems with it.
Edit: All of this was mentioned in Java8 topic as well http://enigma-dev.org/forums/index.php?topic=2307.0 .
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 »