Author Topic: new thing()  (Read 1072 times)

I know you can create things with "new blah" but what are all the things?

new projectile()
new item()
new scriptObject()

I didn't know any way to find out.

I've got this as my bow projectile on collision.
It makes an arrow stick at the collision position for 5 seconds.
Code: [Select]
function arrowProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%col.getClassName() $= "Player"){
if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3){
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
}else{
%Arrow = new StaticShape()
{
   position = %pos;
   datablock = ArrowStuck;
   scale = "1 1 1";
   rotation = %obj.client.player.srot;
};
%Arrow.settransform(%obj.transform);
schedule(5000,0,"Arrowbewm", %Arrow);
}
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}

datablock StaticShapeData(ArrowStick)
{
category = "Static Shapes";   //Mission editor category
item = ArrowStick;
shapeFile = "add-ons/shapes/arrow.dts";
};

function Arrowbewm(%obj)
{
%obj.delete();
}


Datablocks (which are types of classes):

--CameraData
--DebrisData
--DecalData
--ExplosionData
>--FlyingVehicleData
>--FlyingWheeledVehicleData
--fxLightData
>--HoverVehicleData
--ItemData
--LightningData
--MissionMarkerData
--ParticleData
--ParticleEmitterData
--ParticleEmitterNodeData
--PlayerData
--ProjectileData
--ShapeBaseImageData
--SplashData
--StaticShapeData
--TriggerData
>--WheeledVehicleData


Classes:

AudioDescription
AudioProfile

GuiCanvas
GuiControl
GuiControlProfile
GuiCursor
GuiMenuBar
Gui{*}Ctrl

ActionMap
AIPlayer
Camera
>FlyingVehicle
>FlyingWheeledVehicle
>Fog
fxFoliageReplicator
fxGrassReplicator
fxShapeReplicator
fxShapeReplicatedStatic
fxSunLight
GameBase
GameConnection
>HoverVehicle
InteriorInstance
Item
Marker
MaterialPropertyMap
MessageVector
MissionArea
ParticleEmitterNode
Path
Player
Projectile
>RigidShape?
Sky
SpawnSphere
StaticShape
Sun
TerrainBlock
Trigger
TSShapeConstructor
TSStatic
WaterBlock
>WheeledVehicle
volumeLight

FileObject
HTTPObject
TCPObject
ScriptObject

NetObject
SceneObject
ShapeBase
SimGroup
SimObject
SimSet
« Last Edit: January 06, 2008, 11:20:31 AM by exidyne »

You forgot the rigidshape, however I don't think Badspot added rigidShape.cs into the source.

WheeledVehicle
WheeledVehicleData*
FlyingVehicle
FlyingVehicleData*
FlyingWheeledVehicle
FlyingWheeledVehicleData*
HoverVehicle**
HoverVehicleData*
Fog

*Should be created as datablock WheeledVehicleData(...) not new WheeledVehicleData(...)
**Hover vehicles do not render correctly without special nodes, sometimes blank out the screen and turn it red in the mission editor and cause errors "vehicledata oncollision" in the console.

Special nodes? You mean like jet nodes and stuff?

With models I have tried, the model does not render correctly as a hovervehicle but fine as a flyingvehicle. I'm not exactly sure what extra you need to make this work.