This script was made by @Voxpire if i recall good

i would like to make it activate itself as long as it gets spawned ( constructed)

i tried to add this to the [Constructor]

C#:
        [Constructable]
        public Nuke()
            : base()
        {
            Name = "10 Megaton IXEON MK-I";
            Clock = 1.0;
            MinDamage = 100;
            MaxDamage = 240;
            Radius = 10;
            //this.Visible = false;
            //this.Movable = false;
            m_IsActivated = true;
            Activate(this);
            NukeEventHandler.InvokeNukeActivated(this, this);
           // CloudHeight = NukeHeight.SingleLayer;
            //ExplosionHeight = NukeHeight.DoubleLayer;
             ExplosionHeight = NukeHeight.SingleLayer;
        }




is not working. any help?
 

Attachments

  • Nuke.rar
    7 KB · Views: 2
That is one OLD script! Those nukes were fun, but they've evolved in to something more in the Vita-Nex: Core project.

It's much easier to code items like this now.

Anyway, the edit you want to make would be to OnAfterSpawn() - you'll probably have to add your own override for that method.
In the override, you want to check if the Nuke's Spawner is not null, then call the method responsible for starting the timer.
 
Hehe yes they are old.

This is what i tried, didnt work obviously

C#:
 public override void OnAfterSpawn()
   {
       if (this != null)
       {
           int
            countdownaddone = ((int)m_Clock + 1),
            countdown = (int)m_Clock;
           CountDownTimer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), countdownaddone, new TimerStateCallback(Detonate_OnTick), new object[] { this, countdown });
       }
   }
 
Just have it call Activate(this), or repeat the same code that happens in OnDoubleClick()
 
CS1502: Line 39: The best overloaded method match for 'Server.Nuking.BaseNuk
e.Activate(Server.Mobile)' has some invalid arguments
CS1503: Line 39: Argument '1': cannot convert from 'Server.Nuking.Nuke' to '
Server.Mobile'
 
Try Activate(null) then rewrite the Activate method to not crash when the Mobile argument is null.
 
I just wanted to implement that spelleffect circle to my earthquake spell and i end up having tons of erros :(
 
If that's all you want to do and you have Vita-Nex: Core installed, just add something like this;
C#:
// create a standard earth explosion effect with an 8-tile radius
var effect = new VitaNex.FX.EarthExplodeEffect( Caster, Caster.Map, 8 );

// optional: hook the effect handler
effect.Handler = effectInfo =>
{
    if( effectInfo.ProcessIndex == 0 ) // ensure we only run this code once per tile
    {
        // get all targets on this tile (Mobiles and IDamageable items)
        var targets = effectInfo.Map.GetObjectsInRange( effectInfo.Source.Location, 0 );

        foreach( var target in targets )
        {
                // use standard earthquake damage code to damage the target
        }

        targets.Free(); // clean up
    }
};

effect.Send(); // start processing the effect
 
Thanks. I dont have vita installed, i tried to install it long ago, (im using runuo 2.2) you even tried to help me, i wasnt able to compile. It had something to do with the framework version if i recall good
 
I've helped so many people with framework updates, it's hard to keep track, sorry :p
If you have a private repository for your shard on github, gitlab, or bitbucket, send me a PM and we'll get it installed.
 
Back