Question about Entities
Displaying 1-7 of 7 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
CrazyAznGamer

As if right now, if I try to load an entity into an int handle like so:
evil_party[some_arbitrary_index].innocent_ent_handle = EntitySpawn(0, 0, "woot.chr");

Verge crashes.

Don't get me wrong, I know exactly why. I'm calling it inside a file other than a map VC, which would generate problems, but is there any workarounds to this? Or should I need it at all?

Nature of my problem is to have reference to every single entity during battle at my fingertips, but I don't want to have to spawn it in my map, when I already know where the entity CHR file exists, and when I can possibly code it directly into the battle system.

Thoughts about my rambling? Common sense related issues you'd like to point out to me?

Posted on 2006-03-13 17:29:20

CrazyAznGamer

Double Post (ie. I'm a greedy bastard and feel lonely.) =/

Posted on 2006-03-14 15:50:36

Omni

You should be able to call EntitySpawn from anywhere...otherwise, you couldn't put EntitySpawn in functions which your Map VC functions would access.

MapVC --> mapfunction --> systemVC function --> calls EntitySpawn.

Maybe there's another problem? Surely it's not crashing for _that_ reason.

Posted on 2006-03-14 16:32:24 (last edited on 2006-03-14 16:32:25)

mcgrue

Quote:Originally posted by CrazyAznGamer

As if right now, if I try to load an entity into an int handle like so:
evil_party[some_arbitrary_index].innocent_ent_handle = EntitySpawn(0, 0, "woot.chr");

Verge crashes.

Don't get me wrong, I know exactly why. I'm calling it inside a file other than a map VC, which would generate problems, but is there any workarounds to this? Or should I need it at all?

Nature of my problem is to have reference to every single entity during battle at my fingertips, but I don't want to have to spawn it in my map, when I already know where the entity CHR file exists, and when I can possibly code it directly into the battle system.

Thoughts about my rambling? Common sense related issues you'd like to point out to me?



  1. Is there a map loaded?
  2. Is some_arbitrary_index negative or >= evil_party's declared size
  3. Is there a woot.chr?
  4. Is woot.chr a valid chrfile?

Posted on 2006-03-14 16:40:02

CrazyAznGamer

My thoughts exactly, but shouldn't it at least compile? Because, I mean, that's when it's crashing. And that's when Microsoft tells VERGE to shut the hell up. =[

McGrue: I always check for these. =/

Posted on 2006-03-14 20:44:43

CrazyAznGamer

I found a workaround, but that's another story.
Anyways, I got another problem and I don't feel like creating another thread for it, so...
int OptionsMenu(int x, int y, int w, int font, int num_options, int cancel)
//returns option # chosen. uses options[]. cancel toggles between if menu can be canceled out of
{
options_choice_hover = 0;
int height = FontHeight(font);
int temp = NewImage(w, height * num_options + (TXT_PADDING * 2));
DrawUIBox(0, 0, w, height * num_options + (TXT_PADDING * 2), temp);
int i;
for(i = 0; i < num_options; i++)
PrintString(ImageWidth(ui_cursor_img) + TXT_PADDING, height * i + TXT_PADDING,
temp, font, options[i]);
lastpressed = 0;
while(!b1) //while unconfirmed
{
Render();
Blit(x, y, temp, screen); //draw crap to the screen.
Blit(x, height * options_choice_hover + TXT_PADDING + y, ui_cursor_img, screen); //cursor
ShowPage();
//Check input
if(lastpressed == SCAN_UP)
{
// TODO: Play a little noise...
options_choice_hover = options_choice_hover - 1 % num_options;
lastpressed = 0;
}
if(lastpressed == SCAN_DOWN)
{
// TODO: Play a little noise...
options_choice_hover = options_choice_hover + 1 % num_options;
lastpressed = 0;
}
if(b2 && cancel) //cancel is nonzero, meaning menu can be canceled.
{
return MENU_CANCEL;
}
}
FreeImage(temp);
return options_choice_hover;
}

for some reason, a NullPointerException is thrown (and not caught) for the image "temp". As you can see, I'm pretty sure I initialized it. So uh, any ideas?

Posted on 2006-03-15 19:58:21

CrazyAznGamer

Anyways, I tried many many things, and it doesn't work for some strange reason. It's weirding me out.
Note the following error produced from the above code:

Line 69 is:
			temp, font, options[i]);

I'm pretty sure I'm weirded out by now.

EDIT: Bloody hell, the problem was in line 68!. Grrr. Earwig is angry.
Sorry for my pointless rambling. I guess I have forgotten about VERGE and its error reporting...

Posted on 2006-03-17 19:34:44 (last edited on 2006-03-17 19:55:37)


Displaying 1-7 of 7 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.