Author Topic: Wish spell, can it really be done.  (Read 766 times)

Legacy_omen_shepperd

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Wish spell, can it really be done.
« on: November 15, 2010, 12:31:53 am »


               As I am building my PW one
of the people who intend on playing on it asked me if I had created
the wish spell for the server. I quickly replied that as far as I
know the only way to truly create a wish spell in nwn could only be
done via having a dm listen to each players wish and decide if it was
worded correctly enough to grant the person there wish. I also
explained I could create a limited wish spell that would allow
players to choose which effect from the limited wish they wanted from
a list in the form of a npc’s conversation. Personally IMO wish
spell could quickly unbalance the game unless used in the limited
form. I wanted to get the community take on said spell’s and if
someone could think of a way to balance the wish spell without
turning it into limited wish.
               
               

               
            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #1 on: November 15, 2010, 01:00:54 am »


               I know ArgentumRegio makes use of the Wish Spell...maybe ask them?
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #2 on: November 15, 2010, 01:08:52 am »


               If you have the Baldur's Gate II expansion Throne of Bhaal and Near Infinity you can check out how they implemented the Wish spell.



'Posted



-420
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #3 on: November 15, 2010, 07:22:58 am »


               Planescape: Torment had a pretty cool Wish spell as well. It was a one-off, on a secret, which is pretty much the only way you could implement it on a pw short of making it require a component which is a one-off (or just limited to a small set number per player). Here's a list of the options it had (from a random website I searched up):


Ancient Scroll
The Ancient Scroll is inside the Carceri Warehouse, hidden among some boards (x=396, y=286). You can use it if you are at least level 12 as a mage, here is the list of wishes you can have the scroll grant you:
1. Increase attributes: Increases any stat you choose by 2.
2. An item of power: Creates a Ring of Thex (+20 HP, +4 AC, +2 to all saving throws, only usable by mages).
3. Wealth: Gain 10000 copper commons.
4. Full health for party: Fully heals all party members.
5. Arcane knowledge: Creates 1 scroll of stygian ice storm, 1 scroll of meteor storm bombardment and 1 scroll of power word: kill.
You can only choose one of these wishes, after that, the scroll will disappear. I always go for the increase attributes wish, but I suppose getting the ring would also be a good choice.



Funky
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #4 on: November 15, 2010, 06:08:02 pm »


               

FunkySwerve wrote...

I always go for the increase attributes wish, but I suppose getting the ring would also be a good choice.

Wouldn't it be better to get the scrolls so you can add those spells to your spellbook?

-420
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #5 on: November 15, 2010, 08:03:16 pm »


               That was quoted from the website - hence the different font in the codequote.



Funky
               
               

               
            

Legacy_omen_shepperd

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #6 on: November 16, 2010, 05:54:28 pm »


               I went and dug up my 3.0 players handbook out of the basement. After looking over the spell I think I can script something up for it. If I can get it working I will post it to the vault.
               
               

               
            

Legacy_CheeseshireCat

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #7 on: November 22, 2010, 08:36:06 pm »


               I think something akin to the wish spell in Ragnarok Rogue-like could be possible.

I don't recall too well what it could do, but you could wish for items, stats, and lots of other stuff...

ADOM has wish interpreter, too...

So I'd script a wish as creating a listener that'd then parse what was said the best it could. Of course, it could also "steal", not just *create* the items wished for '<img'>

It also would allow for rather invisible way to update the wish engine.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #8 on: November 24, 2010, 04:22:02 pm »


               With things like onPlayerChat and some creative scripting, it is entirely possible to create a Wish spell which listens to what the player wants, and give it to them.



Not saying its going to be easy, but it can be a simple matter of parsing a chat phrase, to find out what the wish actually is.



I want to be **blah blah blah**

I want a **blah blah blah**

I wish for a **blah blah blah**

I wish to be **blah blah blah**



Obviously, not all situations can be covered, but it can provide you wish a frame work with a view to a very powerful system.



eg

I wish to be a Real Boy    -  The system removes "I wish to be" from the chat phrase, and reads the remainder as "a Real Boy", and then some string searching, or database searching can be done to find out if the phrase "a Real Boy" has an action associated with it.



Adding Database functionality to this would improve the overall power of it, allowing wildcards and searching of functions.



