Game Development Community

Out of bounds value?

by Nathan Cox · in General Discussion · 08/07/2009 (10:26 am) · 4 replies

I'm trying to make a spell system, similar to ArcaneFX, from scratch. So far I've only programmed the zodiacs that appear below the player when casting a spell. When I try to test the zodiac, however, I get the following error: i29.tinypic.com/2co1oaf.png

Here is the code:

//spells testing

function alignTerrain(%pos)
{
	%x = getWord(%pos, 0);
	%y = getWord(%pos, 1);
	%z = getTerrainHeight(%x SPC %y);
	%finalPos = %x SPC %y SPC %z;
	return %finalPos;
}

new decalData(purpleZodiac)
{
	sizeX = 2;
	sizeY = 2;
	textureName = "Tallion/data/special/zodiacs/purple.png";
	lifeSpan = 5000;
};

new decalData(blueZodiac)
{
	sizeX = 2;
	sizeY = 2;
	textureName = "Tallion/data/special/zodiacs/blue.png";
	lifeSpan = 5000;
};

function callZodiac(%player, %num)
{
	if(%num = 0)
	{
		%zodiac = new sgDecalProjector()
		{
			position = alignTerrain(%player.getPosition());
			datablock = "purpleZodiac";
		};
		MissionCleanup.add(%zodiac);
	} else {
		%zodiac = new sgDecalProjector()
		{
			position = alignTerrain(%player.getPosition());
			datablock = "blueZodiac";
		};
		MissionCleanup.add(%zodiac);
	}
}

#1
08/07/2009 (12:34 pm)
Well, if the error is happening in bitStream it could be something with networking, packing data, the like. Possibly more a problem with C++ changes than script changes. I'm not really sure what could be causing the error aside from that. If you run your Torque build in debug mode in VC++, you could break it on error and likely get more accurate data about what value is out of bounds and where it's failing.

Also, you're using TGE 1.5.2 to build this? I made myself a working spell system as well a little while ago in TGE 1.5.2, but it had nothing as far as effects, zodiacs, etc, if you'd like to work together on this project I think we could both get a lot out of it.
#2
08/08/2009 (1:40 am)
Sure thing! Just PM me your contact details (e.g. Skype, MSN)

#3
08/09/2009 (3:04 am)
Am I the only one to raise eyes that he has an sdk but he doesn't own it?
#4
08/09/2009 (3:18 pm)
I never noticed that. Maybe that's why his work looks all script?