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:
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);
}
}About the author
Torque 3D Owner Morrock
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.