Author Topic: Help me Obi-wan...  (Read 8960 times)

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« on: April 11, 2005, 03:07:28 PM »
master spawn script that uses flags and
"If in this area the weak spawns are this,but if they are in this other area; they'll be this instead"

now, i'm not sure i want to mix weak and medium monsters as the player lvls (which would be used to maintain a semi-balanced xp gain-like)
i'd like it centralized so i can make quick changes or updates to the monsters

Tags: (so i can find it cause i'm blind <_<)
Area_1
Area_2
Flags:
SPAWN_weak
SPAWN_Medium


-YES! there will be more...the Force is weak with me :(
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Help me Obi-wan...
« Reply #1 on: April 11, 2005, 03:22:40 PM »
Hmm, I think this may be a cleverly hidden script request.

OK, Khad, take a deep breath and try that again.

What kind of script are trying to make? It sounds like some kind of creature spawning script that spawns either easy or medium creatures depending on an area somehow.

Is this for when PCs enter a trigger or an area or is it based on something else being in those areas.

Have you tried making the script? If so post it.

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #2 on: April 12, 2005, 12:49:13 AM »
basically instead of doing and individual AreaOnEnter script that will spawn...well for example

You enter a graveyard and you are lvl 3
you will spawn 3 Zombies

-now take that same lvl 3 and put him in the forest
you will spawn 3 Badgers

*summary, i don't want 80+ area-specific scripts, i want one script that will check  and say "oh, you're lvl 3 and in the forest." or "oh, you're lvl 3 and in the graveyard."

(and no-i did try, but i don't know how to make a lvl constraint...it just say is less than or equal to or greater than or equal to...but i'd like to know if i can enter a lvl range (lvl 1-3 will spawn this, 4-6 will spawn that)

here's my test...but it's area-specific...so i'll have to do it 80+ more times <_< (i put some notes in about lvl ranges...AND ZOMGWTFBQQ!!!!11111 IT COMPILED  :o
Code: [Select]
#include "nw_i0_generic"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;

object oTargetweak;
object oTargetmedium;
object oTargethigh;
object oTargetultra;

object oSpawnweak;
object oSpawnmedium;
object oSpawnhigh;
object oSpawnultra;

location lTarget1;
location lTarget2;
location lTarget3;
location lTarget4;

oTargetweak = GetWaypointByTag("SP_weak");
oTargetmedium = GetWaypointByTag("SP_medium");
oTargethigh = GetWaypointByTag("SP_high");
oTargetultra = GetWaypointByTag("SP_ultra");

lTarget1 = GetLocation(oTargetweak);
lTarget2 = GetLocation(oTargetmedium);
lTarget3 = GetLocation(oTargethigh);
lTarget4 = GetLocation(oTargetultra);

if (GetHitDice(oPC) >= 1)//1-4...not sure how to do the range
   {
oSpawnweak = CreateObject(OBJECT_TYPE_CREATURE, "nw_zombie01", lTarget1);
   }
if (GetHitDice(oPC) >= 5)//5-9..ditto
   {
oSpawnmedium = CreateObject(OBJECT_TYPE_CREATURE, "nw_zombwarr01", lTarget2);
   }
if (GetHitDice(oPC) >= 10)//10-14...ditto
   {
oSpawnhigh = CreateObject(OBJECT_TYPE_CREATURE, "nw_zombieboss", lTarget3);
   }
if (GetHitDice(oPC) >= 20)//20-25....ditto
   {
oSpawnultra = CreateObject(OBJECT_TYPE_CREATURE, "nw_lich003", lTarget4);
   }

oTargetweak = oSpawnweak;
oTargetmedium = oSpawnmedium;
oTargethigh = oSpawnhigh;
oTargetultra = oSpawnultra;

SetIsTemporaryEnemy(oPC, oTargetweak);
AssignCommand(oTargetweak, ActionAttack(oPC));
AssignCommand(oTargetweak, DetermineCombatRound(oPC));
SetIsTemporaryEnemy(oPC, oTargetmedium);
AssignCommand(oTargetmedium, ActionAttack(oPC));
AssignCommand(oTargetmedium, DetermineCombatRound(oPC));
SetIsTemporaryEnemy(oPC, oTargethigh);
AssignCommand(oTargethigh, ActionAttack(oPC));
AssignCommand(oTargethigh, DetermineCombatRound(oPC));
SetIsTemporaryEnemy(oPC, oTargetultra);
AssignCommand(oTargetultra, ActionAttack(oPC));
AssignCommand(oTargetultra, DetermineCombatRound(oPC));
}
« Last Edit: April 12, 2005, 12:50:29 AM by Khadgar of Dalaran »
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #3 on: April 12, 2005, 04:14:08 AM »
*on a side note...ya know Bioware has a thing called the Encounter system...lol... *feels stupid now* :(
-but i still don't know if it'll do what i want, which is look for lowest player lvl in party if they're in a non-PVP area and then the highest lvl player in the party if they're in a PVP area
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Help me Obi-wan...
« Reply #4 on: April 12, 2005, 12:49:43 PM »
Bah, Bioware's "systems".

For range you can do this:

if (GetHitDice(oPC) >= 1 &&
    GetHitDice(oPC) <= 4)

That will return true if the PC is level 1-4

The other thing you want to do is check the area, since you put it in the areas OnEnter script you can use this to check the area:

GetTag(OBJECT_SELF); (OBJECT_SELF should return the area thats calling the script)

or

GetTag(GetArea(GetEnteringObject()));

Then you just compare it:

if(GetTag(OBJECT_SELF) == "forest") for instance.

Hope that helps,

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #5 on: April 13, 2005, 10:04:17 AM »
:D i'm remaking it anyways so...might as well do it right this time ^_^
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #6 on: April 20, 2005, 06:49:43 AM »
does anyone know what i can't get this freakin Unique Item(OnHit) to work....is there like a template i could see, and i'd prefer u just not say put OBJECT_SELF, cause i want tag-specific firings incase i have multiple lvls (lesser , (normal), Greater)...and it keeps saying this:
200504.20 6.47.17: Error. 'assarrow_act' did not compile.
assarrow_act.nss(4): ERROR: DECLARATION DOES NOT MATCH PARAMETERS

OnActivate: (assarrow_act)
Code: [Select]
void main()
{
object oArrow;
oArrow = GetTag(GetItemActivated("assassinsarrow"));
ExecuteScript("assassinsarrow", oArrow);
}

Script to be used: (saved as assassinsarrow)
Code: [Select]
effect eEffect;
object oTarget;
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 1.6
For download info, please visit:
http://www.lilacsoul.revility.com    */
void main()
{
object oPC;
if (!GetIsPC(GetItemActivatedTarget())
){
return;}
int nInt;
nInt = d20();
if (nInt==20)
   {
   oPC = GetItemActivator();
   oTarget = oPC;
   eEffect = EffectDeath();
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 60.0f);
   }
else
   {
   }
}
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Help me Obi-wan...
« Reply #7 on: April 20, 2005, 12:51:43 PM »
GetItemActivated("assassinsarrow") should be GetItemActivated()

When you say "OnActivate: (assarrow_act)" where is this script being placed? In the modules OnActivateItem even trigger?

I'm confused about what the first code is suppose to be doing, I recommend using this script in your modules OnActivateItem event trigger:

Code: [Select]
// x1_itemactivate
//:://////////////////////////////////////////////////
/*
Common script to be used as OnActivateItem script for
all modules. Executes the script with a name matching
the tag of the item being activated. Functions like
GetItemActivator() and GetItemActivatedTarget() will
work in these scripts, since they are being executed
from the perspective of the module itself. ???

Credit for this idea belongs to tjm, who posted it to
nwvault.ign.com.

 */
//:://////////////////////////////////////////////////
//:: Created By: Naomi Novik
//:: Created On: 09/27/2002
//:://////////////////////////////////////////////////

void main()
{
    ExecuteScript(GetTag(GetItemActivated()), OBJECT_SELF);
}

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #8 on: April 21, 2005, 05:50:09 AM »
i'll try that, but last time i used that it didn't work-even when the arrows were set to 100% effective on killing the opponent (same tags were used and i did a build
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #9 on: April 24, 2005, 11:10:26 PM »
okay, now i don't get why it's saything this ->
#include "inc_gsystem_evnt"
void main()
{
PGSModuleClientEnterEvent (GetEnteringObject());
object oPC = GetEnteringObject();
object oNoobArmor;
oNoobArmor = GetTag("travelrobe");
if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE);
GiveGoldToCreature(oPC, 1000);
CreateItemOnObject("travelrobe", oPC);
AssignCommand(oPC, ActionEquipItem(oNoobArmor, INVENTORY_SLOT_CHEST)));
SendMessageToPC(oPC, "After many a days afloat on this lonely voyage the man in the Crow's Nest yells out: Land ho!");
SendMessageToPC(oPC, "Welcome to Tirisfal young traveler.");
//SendMessageToPC(oTarget, "**DO NOT ATTACK THE NPCs UNLESS YOU WANT TO BE ATTACKED**");
//DelayCommand(3,SendMessageToPC(oTarget, "***PUT AWAY WEAPONS EXCEPT FOR MAGE STAFFS OR GUARDS WILL ATTACK***"));
AddJournalQuestEntry("Info", 1, oPC, FALSE, TRUE);
}

200504.24 11.38.16: Error. 'aux_mod_enter' did not compile.
aux_mod_enter.nss(14): ERROR: NO SEMICOLON AFTER EXPRESSION


- O_o huh? also, that is saying to give only ONE traveling robe and 1k gold to a player per character?
« Last Edit: April 24, 2005, 11:11:04 PM by Khadgar of Dalaran »
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Help me Obi-wan...
« Reply #10 on: April 25, 2005, 01:24:36 AM »
AssignCommand(oPC, ActionEquipItem(oNoobArmor, INVENTORY_SLOT_CHEST)));

