Author Topic: Looking for a GOOD flying script  (Read 788 times)

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Looking for a GOOD flying script
« on: December 20, 2010, 09:47:51 pm »


               Just as the title says we are looking for a good script that does not use haks so Sub Races can fly or mages could use the spell Fly.

I have some ways but need something better as we have went ahead and during our slow holiday month we went ahead and redid the whole server script wise.

Any help would be appreciated and yes, I know several of you have good scripts but please only mention them if your willing to share, lol....telling me you have something awesome then not sharing it is like that guy who orders two shots and after drinking one and telling how good it is drinks the other....
               
               

               
            

Legacy_eeriegeek

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #1 on: December 20, 2010, 11:30:28 pm »


               TSM Dude, can you clarify... are you trying to actually make the PCs appear to be flying continually? If so you will need the "flying" phenotypes added via a hak file like the CEP. Or do you want PC's to appear to fly from place to place as is sometimes done with the "jump" animation from point to point? Hmn.. you say you have some ways... are you just teasing us? :innocent:
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #2 on: December 21, 2010, 12:01:07 am »


               

TSMDude wrote...
Any help would be appreciated and yes, I know several of you have good scripts but please only mention them if your willing to share, lol...

I HAS AW3SOM3 SKRIPT YOU CANNOT HAS! BWAHAHAHAHA! ':devil:'


On a more serious note, this is what we use for our Boots of Springing and Leaping - it just uses AppearDisappear, which can have serious downsides (like players stuck bein invisible and unable to move, requiring relog). That's an uncommon problem, though, and we see it as acceptable for our purpose - guild contests:





#include "hg_inc"

#include "x2_inc_switches"

void main() {
    SetExecutedScriptReturnValue(X2_EXECUTE_SCRIPT_END);

    if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE)
        return;

    object oPC = GetItemActivator();
    object oItem = GetItemActivated();
    object oArea = GetArea(oPC);

    if (GetTag(oArea) != "PillarsofPerdition") {
        SendMessageToPC(oPC, "You cannot use these boots in this area.");
        return;
    }

    location lTarget = GetItemActivatedTargetLocation();

    object oBlocker = GetNearestCreatureToLocation(CREATURE_TYPE_IS_ALIVE, TRUE, lTarget,
        1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
    location lBlocker = GetLocation(oBlocker);

    object oCreature = GetNearestCreatureToLocation(CREATURE_TYPE_IS_ALIVE, TRUE, lTarget, 1);
    location lCreature = GetLocation(oCreature);


    if (GetIsObjectValid(oBlocker) &&
        oBlocker != oPC            &&
        GetDistanceBetweenLocations(lTarget, lBlocker) < 2.0) {

        SendMessageToPC(oPC, "You cannot land so close to another player. Because there " +
            "is not enough room to land, you would plummet into oblivion.");
        return;
    }


    if (GetIsObjectValid(oCreature)       &&
        GetIsEncounterCreature(oCreature) &&
        GetDistanceBetweenLocations(lTarget, lCreature) < 2.0) {

        SendMessageToPC(oPC, "You cannot land so close to a creature. Because there " +
            "is not enough room to land, you would plummet into oblivion.");
        return;
    }


    if (GetResRef(oItem) == "bootsofspring001") {
        if (GetLocalInt(oArea, "RestrictGreaterBoots") && !GetLocalInt(oPC, "AllowGreaterBoots")) {
            SendMessageToPC(oPC, "You cannot use the Greater Boots of Springing and Leaping at this time.");
            return;
        }

        AddLocalInt(oPC, "GreaterBootsUses", 1);
    }


    if (GetIsObjectValid(GetItemPossessedBy(oPC, "newssithrgem")))
        RemoveStealthEffects(oPC);


    effect eJump = EffectDisappearAppear(lTarget);

    ApplyVisualToObject(VFX_IMP_PULSE_WIND, oPC);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eJump, oPC, 5.0);
}



For places where it could cause a player permadeath, however, we use an alternative using two effects, Disappear and Appear. Here's our illithid gravity warp effect:






void DoSlam(object oSlammed, int nDamage, int nHasRing) {
    location lSlam = GetLocation(oSlammed);
    effect eJump = EffectDisappear();
    effect eLand = EffectAppear();

    ApplyEffectToObject(1, eJump, oSlammed, 1.0);
    AssignCommand(GetArea(OBJECT_SELF), DelayCommand(1.0, ApplyEffectToObject(0, eLand, oSlammed)));
    effect eDamageFall = EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING);

    DelayCommand(2.0, ApplyEffectToObject(0, eDamageFall, oSlammed));

    if (nHasRing)
        DelayCommand(3.0, FloatingTextStringOnCreature("Your levitation cushioned your fall!", oSlammed, FALSE));
    else
        DelayCommand(3.0, FloatingTextStringOnCreature("The Graviter caught you in a gravity warp!", oSlammed, FALSE));
}