eg

I wish for a    -  The user is wishing for an object

I wish to be   - The user is wishing to become something, or gain experience or something.

I want           - Maybe the same as 'I wish for a'

I want to be  - Maybe the same as 'I wish to be'

I want %object_name% to %action% -   eg - I want Gorag to Die



Really your creativity is the limit here, once you get the frame work in place, it would be litterally limitlessly expandable.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #9 on: November 24, 2010, 04:55:50 pm »


               Note - while thinking on the subject of this,

If you use a treasure chest system, you could

1. On ModLoad - iterate through all your modules treasure, capture resref/tag/item name, save to a mySQL Database.

2. Then, when making a wish.



say "I wish for a Diamond Ring"

the object being wished for could then be trimmed down to

"Diamond Ring"



the mySQL Query is then

"select resref from module_items where item_name like '%Diamond Ring%'"



This returns the resref of the item you are wishing for, assuming it exists in your treasure system, and then you can either do



Object Exists =  Your Wish is my command  (CreateObjectOnItem())

Object does not exist = Your wish is impossible!!   (Fizzle out)







I wish for an item with %property% - You could also have your onModLoad function save item properties to the database for searching too.



Result would be like

select propnum from item_props where property_name like '%vampiric regeneration%' order rand limit 1



Of course, this will require you to make use of an include file from the vault, which allows the transformation of itemproperties into numeric values, and back again.



The value you could get back from the query would be like

-443466322

itemproperty iProp = ipNumberToIP(-443466322);



etc
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #10 on: November 24, 2010, 05:16:36 pm »


               You could just state that the wish takes time to meterlize.  Then log the Wish to a DB along with the PlayerNmae/AccountName and have the Server staff look at the DB once a week/month and handle the results.  Of course this would not work for a SP game.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #11 on: November 25, 2010, 09:14:19 am »


               True,

But more functionality is possible via nwnx, in multiplayer, which would support the idea of developing such a thing in a multiplayer environment.



The above being said, I do think that the onModLoad event may error out if you were to impliment a loop of 'EVERY' item in your treasure system, if it is hundreds and hundreds of items, the loop will eventually generate a Too Many Instructions error.



Ways to resolve this, is to work in batches.

Kick of a pseudo hb, that processes 20 items per hb etc
               
               

               
            

Legacy_CheeseshireCat

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #12 on: November 27, 2010, 06:42:26 am »


               What is the "Too Many Instructions" error threshold, by the by? I had it happen on a loop of less than ten objects, which was just replacing with them different ones and transferrign two properties over.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #13 on: November 27, 2010, 07:36:35 am »


               It is what it is, if you have there enless loop, it will after some time (5000+ loops, +-) threw this error. An experienced scripter can sometimes walk into it even with some long script, or with two delays but otherwise functional. Because its just a safety mechanism, as was pretended that nobody reach that instruction limit. But sometimes happen. There are multiple ways to to workaround this and one way to raise the limit.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Wish spell, can it really be done.
« Reply #14 on: November 27, 2010, 08:01:39 pm »


               

CheeseshireCat wrote...

What is the "Too Many Instructions" error threshold, by the by? I had it happen on a loop of less than ten objects, which was just replacing with them different ones and transferrign two properties over.


Taken from an old post of mine on the old bioboards, with minor edits:

The guideline for this is called the 20K rule, because
in hexadecimal the limit is  0x020000 bytecode instructions. This
translates to 131,072 instructions. While I've never seen the exact
counts for instructions per function, you can assume that each function
uses AT LEAST one, probably more, bytecode instructions. This is another
arbitrarily set limit, put in place to prevent incorrectly written
scripts from endlessly looping. This is simply
what Bioware chose arbitrarily, and not any sort of indication what is
wise - though of course, you still shouldn't use more instructions than
necessary to accomplish your goal. There are a couple of ways to get
around this error, as well. The common scripted ways are to execute the
code using AssignCommand, DelayCommand, or in another event, with
SignalEvent. Or, you can simply raise the limit temporarily or
permanently with the nwnx_tmi plugin (written by acaos), which is my
preferred method, now, since it involves less hassle. The scripted
methods force an unnatural compartmentalization of scripts that would be
easier to read and work with whole.

Funky