Thunderbrd
C2C War Dog
Alright, I'm a bit lost at the moment trying to wrap my head around the coding mechanisms so I'd like a brief respite anyhow. Sounds easier to set up than trying to understand how to write these codes.Use my tutorial (in my signature). Setting up the environment shouldn't be difficult.
Alright this will all make more sense once I start trying it I'm sure. I think the part that's confusing me is how to compile just one of the source files... aren't they all put together into one dll? What commands would you use in 2008 express to compile just one file? And in this 'compile' reference, are we meaning just a code check or are we completely recreating the entire dll? Is there a way to just run a quick check on the code that doesn't involve every step taken to form the dll? I opened a file inside 2008 and yeah, ok, I could edit the code in there, but then what?I think that you're under the impression that the compiler is just like a spell checker.
In some ways it might be, but keep in mind that you don't know the language
Note that it does much more than checking that you have spelled your variables correctly, or that you've defined them at all.
It checks for types, it checks for validity of expressions, it checks whether functions you call exist at all and whether they exist in the specific context in which you try to call them (e.g. whether a function belongs to a class).
And in addition to checking it also translates your code to machine code so you can test it. As Baldyr said, it is probably better to write your function in parts and see if each part works before going forward, unless you know how you want everything to look, and then just compile during the writing.
I'll look into the version control thing there but I must admit, the whole Tortoise program is rather intimidating. I was introduced to the concept of it when I was downloading Afforess's source files for his AND SDK and didn't understand a bit of it. But I'll read your tutorial on that and comment back on it.
There is some basic (quick basic I think, literally) involved in a Microsoft Access program, where button clicks are concerned and some other tricksy details. Before you just save and accept the programming you've put in place, as is, you should always 'compile' which will highlight any errors you may have made that would halt the program from functioning further. I realize this will be quite different in the sense that the C++ language doesn't run from what is typed but from an encrypted coding that puts it more closely into terms and mathematical binary that the computer processor can use more directly, a code we would likely not understand with any great ease.I'm not sure what you mean. It does the same job in the sense that it turns something into a runnable program. In any other way it's probably different.
Makes sense... I suppose the previous dll I compiled from just the modified source files I had might even be screwy on this premise of potentially missing files, though it did seem to work just fine. And I just compared the source code file and the core dll file and it seems everything is there so I worry I'm going to mess things up if I try to do a merge at this point... there may be some things in the core (what appear to be superflous, non-source files) that maybe shouldn't be there.In this case, you should use it as the base code like this:
After setting up the environment, copy the original BTS (3.19) files to your working folder (the same folder with the makefile and the Visual Studio project files).
Then copy the AND source files - *.cpp, *.h, *.inl (if they exist), CvGameCoreDLL.rc (if exists) - over these files.
The reason is that not always you have all the required source files in a mod, since sometimes only the source files that were changed are included.
Be careful not to override the makefile or the VS files.
Again, once I start seeing output from the compiler, I'll better understand how this can be helpful. Additionally, I realize this needs to be broken down and looked at just one bit at a time rather than the whole thing splayed out there like it currently is.I'm sorry. If you think it'll be more helpful I can try, but It's not always that simple looking at the code and figuring out what's going on with it. That's where the compiler is very handy.
Yeah, that's the big headache I'm getting right now... rather pinpointed in fact. I'm totally lost on how to define this. To explain my befuddled thinking:Just as an example - the following statement would not have compiled:
Code:relfounded((ReligionTypes)iI))=1;
This is because relfounded is of type int, and you cannot apply parentheses to this type - it is undefined.
It seems that you want an array there, but accessing it and defining it is different than what you've written.
I'm trying to somehow isolate the religions that have been founded so that I can remove them from consideration here. My thinking is, once we know the ones that have been founded, we can also define all the ones that haven't been by assigning a value of 1 to those that have and 0 to those that haven't. Then we can move on to defining what to do if there exists any that have not been yet founded. I suppose one thing I've forgotten entirely in all this also has been to return a False if all religions have already been founded.
Go ahead, you can chuckle now

Well, that's what I am doing, so far as I thought... My experience in compiling the dll was limited to simply following the instructions like a lemming and seeing a completed dll file come forth as a result. How to go on from there was too confusing to follow, the debugging and such. I took a 'if it works its obviously fine' approach given how minimal the adjustments I made at the time were. I switched out the old dll with the new one and the thing ran with the intended changes (aka, the first spread of an unfounded religion not only founded the religion but, as the changes suggested they might, also established the holy city at the site of the first spread) like a charm.BTW, I re-read your original post and I understand that you already merged some SDK code, compiled it and tested that it works?
Then why not using that as base and go on from there?
Since then, I've been working on source files located within the same folder as the source files I compiled into a .dll. Though, at the moment, I know my coding is so flawed I have only been playing with a notepad++ doc to formulate the above shown template. Since I know it has no hope of being functional, I felt it best not to include it into the actual source file yet, as the only means I understand of testing the code is to recompile the entire dll and run the mod. Perhaps once I understand the compiler programs I'll feel differently about that.
That's exactly the stage I'm at. For the human player, the founding of religions via prophets is working just fine (though I suppose I have some xml work to do to really flesh it out still... at the moment, I've only included a couple religions for the prophet to work with for testing purposes. Additionally, I need to create an invisible, unattainable tech to assign religion prereqs to so as to disable achieving religions via technologies and I also plan to make the techs that normally grant a religion give a prophet to the first to achieve instead. Since those last two steps there are much easier for me to understand how to do them, I've left them for a quick wrap up.)In case I misunderstood you and you didn't - I suggest you first implement the non-AI functionality, and only then (after you've seen that it's working) add the AI, since the AI will need to use this functionality anyway.
Thank you so much for your help by the way... this stuff is really confusing me. I've been sitting here for days trying to read code and tutorials and attempting to understand what I'm seeing and how to make it work for me and I feel like a blind idiot because so much of it just loses me. I mean...
Quotes like these:
Do little more than make my head spin trying to understand the concept they're trying to express. Nevertheless, I find myself really needing to understand these things and returning to reread them again and finding it doesn't make any more sense than it did the first time I read them. This is just one of a hundred examples.the C++ tutorial said:The scope operator ( :: ) specifies the class to which the member being declared belongs, granting exactly the same scope properties as if this function definition was directly included within the class definition.
Then I try to read the codes and while I kinda get the basic concepts of what the code is doing, the specifics are often baffling. Then by the time I understand something I didn't understand before, I find I've forgotten why I needed to understand it in the first place...
Perhaps I'm just trying to swallow it all at once and no stomach can fit that much in one sitting...
@Baldyr: My question then is this... if I compiled little bits of this code and ran it, how would I know if it came back with a True or False? Are you suggesting to test it in game? I'm asking just to be clear because so far that's what I got from your last comment.