If you mean something other ethan short hops, though, you'd have to go the pheotype route as the last poster suggested. I suppose you could combine that with the 'hops' to allow players to go up and down on different elevations - though I would bind a player tool for that rather than an item, I think.

Funky
               
               

               
            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #3 on: December 21, 2010, 12:33:20 am »


               

eeriegeek wrote...

TSM Dude, can you clarify... are you trying to actually make the PCs appear to be flying continually? If so you will need the "flying" phenotypes added via a hak file like the CEP. Or do you want PC's to appear to fly from place to place as is sometimes done with the "jump" animation from point to point? Hmn.. you say you have some ways... are you just teasing us? :innocent:


Actually I have the jump animation and downloaded one from the vault but yes, what I am looking for is one that shows them flying AND then jumping I guess.

What I tried was I made them completly invisible and incorpeal and then allowed them to run dm fast to whatever destination they wanted...

While cool it actually was a nightmare as sooooo many things went wrong. (Ninja looting, flicker fighting...errors, lag...not worth it that way.)

I am hoping maybe someone has a unique take on it.
               
               

               
            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #4 on: December 21, 2010, 12:35:12 am »


               

FunkySwerve wrote...

TSMDude wrote...
Any help would be appreciated and yes, I know several of you have good scripts but please only mention them if your willing to share, lol...

I HAS AW3SOM3 SKRIPT YOU CANNOT HAS! BWAHAHAHAHA! ':devil:'


On a more serious note, this is what we use for our Boots of Springing and Leaping - it just uses AppearDisappear, which can have serious downsides (like players stuck bein invisible and unable to move, requiring relog). That's an uncommon problem, though, and we see it as acceptable for our purpose - guild contests:





#include "hg_inc"

#include "x2_inc_switches"

void main() {
    SetExecutedScriptReturnValue(X2_EXECUTE_SCRIPT_END);

    if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE)
        return;

    object oPC = GetItemActivator();
    object oItem = GetItemActivated();
    object oArea = GetArea(oPC);

    if (GetTag(oArea) != "PillarsofPerdition") {
        SendMessageToPC(oPC, "You cannot use these boots in this area.");
        return;
    }

    location lTarget = GetItemActivatedTargetLocation();

    object oBlocker = GetNearestCreatureToLocation(CREATURE_TYPE_IS_ALIVE, TRUE, lTarget,
        1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
    location lBlocker = GetLocation(oBlocker);

    object oCreature = GetNearestCreatureToLocation(CREATURE_TYPE_IS_ALIVE, TRUE, lTarget, 1);
    location lCreature = GetLocation(oCreature);


    if (GetIsObjectValid(oBlocker) &&
        oBlocker != oPC            &&
        GetDistanceBetweenLocations(lTarget, lBlocker) < 2.0) {

        SendMessageToPC(oPC, "You cannot land so close to another player. Because there " +
            "is not enough room to land, you would plummet into oblivion.");
        return;
    }


    if (GetIsObjectValid(oCreature)       &&
        GetIsEncounterCreature(oCreature) &&
        GetDistanceBetweenLocations(lTarget, lCreature) < 2.0) {

        SendMessageToPC(oPC, "You cannot land so close to a creature. Because there " +
            "is not enough room to land, you would plummet into oblivion.");
        return;
    }


    if (GetResRef(oItem) == "bootsofspring001") {
        if (GetLocalInt(oArea, "RestrictGreaterBoots") && !GetLocalInt(oPC, "AllowGreaterBoots")) {
            SendMessageToPC(oPC, "You cannot use the Greater Boots of Springing and Leaping at this time.");
            return;
        }

        AddLocalInt(oPC, "GreaterBootsUses", 1);
    }


    if (GetIsObjectValid(GetItemPossessedBy(oPC, "newssithrgem")))
        RemoveStealthEffects(oPC);


    effect eJump = EffectDisappearAppear(lTarget);

    ApplyVisualToObject(VFX_IMP_PULSE_WIND, oPC);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eJump, oPC, 5.0);
}