Count the number of open parenthesis to the number of closed. 2 open, 3 closed.

try this:

AssignCommand(oPC, ActionEquipItem(oNoobArmor, INVENTORY_SLOT_CHEST));

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #11 on: April 25, 2005, 01:43:48 AM »
what did u say oNoobArmor = Get*what*("travelrobe");
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Help me Obi-wan...
« Reply #12 on: April 25, 2005, 11:56:54 AM »
Quote
what did u say oNoobArmor = Get*what*("travelrobe");
[snapback]22465[/snapback]

Code: [Select]
oNoobArmor = GetObjectByTag("travelrobe");

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #13 on: May 12, 2005, 10:39:46 PM »
Code: [Select]
void main()
{
object oTarget;
oTarget = //GetTag("TestZone");

effect eEffect;
eEffect = EffectAreaOfEffect(EFFECT_TYPE_SPELL_FAILURE, 100); //(permanent spell failure in areas to reduce lag)

location lLocation;
lLocation = GetArea(oTarget);
              //erm...w(here)tf do i put the actual tag of the area <_<
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eEffect, lLocation);
}

/* void main()
{
object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

object oTarget;
oTarget = oPC;

effect eEffect;
eEffect = EffectSilence();  //where are the effects listed in the script editor?
          //can't use this cause of Auto Silence feat-unless this will bypass that anyway =D
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
}
*/

