Author Topic: A Mass of Questions from NineCoronas  (Read 1058 times)

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« on: January 31, 2013, 11:51:47 pm »


               I have tried using the new, illustrious search tool, powered by google, unfortunately it doesn't seem to be loading results on my browsers >.< So apologies if I ask questions with which the answers are lying glaringly obvious too.

1) How does that XP slider in Module Properties affect XP gain? A semi-detailed explanation if possible (it's relationship to CR, the base XP given, etc.
Are there scripts I can edit to achieve this myself?

2) Is there a way to manipulate the way ILR works using scripting rather than editing and including
itemvalue.2da in a hak?

3)Is there a simple way to initiate conversations when a PC tries to take an item out of a Henchman's inventory, and is there a way to keep items "locked" into a slot, I.E. an Amulet on the PC, a cloak on a Henchman (both specifically, actually).

That's it for now, but there will definitely be many more!

Cheers!

-NineCoronas

               
               

               
            

Legacy_LoA_Tristan

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #1 on: February 01, 2013, 12:22:09 am »


               As to 1, the slider is the percentage of what experience value would normally be awarded, for players of a certain level versus opponents of a certain CR, under the pen and paper rules.  (Default is 10%.  This is a video game— so resting, heals, items, and big mobs of enemies come way thicker than PnP)

For 3, the OnDisturbed event handler.  It could undo whatever the PC does to muck things up, but I don't know if it could prevent any action.

ex.

void main()
{
    object oItem = GetLastDisturbed();
    if (GetTag(oItem) == "MY_TREASURED_ITEM") ActionEquipItem(oItem, INVENTORY_SLOT_x);
}
...would instantly re-equip an item.  A conversation could also be initiated by this event.

Don't forget about tagging NPC's personal possessions as undroppable.
               
               

               


                     Modifié par LoA_Tristan, 01 février 2013 - 12:23 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #2 on: February 01, 2013, 12:36:51 am »


               Adding to number 1, you can set the slider to 0 and assign XP yourself. There's some good systems on the Vault for this.

As for number 2, you can't mess with ILR directly, but you can unequip items too powerful for the PC from the OnPlayerEquipItem event. This also ties into the second part of number 3: use the OnPlayerUnEquipItem event to keep the PC from unequipping an essential item.
               
               

               


                     Modifié par Squatting Monk, 01 février 2013 - 12:37 .
                     
                  


            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #3 on: February 01, 2013, 01:13:58 am »


               

LoA_Tristan wrote...

As to 1, the slider is the percentage of what experience value would normally be awarded, for players of a certain level versus opponents of a certain CR, under the pen and paper rules.  (Default is 10%.  This is a video game— so resting, heals, items, and big mobs of enemies come way thicker than PnP)


I think I'll toy with this slider before heading to the Vault. I'm not looking for anything complex.


LoA_Tristan wrote...

For 3, the OnDisturbed event handler.  It could undo whatever the PC does to muck things up, but I don't know if it could prevent any action.

ex.


void main()
{
    object oItem = GetLastDisturbed();
    if (GetTag(oItem) == "MY_TREASURED_ITEM") ActionEquipItem(oItem, INVENTORY_SLOT_x);
}
...would instantly re-equip an item.  A conversation could also be initiated by this event.

Don't forget about tagging NPC's personal possessions as undroppable.


If it's undroppable would the conversation still be triggerable?
               
               

               
            

Legacy_LoA_Tristan

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #4 on: February 01, 2013, 02:59:55 am »


               

NineCoronas2021 wrote...
If it's undroppable would the conversation still be triggerable?

As long as the creature's OnDisturb event fires you can script it to start a conversation, but I can't remember if trying to remove an undroppable item fires it.  Shouldn't be hard to test if you have a henchman set up already...
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #5 on: February 01, 2013, 03:37:20 am »


               Oh, you're one of THOSE people. Willing to search, huh? Nice. '<img'>

Two pieces of advice.

First, the forum search tool is terrible. I don't know why, but it rarely yeilds anything useful, especially as compared to the old boards.

Second, get the Omnibus, by OldTimeRadio. It's stupid useful:
Teh Grate and Powrful Omneybuss

You'll save yourself a ton of time. I've been coding NWN for...yeesh, going on 9 years, and I still use it a lot.

Funky
               
               

               


                     Modifié par FunkySwerve, 01 février 2013 - 03:38 .
                     
                  


            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #6 on: February 02, 2013, 03:28:45 am »


               Thanks Funky! Apparently I already have the Omnibus.

1) I'm about to embark on creating a custom death system. For some reason, I can't find the thread that mentioned this before, but apparently it is possible to have a system where instead of dying, your henchman are knocked out. Is it also possible for you, the player to "knocked out" while your henchman fight on, and if they survive, then you get back up?

I'm looking for something similar to how it was done in DO:A.

If that is not possible, how does one go about having henchman leave corpses that are raisable when they die? I seem to remember this being the case in HotU.

