Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Ergebnis 1 bis 3 von 3
  1. Beiträge anzeigen #1 Zitieren
    Apprentice
    Registriert seit
    Oct 2012
    Beiträge
    33
     
    dorumia ist offline

    [G2]How to edit collision in new spell?

    Hello. I have a little problem with my new spell based on Mass Death. It's hit double time(if player character is close to npc[face to face?]) or 1 hit(if PC have a little distance from npc). I create spell script and add additional visual and pfx instance. How i can fix it? I mean, i want spell like icewave(1 hit, but no additional) which looks like as Uriziel rune from G1(i copy pfx from it). That's what i have:
    INSTANCE spellFX_LIGHTUNDEAD(CFx_Base_Proto)
    {

    visname_S = "MFX_LIGHTUNDEAD_INIT";
    emtrjmode_s = "FIXED";
    emTrjOriginNode = "ZS_RIGHTHAND";
    emtrjloopmode_s = "NONE";
    emFXInvestOrigin_S = "spellFX_LIGHTUNDEAD_INITGLOW";
    emFXCreatedOwnTrj = 0;

    };

    INSTANCE spellFX_LIGHTUNDEAD_KEY_INIT(C_ParticleFXEmitKey)
    {
    visname_S = "MFX_LIGHTUNDEAD_INIT";
    };

    INSTANCE spellFX_LIGHTUNDEAD_KEY_CAST(C_ParticleFXEmitKey)
    {
    emCreateFXID = "spellFX_LIGHTUNDEAD_GROUND";
    pfx_ppsIsLoopingChg = 1;
    };

    INSTANCE spellFX_LIGHTUNDEAD_GROUND (CFx_Base_Proto)
    {
    visname_S = "MFX_LIGHTUNDEAD_CAST";
    emTrjOriginNode = "BIP01 R Foot";
    emActionCollDyn_S = "CREATEONCE";
    emFXCollDyn_S = "spellFX_LIGHTUNDEAD_Target";
    emFXCollDynAlign_S = "TRAJECTORY";
    emCheckCollision = 1;
    LightPresetName = "REDAMBIENCE";
    sfxid = "MFX_LIGHTUNDEAD_Cast";
    sfxisambient = 1;
    };



    INSTANCE spellFX_LIGHTUNDEAD_SUB(CFx_Base_Proto) // vorrübergehend, bis er hardcodiert nicht mehr gesucht wird
    {
    visname_S = "";
    emtrjmode_s = "FIXED";
    emTrjOriginNode = "BIP01 HEAD";
    };


    INSTANCE spellFX_LIGHTUNDEAD_Target(CFx_Base_Proto)
    {
    visname_S = "MFX_LIGHTUNDEAD_TARGET";
    emTrjOriginNode = "BIP01";
    emFXCreatedOwnTrj = 1;
    emtrjmode_s = "FIXED";
    sfxid = "MFX_LIGHTUNDEAD_Target";
    sendassessmagic = 1;
    };

    INSTANCE spellFX_LIGHTUNDEAD_INITGLOW (CFx_Base_Proto)
    {
    visname_S = "MFX_LIGHTUNDEAD_INIT_GLOW";
    emTrjOriginNode = "ZS_RIGHTHAND";
    emFXCreatedOwnTrj = 0;
    emtrjmode_s = "FIXED";
    LightPresetName = "REDAMBIENCE";
    };
    First is VisualFxInst. Second is PfxInstMagic.
    INSTANCE MFX_LIGHTUNDEAD_INIT (C_PARTICLEFX)
    {
    ppsvalue = 100.000000000;
    ppsislooping = 1;
    shptype_s = "SPHERE";
    shpfor_s = "object";
    shpoffsetvec_s = "0 0 0";
    shpdistribtype_s = "RAND";
    shpdim_s = "8";
    shpscalekeys_s = "1 2 3 3 2 2 2 1 2 3 2 3 4 3 2 1 2 3 2 1";
    shpscaleislooping = 1;
    shpscaleissmooth = 1;
    shpscalefps = 5.000000000;
    dirmode_s = "RAND";
    dirfor_s = "object";
    dirmodetargetfor_s = "OBJECT";
    dirmodetargetpos_s = "0 0 0";
    dirangleheadvar = 180.000000000;
    dirangleelevvar = 180.000000000;
    velavg = 0.001000000;
    velvar = 0.000100000;
    lsppartavg = 200.000000000;
    flygravity_s = "0 0 0";
    visname_s = "SIMPLEGLOW.TGA";
    visorientation_s = "VELO";
    vistexisquadpoly = 1;
    vistexanifps = 25.000000000;
    vistexaniislooping = 1;
    vistexcolorstart_s = "255 50 0";
    vistexcolorend_s = "255 0 0";
    vissizestart_s = "5 5";
    vissizeendscale = 2.000000000;
    visalphafunc_s = "ADD";
    visalphastart = 255.000000000;
    visalphaend = 255.000000000;
    };


    INSTANCE MFX_LIGHTUNDEAD_INIT_GLOW (C_PARTICLEFX)
    {
    ppsvalue = 100.000000000;
    ppsscalekeys_s = "1";
    ppsislooping = 1;
    shptype_s = "POINT";
    shpfor_s = "object";
    shpoffsetvec_s = "0 0 0";
    shpdistribtype_s = "RAND";
    shpdim_s = "5";
    shpscalekeys_s = "1 2 1 2";
    shpscaleislooping = 1;
    shpscaleissmooth = 1;
    shpscalefps = 0.500000000;
    dirmode_s = "RAND";
    dirfor_s = "object";
    dirmodetargetfor_s = "OBJECT";
    dirmodetargetpos_s = "0 0 0";
    dirangleheadvar = 180.000000000;
    dirangleelevvar = 180.000000000;
    velavg = 0.600000024;
    velvar = 0.020000000;
    lsppartavg = 2000.000000000;
    flygravity_s = "0 0 0";
    flycolldet_b = 0;
    visname_s = "MFX_Spell_Star.tga";
    visorientation_s = "NONE";
    vistexisquadpoly = 1;
    vistexanifps = 25.000000000;
    vistexaniislooping = 1;
    vistexcolorstart_s = "255 150 0";
    vistexcolorend_s = "255 0 0";
    vissizestart_s = "1 1";
    vissizeendscale = 1.000000000;
    visalphafunc_s = "ADD";
    visalphastart = 255.000000000;
    trlfadespeed = 0.800000012;
    trltexture_s = "MFX_FIRERAIN_RAINTRAIL.TGA";
    trlwidth = 1.000000000;
    };

    INSTANCE MFX_LIGHTUNDEAD_CAST (C_PARTICLEFX)
    {
    ppsvalue = 30.000000000;
    ppsscalekeys_s = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40";
    ppsissmooth = 1;
    ppsfps = 15.000000000;
    shptype_s = "CIRCLE";
    shpfor_s = "WORLD";
    shpoffsetvec_s = "0 -50 0";
    shpdistribtype_s = "RAND";
    shpdim_s = "40";
    shpscalekeys_s = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40";
    shpscalefps = 15.000000000;
    dirmode_s = "DIR";
    dirfor_s = "object";
    diranglehead = 90.000000000;
    dirangleheadvar = 45.000000000;
    dirangleelev = 90.000000000;
    dirangleelevvar = 45.000000000;
    velavg = 0.000100000;
    lsppartavg = 1000.000000000;
    lsppartvar = 300.000000000;
    flygravity_s = "0 0.00008 0";
    visname_s = "WHITECLOUD.TGA";
    visorientation_s = "VELO";
    vistexanifps = 25.000000000;
    vistexaniislooping = 1;
    vistexcolorstart_s = "255 50 50";
    vistexcolorend_s = "0 0 0";
    vissizestart_s = "20 20";
    vissizeendscale = 20.00;
    visalphafunc_s = "ADD";
    visalphaend = 255.000000000;
    trltexture_s = "LIGHTNING_BIG_A0.TGA";
    };

    INSTANCE MFX_LIGHTUNDEAD_TARGET (C_PARTICLEFX)
    {
    ppsvalue = 10.000000000;
    ppsscalekeys_s = "1 1 0.8 0.6 0.4 0.2";
    ppsissmooth = 1;
    ppsfps = 1.000000000;
    shptype_s = "CIRCLE";
    shpfor_s = "object";
    shpoffsetvec_s = "0 -100 0";
    shpdistribtype_s = "RAND";
    shpdim_s = "10";
    shpscalekeys_s = "1";
    shpscaleislooping = 1;
    shpscalefps = 15.000000000;
    dirmode_s = "DIR";
    dirfor_s = "object";
    diranglehead = 90.000000000;
    dirangleheadvar = 45.000000000;
    dirangleelev = 90.000000000;
    dirangleelevvar = 45.000000000;
    velavg = 0.000100000;
    lsppartavg = 2500.000000000;
    lsppartvar = 300.000000000;
    flygravity_s = "0 0.0001 0";
    visname_s = "WHITECLOUD.TGA";
    visorientation_s = "NONE";
    vistexanifps = 25.000000000;
    vistexaniislooping = 1;
    vistexcolorstart_s = "255 50 50";
    vistexcolorend_s = "0 0 0";
    vissizestart_s = "100 200";
    vissizeendscale = 2.000000000;
    visalphafunc_s = "ADD";
    visalphaend = 255.000000000;
    trltexture_s = "LIGHTNING_BIG_A0.TGA";
    };
    And last script is spell script.
    // *****************
    // SPL_LightUndead
    // *****************

    const int SPL_Cost_LightUndead = 35;
    const int SPL_Damage_LightUndead = 350; //soll halt wirklich killen!

    INSTANCE Spell_LightUndead(C_Spell_Proto)
    {
    time_per_mana = 0;
    damage_per_level = SPL_Damage_LightUndead;
    targetCollectAlgo = TARGET_COLLECT_NONE;
    };

    func int Spell_Logic_LightUndead (var int manaInvested)
    {
    if (Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
    {
    return SPL_SENDCAST;
    }
    else if (self.attribute[ATR_MANA] >= SPL_Cost_LightUndead)
    {
    return SPL_SENDCAST;
    }
    else //nicht genug Mana
    {
    return SPL_SENDSTOP;
    };
    };


    func void Spell_Cast_LightUndead()
    {
    if (Npc_GetActiveSpellIsScroll(self))
    {
    self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
    }
    else
    {
    self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_LightUndead;
    };

    self.aivar[AIV_SelectSpell] += 1;
    };
    Someone have any idea, how i can fix it to hit all enemy once only, not second or more(as Mass Death doing it)?

  2. Beiträge anzeigen #2 Zitieren
    Knight Avatar von Draxes
    Registriert seit
    Aug 2007
    Ort
    Mainz
    Beiträge
    1.920
     
    Draxes ist offline
    We had similar problems with our new AOE Spells. We fixed it through a new AIVAR, which indicates, if an NPC was hit by the spell already. Therefore, we gave MassDeath a damage of 0 and did the damage calculation in B_AsessMagic()

    Code:
    // Entry in B_AssessMagic() for MassDeath
    if (Npc_GetLastHitSpellID(self) == SPL_MassDeath) {
    	if(!self.aivar[AIV_WasHitByAOESpell]) {
    		self.aivar[AIV_WasHitByAOESpell] = true;
    	
    			if (self.guild < GIL_SEPERATOR_HUM) {
    				Npc_ClearAIQueue(self);
    				B_ClearPerceptions(self);   //Sonst reagiert der NPC nicht!
    
    				// Das ist wichtig, falls self noch nicht im Kampfmodus (hostile) ist
    				Npc_SetTarget(self, other);
    				B_AssessDamage();
    			};
    			// Und das ist wichtig, damit self nicht plötzlich aufhört mit dem Kämpfen
    			Npc_SetTarget(self, other);
    			Npc_SetTempAttitude(self, ATT_HOSTILE); // Falls nicht schon Gilden-Attitüde hostile ist
    		
                            // here you can do your damage with your favorite doDamage Function
    		};
    		
        return;
    };
    AIV_WasHitByAOESpell has to be reset for every Npc in regular intervals. We do this in a broadcast, which is called once a second for every Npc. If you don't know about broadcasts:

    https://forum.worldofplayers.de/foru...1#post17232705

  3. Beiträge anzeigen #3 Zitieren
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.246
     
    Milky-Way ist offline
    Zitat Zitat von Draxes Beitrag anzeigen
    AIV_WasHitByAOESpell has to be reset for every Npc in regular intervals. We do this in a broadcast, which is called once a second for every Npc. If you don't know about broadcasts:

    https://forum.worldofplayers.de/foru...1#post17232705
    Alternatively, one could probably also save the time of the last hit and in the damage function check whether a sufficient amount of time (if a minute of ingame time is too coarse, you could look at frame counts or real time, which Ikarus can provide, I think) has passed since the last hit. That might simplify it since you don't need the extra broadcast, but it also means you can't stack multiple binary values in the same aivar.

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide