Also, bubba, I can't really remember if I asked you this or not, but when your interpretor program read scripts, how/where did you store the scripts? I think I mentioned this before, but as far as...
Type: Posts; User: suzakugaiden
Also, bubba, I can't really remember if I asked you this or not, but when your interpretor program read scripts, how/where did you store the scripts? I think I mentioned this before, but as far as...
"The scripting language that Shakti and I devised is completely message-based."
That's mostly implementation. I was talking more about design.
Anyway, I just had another bizarre idea. Instead...
This probably won't make any sense. It's 4 AM, the day after graduation, I'm dehydrated, and I'm a bit out of it. Still, here it goes.
Okay, this was something I was doing back in January. Wanted...
Bubba: Nobody has any idea what the heck the message method is. googling is useless. "Think Windows API" is useless if you're, like, not a windows programmer.
And yes, the index array plus...
Why do schools like assigning such asinine programming homework?
Ah, okay. I was really just asking because that's in a source file I'd rather NOT have split (Because it has genuinely related functions. They're just a LOT of them). It's less readable, but it's...
What errors do you get?
The idea is this. I have an index array, and a value array. I want to get the index by searching through the index array, and then set the corresponding position in the value array to that something....
Iostream's generally massiveness is annoying me. I mean, like, something with stdio is 16 kbs. If you do the same thing with iostream, it compiles to 500 kbs. That's not cool :(
My immediate...
You could multithread it, I guess. Which would be like using a train to crush a fly, but...
also, you shouldn't need classes for this.
I heard system calls had portability issues?
Interactive fiction is actually one of the harder things to code from the ground up, and it requires no mucking around with APIs OR graphical knowledge. Furthermore, it's also basically going to...
Christ. Seriously? Dang it XD Now I feel REALLY silly. Well, I guess I should edit the tokenizer thing to kill "\n"s or something.
Although, it looks like there WAS a bit of a coding error. I seem...
Darryl: That's from the function parameters.
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
A) Splitting source into multiple files is a good idea. Nice that he's starting early.
B) Headers and their related .cpp should have the same name.
C) Don't have a header that just contains...
7stud: A brief example program? Okay.
load_script(verb_coms, verb_pars, "data/verbs.txt");
execute(verb_coms, verb_pars, 0);
Imagine that. In main(). Now, erm, the code for load_script!
Right, right. I know. I mean it wasn't, like, the sort of not inbounds that causes segfaulting.
Anyway, that bit aside, I also tried just searching the vector. Same problems. amusingly enough, it...
No, that's in-bounds. I think the 4 is just the number of elements to copy over. I don't think THAT'S a problem.
Also, it's actually working really well so far except for this :(
Yeah, it works elsewhere for me. I thought it wasn't at first, but further tests show that it *does*. Anyway, this is the function that's calling it and acting funny.
void...
Basically, it takes a vector, a string, and a few other optional parameters. It then searches through the vector till it find the string, and returns the index.
size_t...
Google SDL.
Er, quick clarification, but are globals bad because they're sloppy, or do they also cause overhead?
Anyway, that script interpretor I've been working on. I'd like to have four global variables --...
Don't hardcode NPC dialogues, BTW.
BTW, as far as as scripts, dialogues, etc goes, can you still include them as .cpp string vectors or whatever? Assuming you had a NPC_text.cpp and associated...
Yeah, sourceforge is a bit... large now. That, and this seems to be strictly gaming oriented, which might up traffic from certain people.
void save_file(string filename, vector<string>to_save, int truncate)
{
if(truncate == 0)
{
ofstream save_file(filename.c_str(),ios::trunc);
}
else
{
ofstream...