E1513 error in RPG

Posted By: mschoenhals

E1513 error in RPG - 01/10/14 18:30

I'm using the AUM RPG and I get a frustrating error every time I try and use the mace. I know where the error is but can't seem to fix it. It's the E1513 error. Any ideas?

function fire_init_startup()
{
VECTOR temp, fire_coords;
var fire_playing, i;
while (!player) {wait (1);}
while (1)
{
t_mace = ptr_for_handle(mace_handle);
if ((t_mace != NULL) && (player.life > 0) && (mouse_mode == 0))
{
SND_CREATE_STATIC(fire_sound_effect, trpg_fire_wav);
while (mouse_left) // this loop will run for as long as the player is alive
{
// only generate fire while the player is standing still
if((key_pressed(key_for_str(key_forward))) + (key_pressed(key_for_str(key_backward))) + (key_pressed(key_for_str(key_left))) + (key_pressed(key_for_str(key_right))) == 0)
{
vec_for_vertex (temp, t_mace, trpg_staff_fire_effect_vertex); // get the origin of the fire vector - it's the 44th mace vertex
for (i = 0; i <= trpg_staff_fire_effect_length; i += trpg_staff_fire_effect_offset) // create a mace fire source every 10 quants (for a total of 100 fire sources)
{
vec_set (fire_coords.x, vector(i, 0, 0));
vec_rotate (fire_coords, camera.pan); // allow the player to fire at will, at any angle, regardless of player's model (fixed) tilt angle
vec_add (fire_coords, temp.x);
effect(fire_effect, trpg_staff_fire_particles_per_frame, fire_coords.x, nullvector);
}
c_trace (temp.x, fire_coords.x, IGNORE_ME | IGNORE_FLAG2 | ACTIVATE_SHOOT); // trace along the fire line
if (!snd_playing(fire_playing))
fire_playing = snd_play(fire_sound_effect, trpg_staff_fire_sound_volume, 0);
if (player.life <= 0) // the player has died while firing?
break; // then get out of this loop
}
wait (1);
}
}
wait (1);
}
}
Posted By: WretchedSid

Re: E1513 error in RPG - 01/10/14 18:51

key_for_str() expects a cstring pointer. You are passing a var.
Posted By: mschoenhals

Re: E1513 error in RPG - 01/10/14 20:04

hmm, I annotated the line out but still same message. Any other suggestions?
Posted By: Ch40zzC0d3r

Re: E1513 error in RPG - 01/10/14 20:43

What about debugging?
Just put some msgboxes arround and see where EXACTLY it crashes..
and please use codetags.
Posted By: mschoenhals

Re: E1513 error in RPG - 01/10/14 21:33

Yeah, that's where I'm at now. I've worked through the debugging tutorials from Lite-C Workshops but they don't cover message boxes. How do I add one? I can't seem to use a break point because the error exists in code that doesn't start the game.

Ignore below; testing to make sure I know how to use codetags...
Code:
function fire_init_startup()
{
	VECTOR temp, fire_coords;
	var fire_playing, i;
	while (!player) {wait (1);}
	while (1)
	{
		t_mace = ptr_for_handle(mace_handle);
		if ((t_mace != NULL) && (player.life > 0) && (mouse_mode == 0))
		{
			SND_CREATE_STATIC(fire_sound_effect, trpg_fire_wav);
			while (mouse_left) // this loop will run for as long as the player is alive
			{	
				// only generate fire while the player is standing still		
				if((key_pressed(key_for_str(key_forward))) + (key_pressed(key_for_str(key_backward))) + (key_pressed(key_for_str(key_right))) + (key_pressed(key_for_str(key_left))) == 0)
				{
					vec_for_vertex (temp, t_mace, trpg_staff_fire_effect_vertex); // get the origin of the fire vector - it's the 44th mace vertex
					for (i = 0; i <= trpg_staff_fire_effect_length; i += trpg_staff_fire_effect_offset) // create a mace fire source every 10 quants (for a total of 100 fire sources)
					{
						vec_set (fire_coords.x, vector(i, 0, 0));
		  	     		vec_rotate (fire_coords, camera.pan); // allow the player to fire at will, at any angle, regardless of player's model (fixed) tilt angle
		      		vec_add (fire_coords, temp.x);
						effect(fire_effect, trpg_staff_fire_particles_per_frame, fire_coords.x, nullvector);
					}        	
					c_trace (temp.x, fire_coords.x, IGNORE_ME | IGNORE_FLAG2 | ACTIVATE_SHOOT); // trace along the fire line
					if (!snd_playing(fire_playing))
 						fire_playing = snd_play(fire_sound_effect, trpg_staff_fire_sound_volume, 0);
					if (player.life <= 0) // the player has died while firing?
						break; // then get out of this loop
				}
				wait (1);
			}
		}
		wait (1);
	}
}

Posted By: sivan

Re: E1513 error in RPG - 01/10/14 21:42

use this to get the bad line exactly:

sys_marker("001");

a few code lines...

sys_marker(NULL);
sys_marker("002");

a few code lines...

sys_marker(NULL);
Posted By: Ch40zzC0d3r

Re: E1513 error in RPG - 01/10/14 21:45

or simply messageboxes with:
error("this is a test, press ok to continue, cancel to exit");
Posted By: mschoenhals

Re: E1513 error in RPG - 01/11/14 00:30

ok, using the error("this is a test, press ok to continue, cancel to exit"); method, I was able to isolate the line of code the produces the error. Thanks for that by the way! laugh

However, I still don't have a fix. I think this line of code calls up another function so the error must be there, right? Here's the line:
Code:
effect(fire_effect, trpg_staff_fire_particles_per_frame, fire_coords.x, nullvector);

Posted By: Ch40zzC0d3r

Re: E1513 error in RPG - 01/11/14 09:41

Code:
effect(function, var number, VECTOR* pos, VECTOR* vel)



function is the function which gets called, so try to find it and debug again. The number could be too high so it might crash, pos or vel are pointers and have to be valid or else it will crash. You should try to get fire_effect and debug it.
Posted By: mschoenhals

Re: E1513 error in RPG - 01/11/14 15:11

Thanks Guys!
Got it figured out. I was using my computer at work with the free student version. The issue was related to the fact that the code uses resources only available in the Commercial version.

Sometimes I find this game design stuff very humbling.

Despite that, I learned a lot in this quest, thanks to you guys!
:-)
© 2024 lite-C Forums