Is there anything on the vault similar to what I'm looking to do? I understand there is a module, but reading other people's code confuses me very, very quickly when it isn't commented and formatted well (not sure how that particular modulescores on that, whose name I cannot for the life of me remember! >'<img'> )

2) How would one go about clearing a room (not a whole area) of all hostile creatures?

3) Conversely, can someone point me in the right direction to creating a rest system similar to Baldur's Gate, where if you rest in a hostile area there is a chance (preferably a scaleable chance) of being attacked in your sleep? xD
               
               

               


                     Modifié par NineCoronas2021, 02 février 2013 - 03:31 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #7 on: February 02, 2013, 03:58:56 am »


               2: use a trigger in the room. Then either store the creatures that entered the trigger to get later or use GetFirstInPersistentObject().

3 is used in HotU.
               
               

               
            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #8 on: February 02, 2013, 04:03:21 am »


               

Squatting Monk wrote...

2: use a trigger in the room. Then either store the creatures that entered the trigger to get later or use GetFirstInPersistentObject().


That would work, yes, however I need it be centered around wherever the PC dies. <.<

Could a perception event be called, or something?

4) Is it possible to give an NPC an immunity to a specific effect via scripting, such as Blindness?
               
               

               


                     Modifié par NineCoronas2021, 02 février 2013 - 04:08 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #9 on: February 02, 2013, 05:28:29 am »


               Here's the immunities that can be conferred via scripting. You can implement them like so:

EffectImmunity(IMMUNITY_TYPE_BLINDNESS);

               
               

               


                     Modifié par Squatting Monk, 02 février 2013 - 05:29 .
                     
                  


            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #10 on: February 04, 2013, 03:25:37 am »


               Thanks SM!

I want to FadeToBlack (FadeFromBlack also) upon death, will ActionDoCommand work?
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #11 on: February 04, 2013, 06:11:58 am »


               It will, but you have to assign it with AssignCommand(). See the Lexicon for details.
               
               

               
            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #12 on: February 04, 2013, 05:04:54 pm »


               So AssignCommand(ActionDoCommand(restofscriptfollows));?
               
               

               


                     Modifié par NineCoronas2021, 04 février 2013 - 05:32 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #13 on: February 04, 2013, 05:18:23 pm »


               Nine -

AssignCommand(oCommanded, ActionDoCommand(FunctionFoo()) );

You would define all the code to be executed from oCommanded's action queue in a function named (in this case) FunctionFoo()

in other words, wrap up that rest-of-script you mention in a function and call it with an ActionDoCommand


-edit-

alterantively if you do NOT want the code to execute from the action queue but rather to execute immediately

AssignCommand(oCommanded, FunctionFoo() );

In both cases the code executes on the oCommanded object, rather than on the object running the script which calls AssignCommand
               
               

               


                     Modifié par henesua, 04 février 2013 - 05:25 .
                     
                  


            

Legacy_JediMindTrix

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +0/-0
A Mass of Questions from NineCoronas
« Reply #14 on: February 04, 2013, 05:33:02 pm »


               

henesua wrote...

alterantively if you do NOT want the code to execute from the action queue but rather to execute immediately

AssignCommand(oCommanded, FunctionFoo() );

In both cases the code executes on the oCommanded object, rather than on the object running the script which calls AssignCommand


Thanks Henesua!

Another question:

    if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
    {
        /*  Georg, August 11, 2003
            Added this code to allow the designer to specify a variable on the module
            Instead of using a OnAreaEnter script. Nice new toolset feature!
            Basically, the first time a player rests, the area is scanned for the
            encounter table string and will set it up.
        */
        object oArea = GetArea (oPC);

        string sTable = GetLocalString(oArea,"X2_WM_ENCOUNTERTABLE") ;
        if (sTable != "" )
        {
            int nDoors = GetLocalInt(oArea,"X2_WM_AREA_USEDOORS");
            int nDC = GetLocalInt(oArea,"X2_WM_AREA_LISTENCHECK");
            WMSetAreaTable(oArea,sTable,nDoors,nDC);

            //remove string to indicate we are set up
            DeleteLocalString(oArea,"X2_WM_ENCOUNTERTABLE");
        }


I'm trying to understand this, it says a variable is specified on the module, but only area's are called. Is this erroneous?


EDIT:

Also, this line:

GetFirstObjectInShape(SHAPE_SPHERE, 17, oPlayer, TRUE);


Continues to give me a "Declaration doesn't match parameters".

GetFirstObjectInShape(SHAPE_SPHERE, 17, oPlayer, TRUE, OBJECT_TYPE_CREATURE);


doesn't work either. oPlayer has already been defined by GetLastPlayedDied();.


EDIT EDIT
I figured out it was looking for a location and not an object, so I added

location lPlayerDeath = GetLocation(oPlayer);
and placed lPlayerDeath in where oPlayer was previously and it compiled, still not sure it will work though.
               
               

               


                     Modifié par NineCoronas2021, 04 février 2013 - 06:10 .