Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
E1513 error in RPG #435686
01/10/14 18:30
01/10/14 18:30
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
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);
}
}

Re: E1513 error in RPG [Re: mschoenhals] #435687
01/10/14 18:51
01/10/14 18:51
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
key_for_str() expects a cstring pointer. You are passing a var.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: E1513 error in RPG [Re: WretchedSid] #435690
01/10/14 20:04
01/10/14 20:04
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
hmm, I annotated the line out but still same message. Any other suggestions?

Re: E1513 error in RPG [Re: mschoenhals] #435691
01/10/14 20:43
01/10/14 20:43
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
What about debugging?
Just put some msgboxes arround and see where EXACTLY it crashes..
and please use codetags.

Re: E1513 error in RPG [Re: Ch40zzC0d3r] #435693
01/10/14 21:33
01/10/14 21:33
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
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);
	}
}


Re: E1513 error in RPG [Re: mschoenhals] #435695
01/10/14 21:42
01/10/14 21:42
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
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);


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: E1513 error in RPG [Re: sivan] #435696
01/10/14 21:45
01/10/14 21:45
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
or simply messageboxes with:
error("this is a test, press ok to continue, cancel to exit");

Re: E1513 error in RPG [Re: Ch40zzC0d3r] #435698
01/11/14 00:30
01/11/14 00:30
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
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);


Re: E1513 error in RPG [Re: mschoenhals] #435702
01/11/14 09:41
01/11/14 09:41
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
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.

Re: E1513 error in RPG [Re: Ch40zzC0d3r] #435713
01/11/14 15:11
01/11/14 15:11
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
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!
:-)


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1