trying to make new cards but can't "build" with camelbox...
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
trying to make new cards but can't "build" with camelbox...
by aquilla » 15 Jan 2015, 12:25
Hiho, I decided to try and add some new cards to manalink. The text editing seems to work properly, though tedious, but when I decided to move on to coding I can't even really get started. Basically, build.pl never seems to create the manalink dll. I get an error 1 at the "make" command.
-I've been following this tutorial: http://www.slightlymagic.net/wiki/Codin ... C_Tutorial
-I got the manalink off of http://pierre.gonnetan.free.fr/ because I had problems downloading it elsewhere.
-Camelbox from http://www.softpedia.com/progDownload/C ... 05269.html
This is my build file, in case there's something wrong with it
Thanks,
Freddan
-I've been following this tutorial: http://www.slightlymagic.net/wiki/Codin ... C_Tutorial
-I got the manalink off of http://pierre.gonnetan.free.fr/ because I had problems downloading it elsewhere.
-Camelbox from http://www.softpedia.com/progDownload/C ... 05269.html
This is my build file, in case there's something wrong with it
- Code: Select all
use strict;
use warnings;
use File::Copy;
# Open ManalinkEh.asm and add in the new card / function
my $new_function = $ARGV[0];
if( $new_function ){
my $skip = 0;
$new_function = "_card_$new_function";
my $extern = 0;
my $jmp = 0;
my $hex;
open my $fh, '<', 'ManalinkEh.asm';
my @lines;
while( my $line = <$fh>){
if( $line =~ $new_function and not $skip ){
print "You already added that card.\n";
$skip = 1;
}
if( $line =~ /extern/ ){ $extern = 1; }
if( $extern and $line !~ /extern/ and not $skip){
push @lines, "extern $new_function\n";
$extern = 0;
}
if( $line =~ /jmp near/ ){
$jmp = 1;
($hex) = $line =~ /;\s+([A-Z0-9]+)/i;
}
if( $jmp and $line !~ /jmp near/ and not $skip){
my $a = eval( "0x$hex" ) + 5;
my $new_hex = sprintf "%x", $a;
push @lines, " jmp near $new_function ; $new_hex\n";
$jmp = 0;
print "Adding $new_function at $new_hex\n";
}
push @lines, $line;
}
close $fh;
# Re-write the file
open $fh, '>', 'ManalinkEh.asm';
print { $fh } @lines;
close $fh;
}
# Run make
`make`;
# Copy the new dll to the magic directory
copy('ManalinkEh.dll','D:\skrivbord\magic\ManalinkEh.dll') or die "Copy failed: $!";
#clean up
`make clean`;
If I remove alliances.c, I get the same error for the next one. And it's the first file in the cards directory so it doesn't appear to do anything. I'm guessing my perl-thingy is not correctly installed? Is anyone able to give me a hand?C:\camelbox\bin>perl build.pl
In file included from cards/alliances.c:1:
./manalink.h:2886: warning: declaration of 'target_player' shadows a global declaration
./manalink.h:2030: warning: shadowed declaration is here
make: *** [cards/alliances.o] Error 1
Copy failed: No such file or directory at build.pl line 51.
Thanks,
Freddan
- aquilla
- Posts: 19
- Joined: 27 Jun 2009, 14:42
- Has thanked: 0 time
- Been thanked: 0 time
Re: trying to make new cards but can't "build" with camelbox
by Aswan jaguar » 15 Jan 2015, 14:53
See this post it will answer some of your questions:
viewtopic.php?f=56&t=12978#p140479
And make sure to pm Gargaroz and Korath to help you more especially if you are going to share the cards you will make as Gargaroz codes them by hundreds so you don't code ones that he already did.
viewtopic.php?f=56&t=12978#p140479
And make sure to pm Gargaroz and Korath to help you more especially if you are going to share the cards you will make as Gargaroz codes them by hundreds so you don't code ones that he already did.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: trying to make new cards but can't "build" with camelbox
by aquilla » 16 Jan 2015, 06:03
Aswan jaguar: Thanks! I tried fixing the errors, now I have this instead:
Maybe I'm just bad though. Things like these tend to really frustrate me - I just wanna code!
My intention is to try and add my own custom set to the game, as a kind of mod. Or at least evaluate how much work it would be. I'm currently trying to create a csv file exporter for Magic Set Editor II that will fill in "as much as possible".
Once I get the hang of it I'd gladly add official content too
This is kind of difficult... Is there no "clean" version available? Eg one that compilescc1plus.exe: error: unrecognized command line option "-std=c++0x"
make: *** [functions/utility.obj] Error 1