For places where it could cause a player permadeath, however, we use an alternative using two effects, Disappear and Appear. Here's our illithid gravity warp effect:






void DoSlam(object oSlammed, int nDamage, int nHasRing) {
    location lSlam = GetLocation(oSlammed);
    effect eJump = EffectDisappear();
    effect eLand = EffectAppear();

    ApplyEffectToObject(1, eJump, oSlammed, 1.0);
    AssignCommand(GetArea(OBJECT_SELF), DelayCommand(1.0, ApplyEffectToObject(0, eLand, oSlammed)));
    effect eDamageFall = EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING);

    DelayCommand(2.0, ApplyEffectToObject(0, eDamageFall, oSlammed));

    if (nHasRing)
        DelayCommand(3.0, FloatingTextStringOnCreature("Your levitation cushioned your fall!", oSlammed, FALSE));
    else
        DelayCommand(3.0, FloatingTextStringOnCreature("The Graviter caught you in a gravity warp!", oSlammed, FALSE));
}


If you mean something other ethan short hops, though, you'd have to go the pheotype route as the last poster suggested. I suppose you could combine that with the 'hops' to allow players to go up and down on different elevations - though I would bind a player tool for that rather than an item, I think.

Funky


Thanks Funky. I will check it out as it looks kinda like how we did Leap of Clouds and Blink.

The part in blue though...I wonder what that would do if I did jump them up and down in elevations.....
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #5 on: December 21, 2010, 12:42:09 am »


               I did a boots of leaping which is short range. Then just put a No_Leap int on any area in which no leaping or flying is allowed. Interior areas, caverns with low ceilings. For the cloak of flight I just use long range which is an extended version of the boots, basically line of sight.  Also if the person is mounted they can't use either item.  You might want to consider that, or not, since horses can actually leap farther than people, but they really are boots on the person, not horseshoes of leaping.  Something to consider.  Also I am not sure how it would work with the animation since I don't thing horses have a leaping animation, though they should.  Sometimes you just have to go with what you have.
               
               

               


                     Modifié par ffbj, 21 décembre 2010 - 12:45 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #6 on: December 21, 2010, 12:45:05 am »


               

TSMDude wrote...


The part in blue though...I wonder what that would do if I did jump them up and down in elevations.....


Part in blue? I think the forum goat ate something.

Funky
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #7 on: December 21, 2010, 01:53:43 am »


               

TSMDude wrote...

Just as the title says we are looking for a good script that does not use haks so Sub Races can fly or mages could use the spell Fly.


Well, this really depends on what you mean by "flying." Do you just mean using the "appear/disappear" animation, or are you looking for something more elaborate?

I did implement a lot in the way of "flying" options in my module, Sanctum of the Archmage 2: The Miracle Worker - Act I. You might find some of it useful, and feel free to borrow any of the scripting you need to. Anything serious in the way of what I would call "flying," though, requires custom content (and thus haks) of some kind.

In Sanctum 2, I did several things to implement "flying." The main one was to use a very minimal tileset developed by NinjaWeaselMan called "Space Tileset." It's a reskin of the microset that takes out virtually all the textures, so you can create areas with no visible terrain. In conjunction with skyboxes and a good choice of fog distance, it can be used to create areas that look like sky with fade to grey clouds below the characters. Combined with the flying pheno (a la CEP) and Hardpoints' ridable pegasus model, it allowed for some very effective looking "flying areas."

You can see a couple of examples here and here. (I'm also developing a more sophisticated flying system for my next module, but that's still a WIP.) But as I said, most of this kind of thing requires serious custom content, and that's going to mean using haks.

Another "flying" trick is to use animations. For example, in this video clip from Sanctum 2, I use one of the jousting animations to simulate pegaus riders flying off the peak of a mountain. The characters actually stay on the summit, but the animation makes it look like they are taking off into the air. I use the "appear/disappear" animation to do something similar with characters flying (wind-walking) without the pegasi. In each case I had to use an appropriately timed "fade to black," but stuff like that can be done with little or no hakking.
               
               

               


                     Modifié par AndarianTD, 21 décembre 2010 - 12:23 .
                     
                  


            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Looking for a GOOD flying script
« Reply #8 on: December 21, 2010, 11:50:55 am »


               Wow thanks everyone. Huge help on ideas and suggestions.



The blue part funky was this;



If you mean something other ethan short hops, though, you'd have to go the pheotype route as the last poster suggested. I suppose you could combine that with the 'hops' to allow players to go up and down on different elevations - though I would bind a player tool for that rather than an item, I think.