IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> C++ Host Generator (using rules in SR3 and Matrix), Tested on WinXP ... looking for others
Dashifen
post Sep 11 2003, 03:30 PM
Post #1


Technomancer
********

Group: Retired Admins
Posts: 4,638
Joined: 2-October 02
From: Champaign, IL
Member No.: 3,374



Hello All!

Over the last two days, I've been coding a host generator program using the rules in SR3 and Matrix. I've gotten it running fine on WinXP Pro and I was wondering if I could get some others to test it on other platforms.

I have a windows executable built so if you have a Win95/98/ME/2000 machine I can email you the executable and you can test it a few times. It runs in a "dos" window because I haven't built a graphical-user interface for it yet (and I may not) so it's back to the good old days of command line prompts!

If you have a Linux/UNIX box, I'd really like you to drop me a line and I'll send you the source code. Then if you could run it through compilers like g++ and/or gcc and let me know the success or failure of the system, that'd be great.

And lastly, does anyone have a compiler for C++ on a Mac? I don't think I've ever met someone with one -- though I guess since OSX is based on BSD Unix, then perhaps newer Macs can take part in the glory .... okay, so I'm tooting my own horn with that one :grinbig:

_________

Here's a run down of the program: you enter the color of the host (blue, green, orange, red) and then the difficulty (easy, average, hard). Then you enter the name for the host (becomes the file name). After that, you're done. The program generates a security sheaf for the host and writes an HTML file that I've tested in IE6. The bonus of the HTML is that I put links to pages that you could fill with notes from the books about each type of IC and the alert statuses. I'm not including such pages with my program because I'm not sure if it would infringe on copyrights or not.

So, for example, if a Probe IC is generated for trigger step 14, then you could click on the name Probe and it would load the page probe.htm which you could create to contain information about the Probe IC and what it does. Good for beginning GM (like me) who need the notes and need them fast! The files that you would have to produce on your own would be: probe.htm, trace.htm, tbaby.htm, killer.htm, scout.htm, crippler.htm, tpit.htm, ripper.htm, blaster.htm, sparky.htm, psycho.htm, lethal.htm, nlethal.htm, cerebro.htm, passive.htm, active.htm, shutdown.htm, and construct.htm. psycho.htm refers to Psychotropic Black IC and cerebro.htm would refer to Cerebropathic Black IC.

The house rules in the program deal with the way constructs are made. The rules in the text say that you place at least two kinds of IC within the construct no matter what (or at least thats how I read them) and alter the IC ratings to fit the frame core. My program will be sure that the IC ratings within the construct do not get bigger than the frame core of the construct. It does this by decrementing the IC ratings as necessary. Not exactly random anymore, but it helps to keep constructs under control. Plus, it was the only way that I could get it to generate the constructs. Because of the way the algorithm worked in the computer, you could get a construct that has only one type of IC in it, which seems dumb, but you do still get the targetting option that all constructs get that IC doesn't. I thought it was a fair trade off.

If you want the source code, let me know. It's not the best piece of commented work I've done, but maybe I'll get some more in there to help it become more understandable.

If you're interested in helping me test this program on other platforms or want the source code, let me know by sending me a PM through the boards. I check them often enough that I'll see your message quickly.

Edit: Added file names for the html files.
Go to the top of the page
 
+Quote Post
Grey
post Sep 12 2003, 05:37 AM
Post #2


Runner
******

Group: Members
Posts: 3,035
Joined: 26-February 02
From: Anahiem, CA
Member No.: 100



I'll give it a shot for you on my Win2k systems.

Email: metis76@yahoo.com
Go to the top of the page
 
+Quote Post
Matrix Monkey
post Sep 12 2003, 09:47 AM
Post #3


Moving Target
**

Group: Members
Posts: 104
Joined: 26-June 03
From: 127.0.0.1
Member No.: 4,813



send the code my way, I'll give it a run on my linux boxes :)

sam@crashdot.be
Go to the top of the page
 
+Quote Post
Connor
post Sep 12 2003, 02:41 PM
Post #4


Moving Target
**

Group: Members
Posts: 511
Joined: 30-May 03
From: Tulsa, OK
Member No.: 4,652



You can toss the code my way as well. I can see what happens with a compile under FreeBSD.

I can also see what the excutable does on some friends machines that aren't up to XP yet.

connor@dicebag.com
Go to the top of the page
 
+Quote Post
Sigfried McWild
post Sep 19 2003, 12:38 AM
Post #5


Target
*

Group: Members
Posts: 55
Joined: 7-October 02
From: A figment of you imagination
Member No.: 3,423



I have a mac. If you send me the code I can try both Linux and OS X compiles.
Go to the top of the page
 
+Quote Post
Grey
post Sep 23 2003, 05:25 PM
Post #6


Runner
******

Group: Members
Posts: 3,035
Joined: 26-February 02
From: Anahiem, CA
Member No.: 100



I never got it...
Go to the top of the page
 
+Quote Post
KosherPickle
post Sep 24 2003, 06:36 PM
Post #7


Moving Target
**

Group: Members
Posts: 212
Joined: 1-July 02
From: Santa Maria, CA
Member No.: 2,921



QUOTE (Dashifen)

Over the last two days, I've been coding a host generator program using the rules in SR3 and Matrix.  I've gotten it running fine on WinXP Pro and I was wondering if I could get some others to test it on other platforms. 

I have a windows executable built so if you have a Win95/98/ME/2000 machine I can email you the executable and you can test it a few times.  It runs in a "dos" window because I haven't built a graphical-user interface for it yet (and I may not) so it's back to the good old days of command line prompts!


If you send it to me, fuchsiawonder@yahoo.com, I'll check it out on Win ME and 98.
Go to the top of the page
 
+Quote Post
Matrix Monkey
post Sep 25 2003, 09:24 AM
Post #8


Moving Target
**

Group: Members
Posts: 104
Joined: 26-June 03
From: 127.0.0.1
Member No.: 4,813



no output, I tried changing the header includes like so:
[brackesa@cerberus brackesa]$ head matrix.cpp
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>

but this still doesn't work, see below:

[brackesa@cerberus brackesa]$ gcc -save-temps -time matrix.cpp
# cpp0 0.08 0.00
matrix.cpp:57: 'ofstream' is used as a type, but is not defined as a type.
matrix.cpp:94: `main' must return `int'
matrix.cpp: In function `int main(...)':
matrix.cpp:107: `out' undeclared (first use this function)
matrix.cpp:107: (Each undeclared identifier is reported only once for each
function it appears in.)
matrix.cpp:149: `endl' undeclared (first use this function)
matrix.cpp: In function `void GetHostType()':
matrix.cpp:162: `cout' undeclared (first use this function)
matrix.cpp:165: `cin' undeclared (first use this function)
matrix.cpp: In function `void DumpHost()':
matrix.cpp:248: `cerr' undeclared (first use this function)
# cc1plus 0.48 0.04
Go to the top of the page
 
+Quote Post
Matrix Monkey
post Sep 25 2003, 09:42 AM
Post #9


Moving Target
**

Group: Members
Posts: 104
Joined: 26-June 03
From: 127.0.0.1
Member No.: 4,813



Looks like I got it running after hacking the code a little bit:

[brackesa@cerberus brackesa]$ diff Matrix.cpp matrixorig.cpp
2d1
< #include <iostream.h>
4c3
< #include <unistd.h>
---
> #include <afx.h>
95c94
< int main() {
---
> void main() {




[brackesa@cerberus brackesa]$ ./a.out
Please enter the type of host:
1. Blue Host
2. Green Host
3. Orange Host
4. Red Host
Host Color: 1

Please enter the difficulty of the host:
1. Easy
2. Average
3. Hard
Host Difficulty: 1

Enter the name of the host. Use the underscore (_) instead of spaces.
Host Name: Test


[brackesa@cerberus brackesa]$ g++ -dumpversion
3.2.2
[brackesa@cerberus brackesa]$ g++ -dumpmachine
i386-redhat-linux

This was on a Redhat 9.0 system, I'll try and compile it on a few other test machines (slackware, solaris etc.)
Go to the top of the page
 
+Quote Post
Matrix Monkey
post Sep 25 2003, 10:04 AM
Post #10


Moving Target
**

Group: Members
Posts: 104
Joined: 26-June 03
From: 127.0.0.1
Member No.: 4,813



I'm getting a crapload of errors on the following system (Debian 3.0):
Linux birkoff 2.4.22-grsec #6 SMP Fri Sep 12 12:45:22 CEST 2003 i686 GNU/Linux
([...] signifies repeated error)


/tmp/ccA0R37b.o(.text+0x8a): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
[...]
/tmp/ccA0R37b.o(.text+0x290): In function `GetHostType()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[...]
/tmp/ccA0R37b.o(.text+0x55d): In function `DumpHost()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[...]
/tmp/ccA0R37b.o(.text+0xdf6): In function `DumpReactiveWhite(bool)':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[...]
/tmp/ccA0R37b.o(.text+0xed9): more undefined references to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' follow
/tmp/ccA0R37b.o(.text+0x13fe): In function `DumpICRating()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
[...]
/tmp/ccA0R37b.o(.text+0x15aa): In function `DumpPsychotropic()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[...]
/tmp/ccA0R37b.o(.text+0x15ec): more undefined references to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' follow
/tmp/ccA0R37b.o(.text+0x1742): In function `DumpConstruct()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
[...]
/tmp/ccA0R37b.o(.text+0x1a37): In function `GeneratePayData()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[...]
/tmp/ccA0R37b.o(.text+0x1bbc): more undefined references to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' follow
/tmp/ccA0R37b.o(.text+0x1bee): In function `GeneratePayData()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
[...]
/tmp/ccA0R37b.o(.text+0x1e37): In function `DumpWorm()':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
[...]
/tmp/ccA0R37b.o(.text+0x1f57): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccA0R37b.o(.text+0x1f8e): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream[in-charge]()'
/tmp/ccA0R37b.o(.text+0x1fbe): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccA0R37b.o(.text+0x1fd2): In function `__tcf_1':
: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream [in-charge]()'
/tmp/ccA0R37b.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

Probably due to a lack of installed libraries

UPDATE: got rid of a bunch of errors after linking iostream.h to iostream, fstream.h to fstream
Go to the top of the page
 
+Quote Post
Dashifen
post Sep 25 2003, 12:42 PM
Post #11


Technomancer
********

Group: Retired Admins
Posts: 4,638
Joined: 2-October 02
From: Champaign, IL
Member No.: 3,374



QUOTE (Matrix Monkey @ Sep 25 2003, 04:24 AM)
no output, I tried changing the header includes like so:
[brackesa@cerberus brackesa]$ head matrix.cpp
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>

but this still doesn't work, see below:

[brackesa@cerberus brackesa]$ gcc -save-temps -time matrix.cpp
# cpp0 0.08 0.00
matrix.cpp:57: 'ofstream' is used as a type, but is not defined as a type.
matrix.cpp:94: `main' must return `int'
matrix.cpp: In function `int main(...)':
matrix.cpp:107: `out' undeclared (first use this function)
matrix.cpp:107: (Each undeclared identifier is reported only once for each
  function it appears in.)
matrix.cpp:149: `endl' undeclared (first use this function)
matrix.cpp: In function `void GetHostType()':
matrix.cpp:162: `cout' undeclared (first use this function)
matrix.cpp:165: `cin' undeclared (first use this function)
matrix.cpp: In function `void DumpHost()':
matrix.cpp:248: `cerr' undeclared (first use this function)
# cc1plus 0.48 0.04

that looks like you tried to compile with a C compiler but I coded in C++. That would explain why fstream.h wouldn't include and why it wants the main() function to return an int. I'm not sure what happened on the Debian box, but it looks like you're on the right track with the i/o libraries. Perhaps it's time to set up a few linux boxes of my own to run some tests .... :]

-- Dash --
Go to the top of the page
 
+Quote Post
Matrix Monkey
post Sep 25 2003, 07:52 PM
Post #12


Moving Target
**

Group: Members
Posts: 104
Joined: 26-June 03
From: 127.0.0.1
Member No.: 4,813



QUOTE (Dashifen)
that looks like you tried to compile with a C compiler but I coded in C++. That would explain why fstream.h wouldn't include and why it wants the main() function to return an int. I'm not sure what happened on the Debian box, but it looks like you're on the right track with the i/o libraries. Perhaps it's time to set up a few linux boxes of my own to run some tests .... :]