My intention is to try and add my own custom set to the game, as a kind of mod. Or at least evaluate how much work it would be. I'm currently trying to create a csv file exporter for Magic Set Editor II that will fill in "as much as possible".
Once I get the hang of it I'd gladly add official content too
- aquilla
- Posts: 19
- Joined: 27 Jun 2009, 14:42
- Has thanked: 0 time
- Been thanked: 0 time
Re: trying to make new cards but can't "build" with camelbox
by Aswan jaguar » 16 Jan 2015, 14:54
I can't help you on how to compile code.I would be very interested in a theme custom set though like: superheroes for instance. 

---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8129
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 477 times
Re: trying to make new cards but can't "build" with camelbox
by aquilla » 18 Jan 2015, 14:55
Oh well :\ I tried to freshly install the latest version (I think) and while being way nicer
, I still get the same errors in the card functions when I compile. I find it kind of odd... I guess they weren't used? There are other versions somewhere?

- aquilla
- Posts: 19
- Joined: 27 Jun 2009, 14:42
- Has thanked: 0 time
- Been thanked: 0 time
Re: trying to make new cards but can't "build" with camelbox
by Gargaroz » 19 Jan 2015, 02:35
Argh, It's hard for you to code at all without accessing to our repository.
Truth is, without Korath I cannot add you to the repository, but I can furnish you my actual full SRC folder, you could find it attached to this post.
Try to get a general vision of it and then PM so I could give you the appropriate instuctions.
And please download and install the latest version of MiniGW, it's the compiler I'm using.
Truth is, without Korath I cannot add you to the repository, but I can furnish you my actual full SRC folder, you could find it attached to this post.
Try to get a general vision of it and then PM so I could give you the appropriate instuctions.
And please download and install the latest version of MiniGW, it's the compiler I'm using.
- Attachments
-
src.rar
- (2.64 MiB) Downloaded 454 times
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: trying to make new cards but can't "build" with camelbox
by Korath » 25 Jan 2015, 18:04
I'll still see pms (though it may take a while), and do still have enough time free to administer the repository. I'll grant read access to anyone on request; just send me your public key. There's plenty of git tutorials available if you're not comfortable with it.
Most of what's on that wiki page has only ever worked by accident. A couple of the standouts, just from the Getting Started section:
Manalink built fine out-of-the-box with a bog-standard MinGW installation as of a couple patches ago, and there's no reason to think that's changed in the meantime. For tutorial material on how to build a card, I'd suggest walking through the history in git, which will show you exactly which changes were made.
Most of what's on that wiki page has only ever worked by accident. A couple of the standouts, just from the Getting Started section:
- Camelbox, for example, is a perl distribution (and a very out of date one, at that), and only includes rudimentary support for compiling C - just barely enough to compile perl XS modules. The version of gcc that it ships is almost ten years out of date, and will no longer compile Manalink.
- The instruction to place source code in the compiler's install directory isn't just bad advice; it's an actively horrifying idea.
- The perl script is only needed to maintain the pointers in ManalinkEh.asm, and to be honest, it's easier and less error-prone to do that manually. Running make directly, like you would for any other software, does the right thing.
- The skymagic editor has been completely obsolete for a number of years.
Manalink built fine out-of-the-box with a bog-standard MinGW installation as of a couple patches ago, and there's no reason to think that's changed in the meantime. For tutorial material on how to build a card, I'd suggest walking through the history in git, which will show you exactly which changes were made.
-
Korath - DEVELOPER
- Posts: 3708
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1108 times
Re: trying to make new cards but can't "build" with camelbox
by gmzombie » 26 Jan 2015, 05:13
thanks for the info Korath. hope to see you back here sooner or later 

can I maze of ith your snowstorm?
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
- gmzombie
- Posts: 857
- Joined: 26 Feb 2009, 01:05
- Location: Wyoming, Mi
- Has thanked: 200 times
- Been thanked: 51 times
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests