Author Topic: Changing color then changing back  (Read 722 times)

My Problem: I can't get these functions to call. The main ones work, but the console says attempting to call function setraycasting and setcolliding, and it also says unknown object.. Please help me with this, its very confusing to me, because I have no idea why it doesn't call the functions.


Code: [Select]
function MyweaponProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
        %col.BrickChange();
        %col.schedule(10000, "BrickNormal");
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);

These are the functions

Code: [Select]
function FxDTSBrick::BrickChange(%this,%brick)
{
%brick.setColliding(0);
%brick.setRayCasting(0);
}

function FxDTSBrick::BrickNormal(%this,%brick)
{
%brick.setColliding(1);
%brick.setRayCasting(1);
}
« Last Edit: May 02, 2008, 09:43:30 PM by Dr Bling »

My Problem: I can't get these functions to call. The main ones work, but the console says attempting to call function setraycasting and setcolliding, and it also says unknown object.. Please help me with this, its very confusing to me, because I have no idea why it doesn't call the functions.


Code: [Select]
function MyweaponProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
        if(!isobject(%col)){ return; }
        if(%col.getclassname()$="FxDTSBrick"){
           %col.BrickChange();
           %col.schedule(10000, "BrickNormal");
        }
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);

These are the functions

Code: [Select]
function FxDTSBrick::BrickChange(%this,%brick)
{
%this.setColliding(0);
%this.setRayCasting(0);
}

function FxDTSBrick::BrickNormal(%this,%brick)
{
%this.setColliding(1);
%this.setRayCasting(1);
}


try that.

Thanks :D

New problem, Im sorry  but I tried this for like 2 hours

Code: [Select]
function FxDTSBrick::MineralRockChange(%this,%brick)
{
%this.setRayCasting(0);
$ResourceNormal = %this.getColorID();
%this.setColor(rgbtopaint($ResourceChange SPC "1"));
}

function FxDTSBrick::MineralRockNormal(%this,%brick)
{
%this.setRayCasting(1);
%this.setColor(rgbtopaint($ResourceNormal SPC "1"));
}

$ResourceChange = "1.0 1.0 1.0";

Its supposed to get the colorID, then after the schedule it will do the second function, making it go back to the original ID. But, the problem is, instead of making it go back to original color, it makes it go to the first color on the colorset every time. I used obj.dump(); and alot of stuff but to no avail, please help once more...
« Last Edit: May 02, 2008, 09:45:49 PM by Dr Bling »

Falcondude Helped me out, thanks for reading.