-- Dash --

Nope, gcc by default passes .cpp files off to g++ if you don't explicitly state otherwise. (Furthermore, I tried using g++ at first but it gave the same errors)

I'll look into the debian box's library issues tomorrow, it could be related to the gcc version I'm using there also (differs from the redhat box)
Go to the top of the page
 
+Quote Post
Sigfried McWild
post Sep 26 2003, 03:06 PM
Post #13


Target
*

Group: Members
Posts: 55
Joined: 7-October 02
From: A figment of you imagination
Member No.: 3,423



I compiled it fine in linux.
Just had to change afx.h (or something like that) to iostream.h
Go to the top of the page
 
+Quote Post
Bigity
post Aug 24 2004, 08:46 PM
Post #14


Shooting Target
****

Group: Members
Posts: 1,840
Joined: 24-July 02
From: Lubbock, TX
Member No.: 3,024



Is this still available?
Go to the top of the page
 
+Quote Post
JuanGolbez
post Aug 26 2004, 05:59 PM
Post #15


Target
*

Group: Members
Posts: 3
Joined: 19-July 04
From: Frustrated Incorporated
Member No.: 6,495



Can we still get this, or has it been tossed in the bitbucket? I'm interested!
Go to the top of the page
 
+Quote Post
Dashifen
post Aug 26 2004, 07:25 PM
Post #16


Technomancer
********

Group: Retired Admins
Posts: 4,638
Joined: 2-October 02
From: Champaign, IL
Member No.: 3,374



sure, pm me with your email address and I can mail it to you. Do you want to source code or a compiled windows executable?
Go to the top of the page
 
+Quote Post
Connor
post Aug 26 2004, 08:44 PM
Post #17


Moving Target
**

Group: Members
Posts: 511
Joined: 30-May 03
From: Tulsa, OK
Member No.: 4,652



You know, seeing this thread again reminded me of how I had the same problems Matrix Monkey had above, but I couldn't quite figure out what he did to fix it. I'm not much of a C++ coder. I'd love to get the code compiled however so if anyone reading this can help out in that regard I'd appreciate it.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 17th May 2024 - 02:25 AM

Topps, Inc has sole ownership of the names, logo, artwork, marks, photographs, sounds, audio, video and/or any proprietary material used in connection with the game Shadowrun. Topps, Inc has granted permission to the Dumpshock Forums to use such names, logos, artwork, marks and/or any proprietary materials for promotional and informational purposes on its website but does not endorse, and is not affiliated with the Dumpshock Forums in any official capacity whatsoever.