i hate being so damn stupid  &lt;_&lt; but the gist is i want to creat areas where you can't cast-like public meeting areas
-BUT THERE'S HOPE! I DID THAT ABOVE STUFF ON MY OWN :D ...it just doesn't work
Our greatest glory is not in never falling but in rising everytime we fall.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Help me Obi-wan...
« Reply #14 on: May 13, 2005, 12:41:09 PM »
It would help if you said where the script was being called from.

Anyway, for Dead Magic Zones or Wild Magic Zones or anything where you want a spell to work differently under a given set of circumstances you want to use Biowares spell hook system.

Spell Hooking Tutorial

Then, the spell hook script you make should look something like this:

Code: [Select]
#include "x2_inc_switches"

void main()
{
object oPC = GetLastSpellCaster();
object oArea = GetArea(oPC);

if(GetTag(oArea) == "AreaTag")
     {
          SetModuleOverrideSpellScriptFinished();
     }
}

The above code will check the tag of the area that the caster is in. If the area's tag is "AreaTag" then the spell will fail. (You may want to send a message to the PC telling then why the spell failed)

-420

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Help me Obi-wan...
« Reply #15 on: May 13, 2005, 05:02:17 PM »
sooooo that's what Dead Magic means *feels really stupid now*
Our greatest glory is not in never falling but in rising everytime we fall.