Author Topic: combat dummy script?  (Read 360 times)

Legacy_spoe71

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
combat dummy script?
« on: February 14, 2013, 10:20:15 pm »


               Hello.  I am not a scripter; in fact, I use Lilac Soul's generator (truly a life saver) for almost everything and the NWN Scripting database archive for everythying else.  I use game 1.69 and the updated generator for 1.69 and I have all of the expansions. 

I'm wondering if any of you more talented folks can help me with a script that will make some militia practice on a combat dummy.  I plan to put a lieutenant next to them who continually shouts boot-camp type commands at them while they practice.  He is the only one who will have a conversation file, if that matters.  I don't, however, want him attacking the dummy because then he might not stop for conversation (I have him ready to go, including the random one-liners he shouts at the militia, so I do not need help with him).

I found an article about how you can create a custom monster and make it look like a combat dummy, which works except that it hits back, so my level 6 militia do not last long against it, so that didn't work. 

I also tried using the script generator to create an OnHeartbeat script for my militia to target and attack the tagged placeable, "dummy_1," using a standard combat dummy in the palette, but since the only option in the generator is to "attack someone," that didn't work--the militia just stood there.  I imagine because the script is looking for a monster and not a placeable.

The first option--creating a custom monster that looks like a combat dummy--might work if I could apply a permanent sleep or stun effect to the object so that it would not hit back, but I'm not sure I know how to do that.

Thanks for any help you all can provide, and thanks for all of the informative posts, tutorials, and examples that are helping me become more adept.
               
               

               


                     Modifié par spoe71, 14 février 2013 - 10:21 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
combat dummy script?
« Reply #1 on: February 14, 2013, 11:00:39 pm »


               This is terribly basic, and I'm not at the toolset right now, so YMMV. This should work with the placeable version.

// In your militia's OnHeartbeat Script
void main()
{
    object oDummy = GetNearestObjectByTag("dummy_1");
    ActionAttack(oDummy);
}

               
               

               


                     Modifié par Squatting Monk, 14 février 2013 - 11:01 .
                     
                  


            

Legacy_spoe71

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
combat dummy script?
« Reply #2 on: February 14, 2013, 11:27:52 pm »


               Dang.  Really?  haha.  I'm so sorry.  I guess I just figured it would be more complicated than that.  Thank you very much.
               
               

               
            

Legacy_Wensleydale

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-0
combat dummy script?
« Reply #3 on: February 14, 2013, 11:32:44 pm »


               If you want your militia to stand in front of the dummy and whack it, rather than shuffling all over the place as they have a habit of doing, set their movement to IMMOBILE.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
combat dummy script?
« Reply #4 on: February 15, 2013, 02:14:18 am »


               I myself, Since he has a commander shouting commands, Think it would be fun to have the militia Fololowing the orders he shouts.    

Set up listening patterns for the shouts.   Have shouts such as.  

Retreat:    Fall back to an archery range.  
Draw bow:    Change to a ranged weapon.  
Fire:            attack dunmmy with bow.
Charge:      Draw melee weapon and charge
ect...
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
combat dummy script?
« Reply #5 on: February 16, 2013, 04:24:48 pm »


               I made the octagong. Eight gong targets that ring one of three tones when hit. It's silly.

I set if up for ranged weapons only.  Then used beams laid  out to set the range. then gong1, gong2, etc...
Leaving a few gongs open depending on how many npc's are there. Btw npc 1,2,etc.. so they know which gong to hit and a wp for them to go too. I used the underground tile crypt or maybe ruins the one where you come down the huge steps into the center of the room the gongs are set up at the edges of the room.  In case anyone is interested:
void main()
{
   object oSpawn;
   oSpawn = OBJECT_SELF;
   object oPC = GetLastDamager();
   int iHd = GetHitDice (oPC);
    int iDmg = GetDamageDealtByType(DAMAGE_TYPE_BLUDGEONING) +  GetDamageDealtByType(DAMAGE_TYPE_PIERCING) + GetDamageDealtByType(DAMAGE_TYPE_SLASHING);
    iDmg += d6(2);
    if (!GetWeaponRanged(GetLastWeaponUsed(oPC)))
    return;
    if (iHd > 9)
     {
     ActionSpeakString ("You can no longer get xp attacking this target.");
     return;
     }
    {
        if (iDmg == 0)
        {
            ActionSpeakString ("Miss...Haybale...");
            return;
        }
        else if (iDmg <= 3)
        {
            ActionSpeakString ("...Hit...");
            GiveXPToCreature(oPC,5);
            DelayCommand (0.2, AssignCommand(oSpawn, PlaySound("as_cv_gongring1")));
            return;
        }
        else if (iDmg <= 7)
        {
            ActionSpeakString ("...Hit... ");
            GiveXPToCreature(oPC,10);
          DelayCommand (0.2, AssignCommand(oSpawn, PlaySound("as_cv_gongring2")));
            return;
        }
        else if (iDmg <= 12 )
        {
            ActionSpeakString ("...Hit...");
            GiveXPToCreature(oPC,15);
            DelayCommand (0.2, AssignCommand(oSpawn, PlaySound("as_cv_bell2")));
            return;
        }
        else if (iDmg <= 18 )
        {
            ActionSpeakString ("...Hit...");
            GiveXPToCreature(oPC,25);
            DelayCommand (0.2, AssignCommand(oSpawn, PlaySound("as_cv_bell2")));
            return;
        }
    else
       ActionSpeakString ("Hurrah!");
    }

}
               
               

               


                     Modifié par ffbj, 16 février 2013 - 04:37 .
                     
                  


            

Legacy_spoe71

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
combat dummy script?
« Reply #6 on: February 21, 2013, 02:03:34 am »


               The Octagong is excellent!  Thanks for sharing that.  I am such a noob scripter that I can't pass on stuff like that.  I'm currently trying to figure out the Generic NPC Script Version 3.2, by Mr. Scully, but it is proving difficult to implement simply because it is all so foreign to me.  I'm working on it though.  I wish there were more examples available as to how the OnSpawn script can be modified to create different effects and how the various waypoints are set up to facilitate the changes.  

I appreciate all the input, fellas.  The NWN community has always been such a wonderful resource.