PDA

View Full Version : Beam/spawn script


Canderis
08-05-2009, 02:01 PM
How would I make a beam come out of a placable, and zap a spot and then a npc spawns there.

Star Admiral
08-05-2009, 02:25 PM
Try this. I'm not positive it will work, as EffectBeam() seems only to work with creatures.

void main() {
location lSpawn = Location( Vector( 0.0, 0.0, 0.0 ), 0.0 );
object oPlaceable = GetObjectByTag( "TagOfPlaceable" );
effect eBeam = EffectBeam( 1021, oPlaceable, BODY_NODE_CHEST, FALSE );
object oZap = CreateObject( OBJECT_TYPE_PLACEABLE, "plc_invisible", lSpawn, FALSE );
ApplyEffectToObject( DURATION_TYPE_TEMPORARY, eBeam, oZap, 1.5 );
AssignCommand( oZap, DestroyObject( oZap, 2.0, TRUE, 0.0 ) );
CreateObject( OBJECT_TYPE_CREATURE, "TagOfCreature", lSpawn, TRUE );
}

- Star Admiral

Canderis
08-05-2009, 05:27 PM
void main() {
location lSpawn = Location( Vector( 2.68, -126.97, 28.60 ), 3.14 );
object oPlaceable = GetObjectByTag( "PLC_holocron" );
effect eBeam = EffectBeam( 1021, oPlaceable, BODY_NODE_CHEST, FALSE );
object oZap = CreateObject( OBJECT_TYPE_PLACEABLE, "plc_invisible", lSpawn, FALSE );
ApplyEffectToObject( DURATION_TYPE_TEMPORARY, eBeam, oZap, 1.5 );
AssignCommand( oZap, DestroyObject( oZap, 2.0, TRUE, 0.0 ) );
CreateObject( OBJECT_TYPE_CREATURE, "dt", lSpawn, TRUE );
}
Doesn't work. I can fire it through dialog if needed.
EDIT: I got it to work, minus the beam, it looks fine for what I am doing so no further questions here.

Star Admiral
08-06-2009, 12:17 AM
Could you tell me what you edited to make it work? I'm curious. :)

- Star Admiral

Canderis
08-06-2009, 12:37 AM
I just removed the beam effect. Just kept the spawn.