Blockland Forums > Modification Help

Looping a Schedule/ Obtaining Health of a Vehicle [Fixed]

Pages: << < (4/5) > >>

KuriousGeorge:

It executed, but the console says
unknown command getMountedObject [Edit: I can use %driver = %vehicle.getMountNodeObject(0)]
and
unknown command getDamagePercent
 :panda:

On a side note, I took out my bottom print and replaced my onMount code with your right aligned idea with all the spiffy colors. It looks nice!

Also, must the code be packaged? I tried it packaged and unpackaged, the console took them both but didn't know the functions. I can work my way not using getDamagePercent- just the way I did my first post, using HP.

Chrono:


--- Quote from: KuriousGeorge on October 11, 2010, 08:58:34 PM ---It executed, but the console says
unknown command getMountedObject
and
unknown command getDamagePercent
 :panda:

--- End quote ---
I'm not sure what to do about this. I'm tired and I have barely any experience around vehicles, mostly because I don't like how they work in Blockland.


--- Quote from: KuriousGeorge on October 11, 2010, 08:58:34 PM ---Also, must the code be packaged? I tried it packaged and unpackaged, the console took them both but didn't know the functions. I can work my way not using getDamagePercent- just the way I did my first post, using HP.

--- End quote ---
They gotta be packaged.

KuriousGeorge:

Well thanks for your help Chrono you still make beast add-ons.

I'm using

%driver = %vehicle.getMountNodeObject(0);

but it still won't work... And the console says still that getMountedObject isn't a command when I don't have it in my code (Yes I re executed. ) It says it's in line 0 too?

My current code is



--- Code: ---package NewPackage
{
function wheeledVehicle::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
Parent::damage(%this, %obj, %sourceObject, %position, %damage, %damageType);
        %driver = %obj.getMountNodeObject(0);
centerPrint(%driver.client,"<just:right><color:ffffff>You got hit" ,3);
}
};

activatePackage(NewPackage);
--- End code ---



KuriousGeorge:

I just exited and opened Block Land and all was good with the ghost commands.
Still though, I need a way to get the driver of the vehicle.

I've tried
%Driver = %obj.getControllingObject();
%Driver = %obj.getMountNodeObject(0);

Both don't work. The console says unknown command. I think the problem may be something else.

Xalos:

Try

%driver = %this.getControllingObject();
or
%driver = %this.getMountNodeObject(0);

Pages: << < (4/5) > >>

Go to full version