Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Development / Re: Wrapper Segfault
« Last post by mdblabs on October 12, 2017, 10:29:38 am »
I think issue is somewhere else... Route is detected fine, just as with char pointers, but still getting segfault.

Code: [Select]
Arguments args;
string quest_path("./quest");
cout << quest_path << endl;
args.add_argument(quest_path); 
MainLoop(args).run();

return 0;

Output:
Code: [Select]
./quest
[Solarus] [0] Info: Solarus 1.6.0
[Solarus] [0] Info: Opening quest './quest'
Segmentation fault: 11

I will review how quests are loaded.
12
General discussion / DreamTales, a Zelda-like videogame
« Last post by Diarandor on October 12, 2017, 12:50:08 am »
Hi! Some news here:

It seems that some devs are working on a new Zelda-like game called DreamTales, where the main mechanic is about turning enemies into chocolate (and then they can be eaten, or pushed like statues). The graphics seem very close to ALTTP, and the plot has a lot of influence from LA too (the hero is inside a dream).

Links here (the second link is in Spanish):
https://www.kickstarter.com/projects/1138694076/dreamtales-turn-monsters-into-chocolate-and-eat-em
http://www.alfabetajuega.com/noticia/the-legend-of-zelda-inspira-dreamtales-un-juego-donde-conviertes-a-tus-enemigos-en-chocolate-d-112835

EDIT: it seems that they need 25.000$ for their kickstarter before the end of this month, so it seems to me that this project will never be finished.
13
Development / Re: Doors and Keys
« Last post by Diarandor on October 11, 2017, 11:01:20 pm »
I'm making the typical door that must be opened whith a small_key and the console give me this errors.
I wonder if someone could help me, its my first game and I'm a noob on programming.
I attach the scrips and the errors.

PD: Sorry if I make mistakes of spealing or something else, i dont have a very high level of English. :)

-The first error (related to "create_door") seems to be in a different script. As the error says, the first argument you are using in that function is of wrong type or missing. You should post that script if you need more help.
-The second error points out that the function "game:add_small_key()" is not defined. You forgot to define it somewhere in some other script.
-There is a typo in left0.lua, line 15: the variable "smal_key1" should be called "small_key1". Also, the last block of code (the one of the "for" loop) should be inside the function "map:on_opening_transition_finished()".
14
Development / Doors and Keys
« Last post by Minefran12 on October 11, 2017, 09:36:24 pm »
I'm making the typical door that must be opened whith a small_key and the console give me this errors.
I wonder if someone could help me, its my first game and I'm a noob on programming.
I attach the scrips and the errors.

PD: Sorry if I make mistakes of spealing or something else, i dont have a very high level of English. :)
15
Development / Re: Wrapper Segfault
« Last post by Christopho on October 11, 2017, 05:52:27 pm »
Just create an empty Argument object and then use add_argument to add them. You don't have to mess with char* pointers.
16
Game art & music / Re: A Free Music / SFX Resource - Over 1000 Tracks
« Last post by Eric Matyas on October 11, 2017, 04:01:12 pm »
Greetings! Here are this week's new free tracks:

On the Puzzle Music 2 page:
"Puzzle Clues" (Looping)
"Music Box Puzzler" (Looping)
"Monkey Island Puzzler" (Looping)
http://soundimage.org/puzzle-music-2/

On the Action 2 page:
"Street Chaos"
http://soundimage.org/action-2/

And on the Chiptunes page:
"8-Bit Perplexion"
http://soundimage.org/chiptunes/

Have a great week!  :-)
17
Development / Re: Wrapper Segfault
« Last post by mdblabs on October 11, 2017, 03:38:28 pm »
Thanks Christopho,

yes, you are right: when I add a nullptr to the end, pointers realocated to the end of the array, which seems is ok.

If I don't add the nullptr, args. parsing fails (doesn't locate quest path). Some traces:

Code: [Select]
std::vector<std::string> arguments = {"","./quest"};
std::vector<char*> argv;

for (const auto& arg : arguments)
    argv.push_back((char*)arg.data());

cout << argv.data() << endl;
argv.push_back(nullptr);
cout << argv.data() << endl;

cout << argv[0] << endl;
cout << argv[1] << endl;

const Arguments args(argv.size() - 1, argv.data());   
MainLoop(args).run();

And the output is:

Code: [Select]
0x7fd09340e2a0
0x7fd093412b90

./quest
[Solarus] [0] Info: Solarus 1.6.0
[Solarus] [0] Info: Opening quest './quest'
Segmentation fault: 11

If I comment "argv.push_back(nullptr);" line, I get:

Code: [Select]
0x7fe0b650b560
0x7fe0b650b560

./quest
[Solarus] [0] Info: Solarus 1.6.0
[Solarus] [0] Info: Opening quest '.'                        <---- ??
[Solarus] [0] Error: No quest was found in the directory '.' <---- ??

We need the nullptr to determine end of argv. Without it, it cannot find path to quest. Is this assumption right?

If so, where is the segfault?
 
18
Development / Re: Wrapper Segfault
« Last post by Christopho on October 11, 2017, 09:54:43 am »
When you do argv.push_back(nullptr), there is a good chance that your arguments vector gets reallocated so the arg.data() pointers are no longer valid.
19
Development / [SOLVED] Wrapper Segfault
« Last post by mdblabs on October 11, 2017, 12:13:47 am »
Hi,
first of all, I would like to thank you for this great open source project, and community!

I'm trying to create an stand-alone version of solarus, wrapping the execution of the quest, just as the editor code does. I have satisfactory compiled solarus library, and I have created a simple scaffolding C++ code to wrap the execution.

Basically, it mimics solarus-editor's "play" functionality, or solarus -run. The idea is to have a stand-alone binary file, which runs the MainLoop. This is just a test, to understand correctly how solarus works.

Here is my basic main:

Code: [Select]
int main()
{
std::vector<std::string> arguments = {"","./quest"};
std::vector<char*> argv;

for (const auto& arg : arguments)
    argv.push_back((char*)arg.data());
argv.push_back(nullptr);

const Arguments args(argv.size() - 1, argv.data());   
MainLoop(args).run();

return 0;
}

My quest folder is on same level as binary file. I am using solarus trunk library version (1.6.0), which I compiled without any issue.

Also, if I open my quest with solarus editor, editor runs it without any problem (it's just a basic, clean, quest).

When I run my binary looks like it detects the quest, but I obtain a segfault when it tries to open it.

Here is my output:
Code: [Select]
./solarus
[Solarus] [0] Info: Solarus 1.6.0
[Solarus] [0] Info: Opening quest './quest'
Segmentation fault: 11

I'm running everything on MacOS and compiled with g++.

Thank you very much for your help.

Best,
mdb
20
Your scripts / Re: A chest created when all the enemies are killed
« Last post by Minefran12 on October 10, 2017, 09:20:45 pm »
Thak you a lot, the problem was i havent declared game:get_value and i have only enemy.on_dead() insted of enemy.on_dead = function(). Tahnks again.
Pages: 1 [2] 3 4 ... 10