User:Allen Kerensky/Myriad Lite/NPC Critter Goon

From OpenSimulator

Jump to: navigation, search

Contents

NPC Critter Goon

NPC Critter Goon Concepts

The NPC Critter Goon is the first of 3 NPC types for Myriad Lite.

The Critter Goon is a low-power, simple, expendable opponent.

Against low level players a small pack of Critters (or small gang of Goons) should work.

Higher level players would have to clear swarms of these to get at a lieutenant and big boss creature.

You can make Critters/Goons tougher by increasing their attack and defense skills from 1 to 10 each.

You can also make Critters/Goons touch by increasing their Resilience (wounds) to take more damage.

Critters/Goons should only ever have 1 attack dice and 1 defense dice.

Implementing this framework script showed that a LOT more feedback, specifications, or desired library of NPC functions was needed.

This script needs your help to flesh out into a library of useful critters and goons for Medieval, Modern, and Futuristic settings.

Stance Functions

There are stubs for several possible stances the Critter/Goon could take.

These have not been implemented because they must be fitted by the NPC builder to a specific critter or goon model.

Suggested Stances included: Standing, Kneeling, and laying Prone - 3 common positions a soldier might take in battle.

Move Functions

There is an included MOVE_WANDER() function.

When used, this will cause the NPC critter/goon to wander from point to point within a given distance of its rez-point.

Stubs are included for many other possible movement modes that can be implemented or interfaced to existing NPC brain scripts

Attack Functions

Three useful functions included in this NPC script are:

  • ATTACK_RANGED() - fire a Myriad Turret Bullet (does not work with Myriad Bullet)
  • ATTACK_CLOSE_MELEE() - make an armed melee attack using Close Combat skill.
  • ATTACK_CLOSE_UNARMED() - man an unarmed close combat attack

Defence Functions

Stubs for 3 possible defense functions are included: Defense against ranged attack, defense against armed close combat such as melee, and defense against unarmed close combat.

Implementing these depends on the NPC designer's desired response to these attacks - move to cover? raise shields?

These functions could be triggered from DAMAGE_HIT, DAMAGE_WOUNDED, or DAMAGE_ZZZ as desired by the NPC designer.

Damage and Death

The NPC Critter Goon includes player-style damage, armor, wounds, and death functions.

On death, the NPC can either drop a treasure, then:

  • die and disappear
  • respawn after a delay

By default it will respawn.

NPC Critter Goon Setup

  1. Edit the script to set:
    1. SKILL_ATTACK from 1 to 10 (normal humans can only have 1-5 range, 6-10 is supernatural power!)
    2. SKILL_DEFENSE from 1 to 10 (normal humans can only have 1-5 range, 6-10 is supernatural power!)
    3. ARMOR - how hard is this creature to damage? from 0 to 5 where 0 is unarmored
    4. RESILIENCE - how many wounds from 1-20 can this creature take before dying?
    5. TREASURE - when killed does this creature drop items? this is a list! Multiple items will cause the creature to drop 1 random one from list.
    6. FLAG_RESPAWN - set true if you want monster to respawn after a delay, rather than die and disappear. This is the default.
    7. FLAG_DIE - set true if you want monster to die and disappear (llDie! cannot be undone!) rather than respawn. Use with caution.
  2. Now the tricky part - edit the HEARTBEAT() function content to implement your monster's Stance, Movement, Attack, and Defense behaviors
    1. This may be llMessageLinked() calls to other NPC brain functions
    2. This may be calls to MOVE_* and ATTACK_* functions in the NPC script.
    3. This may be to act on incoming link messages sent from other NPC brain scripts in the same object
  3. If you use incoming link messages, edit the link_message() function to receive them and trigger appropriate actions.
  4. Drop TREASURE items into monster
  5. Drop script into monster
  6. Test

The Myriad RPG Group

Join the Myriad RPG group for announcements and discussion around the Myriad RPG and Myriad Lite scripts.

SecondLife: secondlife:///app/group/dbedc3be-729e-a123-d669-92f401e07a1e/about

OSgrid: secondlife:///app/group/da0227e5-8a0d-4d99-b970-9411932c852d/about

Community

Role Medieval Modern Futuristic Universal
Scripter Allen Kerensky
Builder
Tester
Mentor/Teacher

Feature Requests

If you have a feature you would like to see added to Myriad Lite NPC Critter Goon, write a new feature request on the talk page for this article.

The best feature requests will have:

 Your SL name
 The name, version, and date of the script you are requesting new features in
 A description of the feature
 A sample implementation of the feature in LSL compatible with OSG and SL.

Bug Reports

If you find a bug or something that just doesn't seem right in how the Myriad Lite NPC Critter Goon script works, file a bug report on the talk page for this article.

The best bug reports will have:

 Your OSG or SL name
 The name, version, and date of the script you are having problems with
 A description of the problem itself
 Steps to follow to reproduce the problem

Contributing to Myriad Lite

If you would like to contribute to the Myriad Lite project, please do!

The best contributions will have:

 Your SL Name
 A description of the contribution
 The patch, script, file, or object being contributed
 A release stating: 
 * that you intend to contribute this to Myriad Lite
 * that you are the original creator of the contribution or are legally empowered to contribute it
 * that you acknowledge this contribution can be released under the Creative Commons BY 3.0 Unported and Modified BSD (3-clause) licenses
//============================================================================
// Myriad Lite NPC Critter Goon
// Copyright (c) 2012 by Lani Global Systems and Allen Kerensky (OSG/SL) All Rights Reserved.
// This work is dual-licensed under
// Creative Commons Attribution (CC BY) 3.0 Unported
// http://creativecommons.org/licenses/by/3.0/
// - or -
// Modified BSD License (3-clause)
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice, 
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
// * Neither the name of Myriad Lite nor the names of its contributors may be
//   used to endorse or promote products derived from this software without
//   specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
// NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// The Myriad RPG System was designed, written, and illustrated by Ashok Desai
// Myriad RPG System licensed under:
// Creative Commons Attribution (CC BY) 2.0 UK: England and Wales
// http://creativecommons.org/licenses/by/2.0/uk/
//============================================================================
Personal tools
General
About This Wiki