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
1
Programming Help / Re: Using EDL in LateralGM
« on: May 23, 2016, 01:01:39 am »
@TheExDeus
Well, they really don't for me, still! But yeah, that would be pretty nice if they did. I'll have to think of a hacky workaround now.
Well, they really don't for me, still! But yeah, that would be pretty nice if they did. I'll have to think of a hacky workaround now.
2
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 06:26:11 pm »
Thou art sure?
I added the constructor in definitions
And put this code into a create event
But I am still getting the all familiar error:
It's as if the period still means nothing to Enigma. And the pointer operator worked not.
So is there a way to get around Enigma treating my struct as a normal variable?
I added the constructor in definitions
And put this code into a create event
Code: [Select]
intStats test;
test.amount = 539;
But I am still getting the all familiar error:
Code: [Select]
.h:43:38: error: invalid cast from type ‘itemStats’ to type ‘int’
enigma::varaccess_amount(int(test))= 539;
It's as if the period still means nothing to Enigma. And the pointer operator worked not.
So is there a way to get around Enigma treating my struct as a normal variable?
3
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 01:08:03 pm »
That results in the
Code: [Select]
Syntax error in script `scr_0'
Line 3, position 6 (absolute 43): Expected primary expression before operator
4
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 01:01:40 pm »
Ah, yes, I am on GNU/Linux
Hm, neither of those fixed it. Would it work if I used a different compiler?
Hm, neither of those fixed it. Would it work if I used a different compiler?
5
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 12:46:51 pm »
Strange, I tried your exact examples, and got this error:
Code: [Select]
.h:40:36: error: cast from ‘itemStats*’ to ‘int’ loses precision [-fpermissive]
enigma::varaccess_amount(int(test))= 539;
^
/home/kleber/.enigma/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:41:58: error: cast from ‘itemStats*’ to ‘int’ loses precision [-fpermissive]
show_message(toString(enigma::varaccess_amount(int(test))));
6
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 11:55:24 am »
Oh my bad, I did have that asterisk in there.
Perhaps this code cannot be implemented in scripts (EDL)? Can I only use that with C++ in definitions?
Code: [Select]
itemStats *stats = new itemStats();
Perhaps this code cannot be implemented in scripts (EDL)? Can I only use that with C++ in definitions?
7
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 11:17:20 am »
Haha so I need to dynamically allocate all my structs? Do I also need to free them, then?
And the dot operator replaces the "->" operator?
Edit-
Okie Dokie I tried this in EDL
But alas
And the dot operator replaces the "->" operator?
Edit-
Okie Dokie I tried this in EDL
Code: [Select]
itemStats stats = new itemStats();
But alas
Code: [Select]
Line 8, position 34 (absolute 297): Unknown function or script `itemStats'
8
Programming Help / Re: Using EDL in LateralGM
« on: May 19, 2016, 10:35:01 am »
Aha, thank you very much. Those definitions are quite handy.
I was a bit confused with the final semicolon, as the example over at http://enigma-dev.org/docs/Wiki/ENIGMA:Specification says
I was a bit confused with the final semicolon, as the example over at http://enigma-dev.org/docs/Wiki/ENIGMA:Specification says
Quote
struct circle {Without the final semicolon
var x = 0, y = 0;
double radius;
double get_area() { return pi * radius * radius; } // Simple method
circle(double r = 1) { radius = r }; // Optimizing this falls on the language plugin
~circle() { destroy_radius(x,y,radius); }
}
9
Programming Help / Using EDL in LateralGM
« on: May 19, 2016, 12:13:23 am »
Okie Doke, I'm not really used to Enigma-Dev/LateralGM, so please don't beat me up if I should have known this.
I was happily making game, when I needed a well placed struct. Attempting to build the struct in a script that ran at the start of the game, I found that Enigma did not find my struct to mean anything
scr_init:
made
error:
So is there some way I failed in implementing my EDL? Was a script a bad place to put it? Is my struct malformed?
I was happily making game, when I needed a well placed struct. Attempting to build the struct in a script that ran at the start of the game, I found that Enigma did not find my struct to mean anything
scr_init:
Code: [Select]
struct itemStats {
string itemID = "";
int amount = 1;
}
made
error:
Code: [Select]
Syntax error in script `scr_init'
Line 1, position 18 (absolute 17): Unterminated brace at this point
So is there some way I failed in implementing my EDL? Was a script a bad place to put it? Is my struct malformed?
Pages: 1