Author Topic: ADD_CRE_ITEM (feature request)  (Read 2748 times)

Offline aigleborgne

  • Planewalker
  • *****
  • Posts: 106
ADD_CRE_ITEM (feature request)
« on: December 23, 2005, 06:54:44 AM »
Hello,

I'm learning WEIDU and I was wondering if there is a function to replace an item.
Something like, REPLACE_CRE_ITEM
example of that command:
REPLACE_CRE_ITEM  ~rin95~  #0 #0 #0 ~undroppable~ ~LRING~
the old left ring would be unassigned (it doesn't need to be deleted if it too difficult to code)

To give an example:
 ADD_STORE_ITEM + ~_wand10~ #5 #0 #0 ~IDENTIFIED~ #1 // wand of summoning

This first line actually modify the entry, this is a good thing when you only want to modifiy the number of arrows on a quiver slot (in a cre)
ADD_CRE_ITEM will do the job but it will also put the old arrows in inventory, which means unwanted droppable stuff.

Or just having a parameter to ADD_CRE_ITEM to prevent reallocation of old items in another slot (inventory or so)
« Last Edit: February 09, 2006, 08:22:11 AM by aigleborgne »

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #1 on: December 23, 2005, 07:01:22 AM »
I could code that, for ex. via
ADD_CRE_ITEM + ~rin95~  #0 #0 #0 ~undroppable~ ~LRING~
(for similarity with ADD_STORE_ITEM).
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline aigleborgne

  • Planewalker
  • *****
  • Posts: 106
Re: ADD_CRE_ITEM
« Reply #2 on: December 23, 2005, 08:10:38 AM »
I have tried that too, but this doesn't work. I actually get a parse error 'invalid parameter'

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #3 on: December 23, 2005, 08:16:05 AM »
I have tried that too, but this doesn't work. I actually get a parse error 'invalid parameter'
No, I mean that I can code said possibility in the weidu source, so that tp2s can use that  :

However I think I'll go with REPLACE_ITEM ~olditem~ ~newitem~, which will replace on the current creature all olditem with newitem. Also REPLACE_ITEM_OR_ADD ~newitem~ ~olditem~ list_of_parameters, which will do REPLACE_ITEM ~olditem~ ~newitem~, or process ADD_CRE_IEM ~newitem~ list_of_parameters if not changed.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: ADD_CRE_ITEM
« Reply #4 on: December 23, 2005, 10:21:09 AM »
I think REPLACE_TEXTUALLY ~olditem~ ~newitem~ works in this case--at least, I am pretty sure I've done it at some point.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: ADD_CRE_ITEM
« Reply #5 on: December 23, 2005, 10:32:11 AM »
Yes, I've always used REPLACE_TEXTUALLY quite liberally, but it falls down when the two filenames have different lengths. (Short of silly ASCII hacks.)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #6 on: December 23, 2005, 11:35:32 AM »
If you prefer more general approachs, I can do REPLACE_TEXTUALLY_LENGHT 8 ~oldstring~ ~newstring~, which is like REPLACE_TEXTUALLY, but pads the two strings to be zero-terminated (EG, REPLACE_TEXTUALLY ~abcd\0...~ ~dce\0\0\0\0~ (where \0 means nul == the character with ASCII 00 == the character which marks the end of a string, in this case a filename, in C/C++).
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: ADD_CRE_ITEM
« Reply #7 on: December 23, 2005, 12:12:25 PM »
I think that'd be pretty useful, yes.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: ADD_CRE_ITEM
« Reply #8 on: December 24, 2005, 09:18:38 AM »
Yup. That'd probably remove (most of?) the need for REPLACE_CRE_ITEM, then.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #9 on: December 24, 2005, 11:57:38 AM »
Will code tomorrow, I think.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Idobek

  • Dust Bunny
  • Planewalker
  • *****
  • Posts: 431
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #10 on: December 27, 2005, 06:45:40 AM »
Could we stick to an optional #x parameter for length, as is WRITE_ASCII, instead of adding a new command?
The Gibberlings Three Forums

<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #11 on: December 27, 2005, 06:47:57 AM »
I think so, thanks for the tip  :)
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline aigleborgne

  • Planewalker
  • *****
  • Posts: 106
Re: ADD_CRE_ITEM
« Reply #12 on: February 09, 2006, 08:21:30 AM »
Hello there,

Any news about this function/parameter?

Example:
ADD_CRE_ITEM + ~rndtr03~  #0 #0 #0 ~none~ ~INV2~   // Add a random treasure to inventory 2 and remove any item that was here before

Or

REPLACE_CRE_ITEM (...)

But I think the first one is simplier and enough.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: ADD_CRE_ITEM
« Reply #13 on: February 09, 2006, 08:23:31 AM »
REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~olditem~ ~newitem~ ( 8 )

ADD_CRE_ITEM + etc_etch_etc isn't there, yet.
« Last Edit: February 09, 2006, 08:25:08 AM by the bigg »
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: ADD_CRE_ITEM (feature request)
« Reply #14 on: February 09, 2006, 09:57:09 AM »
Don't use ADD_CRE_ITEM + as the syntax for replacing an item based on the occupied inventory slot, please.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: