Basically, I've been editing SBX 2.0 for personal uses in my office. Apologies and all, but I need to get back in touch with programming and stuff.
Anyway, what I've been trying to do with force_heal.cog is have it so that a do{}while() loop runs and keeps healing the player a little bit while the mana is greater than the cost.
The loop looks something like this:
do
{
HEALING STUFF
}
while(mana > cost);
A problem I always had in class was certain syntaxes would be incorrect, I'd miss a semi-colon or something. Is there ANYTHING you can see that is wrong with this:
if(GetThingHealth(player) < 100)
{
mana = GetInv(player, 14);
{
if(GetInv(player, 65) != 1)-->
ChangeInv(player, 14, -cost);
SetInvActivated(player, 25, 1);
PlayMode(player, 24);
soundChannel = PlaySoundThing(healingSound, player, 1.0, -1, -1, 0x80);
rank = GetInv(player, 25);
position = VectorAdd(GetThingPos(player), '0.0 0.0 0.01');
sphere = CreateThingAtPosNR(sphere_tpl, GetThingSector(player), position, '0.0 0.0 0.0');
AttachThingToThingEx(sphere, player, 0x8);
Sleep(0.6);
SetParticleGrowthSpeed(sphere, -3.0)
do
{
if(GetThingHealth(player) > 0)
{
HealThing(player, 1 * rank);
//jkPrintUNIString(player, 303);
}
Sleep(0.40);
DestroyThing(sphere);
mana=mana-cost;
}
while(mana > cost);
}
I know, no word wrap and stuff, but I hope you get the gist.
Seth
Anyway, what I've been trying to do with force_heal.cog is have it so that a do{}while() loop runs and keeps healing the player a little bit while the mana is greater than the cost.
The loop looks something like this:
do
{
HEALING STUFF
}
while(mana > cost);
A problem I always had in class was certain syntaxes would be incorrect, I'd miss a semi-colon or something. Is there ANYTHING you can see that is wrong with this:
if(GetThingHealth(player) < 100)
{
mana = GetInv(player, 14);
{
if(GetInv(player, 65) != 1)-->
ChangeInv(player, 14, -cost);
SetInvActivated(player, 25, 1);
PlayMode(player, 24);
soundChannel = PlaySoundThing(healingSound, player, 1.0, -1, -1, 0x80);
rank = GetInv(player, 25);
position = VectorAdd(GetThingPos(player), '0.0 0.0 0.01');
sphere = CreateThingAtPosNR(sphere_tpl, GetThingSector(player), position, '0.0 0.0 0.0');
AttachThingToThingEx(sphere, player, 0x8);
Sleep(0.6);
SetParticleGrowthSpeed(sphere, -3.0)
do
{
if(GetThingHealth(player) > 0)
{
HealThing(player, 1 * rank);
//jkPrintUNIString(player, 303);
}
Sleep(0.40);
DestroyThing(sphere);
mana=mana-cost;
}
while(mana > cost);
}
I know, no word wrap and stuff, but I hope you get the gist.
Seth
BLEAH
AIM:SethTAlbright
AIM:SethTAlbright