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.


Topics - ojars

Pages: 1
1
Issues Help Desk / Error Unknown function or script `audio_play_sound'
« on: August 27, 2019, 03:31:21 pm »
Hi all, I got an error Unknown function or script `audio_play_sound' in my game. After that I created new game with only create event and that function and another .wav file and got the same error.
Quote
Event[0, 0] Check `o_game::create...Syntax error in object `o_game', Create event:0:
Line 1, position 18 (absolute 17): Unknown function or script `audio_play_sound'

In the Game settings Platform is Windows, Graphics was set to Direct3D 11.0 and Audio to DirectSound. After the error I switched Gaphics to OpenGL 3.3 and Audio to OpenAl, and got another error
Quote
D:/Programmas/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.4.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lmodplug
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:139: compile_game] Error 1
make[1]: Leaving directory '/d/Programmas/ENIGMA/enigma-dev/ENIGMAsystem/SHELL'
make: *** [Makefile:20: Game] Error 2
Where is my mistake?

2
Issues Help Desk / Can't configure enigma in ubuntu
« on: June 25, 2019, 02:51:53 am »
Hi. I decided to install ubuntu alongside windows 8.1. All is OK, only I got an error when loaded lateralgm.
Quote
ojars@ojars-darba:~/enigma-dev$ ./start.sh
Java Version: 110003 (11.0.3)
Gtk-Message: 10:35:39.809: Failed to load module "canberra-gtk-module"
Loading lib files in /home/ojars/enigma-dev/lateralgm.jar
01_move.lgl 02_main1.lgl 03_main2.lgl 04_control.lgl
 05_score.lgl 06_extra.lgl 07_draw.lgl
I downloaded enigma.jar file and copied into enigma-dev folder.
Lateralgm starts and and the window opens, and i can create new application, but there are not compiler icons.
How to fix this? This is my first experience with ubuntu, and I don't know many basic things.

3
Programming Help / How to access arrays stored in a ds_list ?
« on: June 10, 2019, 05:22:01 am »
Hi!
I wrote a simple test program. In a o_game create event
Code: [Select]
var arr[3];// = array_create(3);
arr[2] = 52;
arr[1] = 4;
arr[0] = 16
list = ds_list_create();
ds_list_add(list, arr);
then in a o_game draw event
Code: [Select]
draw_set_color(c_black);
draw_set_font(font_0);

var arr = ds_list_find_value(list, 0);// expected to get an array
draw_text(200, 200, "list size = " + string(ds_list_size(list)));
draw_text(200, 220, "array length = " + string(array_length_1d(arr)));
for (var n = 0; n < array_length_1d(arr); n++)
draw_text(100, 100 + n * 20, string(arr[n]));

The only thing I got was:
list size = 1
array length = 0
Perhaps I'm doing something wrong? Is there a way to get access to arrays stored in ds_list?

4
Issues Help Desk / Error implementing struct
« on: May 31, 2019, 06:50:41 am »
Hi!
I got an error, when tried to implement a struct into my code. I followed an example from https://enigma-dev.org/forums/index.php?topic=2674.msg25861#msg25861, where this example worked on Goombert's computer. In Definitions I created a struct
Code: [Select]
struct circle {
  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() { }
};

Script
Code: [Select]
///test_circle()

circle *test = new circle();
test.x = 200;
show_message(string(test.x));

In the o_game Create event
Code: [Select]
test_circle();
And in the Cleanup
Code: [Select]
delete test;
This is an error:
Syntax error in script `test_circle'
Line 3, position 26 (absolute 45): Unknown function or script `circle'

Then I put the code from script directly into the create event and the error is the same:
Event[0, 0] Check `o_game::create...Syntax error in object `o_game', Create event:0:
Line 4, position 26 (absolute 64): Unknown function or script `circle'

What's wrong in my code?

5
Programming Help / Error with bitmask operations
« on: May 29, 2019, 11:56:03 pm »
Hi!
In platformers for a collision checking with obstacles I don't use objects, instead, I create a collision map and use bitmask operations, for example:
if (get_block(x, y + 1) &  (BLOCK | LADDER_TOP))) 
   y = (y&$ffffffe0)+32;
where BLOCK and LADDER_TOP are constants (macros) and get_block() is a script.
In GM this works nice, but in ENIGMA I got an error: C:/Users/User/AppData/Local/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:367:13: error: invalid operands of types 'cs_scalar' {aka 'double'} and 'unsigned int' to binary 'operator&'
  367 |       y =(y & 0xffffffe0)+ 32;
      |           ~ ^ ~~~~~~~~~~
      |           |   |
      |           |   unsigned int
      |           cs_scalar {aka double} 

What is the right way to write such expressions?

6
Issues Help Desk / fatal error: ffi.h: No such file
« on: May 28, 2019, 06:12:13 am »
Hi!
Just installed ENIGMA on a 32 bit windows 8.1 desktop computer, followed instructions from the download page step by step. Started LateralGM from MSYS2 MinGW 32-bit. Then loaded a game "Collapse-game-tutorial.gmk" in LateralGM, pressed Run and the process started. Soon the process stopped with a message "Compile filed at a C++ level". The last line is: C:/Users/Ojars/AppData/Local/ENIGMA/.eobjs/Windows/Windows/Mingw_GCC_G++/Run/Platforms/Win32/WINDOWSexternals.o Platforms/Win32/WINDOWSexternals.cpp
Platforms/Win32/WINDOWSexternals.cpp:44:10: fatal error: ffi.h: No such file or directory
 #include <ffi.h>
compilation terminated.
Searched the whole computer - there's no such files on my computer (WINDOWSexternals.o, ffi.h).
Where do I can find them?

Pages: 1