Jump to content


Photo

Personalized items


  • Please log in to reply
30 replies to this topic

#1 Jerdol

Jerdol
  • Member
  • 26 posts

Posted 03 August 2004 - 05:46 AM

I'm working on an NPC Kensai who, like many kensais, learns to flow with a certain blade and become one with it in combat. His particular blade happens to be a family heirloom 6 generations old, and only those born to use this blade have the expertise to weild it. Unfortunately, there's currently nothing to stop <CHARNAME> from plucking it out of his hands and taking it for himself. My NPC will then be stuck with the dreaded Lilarcor.
How do I make a weapon usable by only a certain character?



Also, two other unrelated questions:
When I try to change an item description or biography, the program threatens to overwrite something in dialogue.tlk. Why is that, and how can I stop it?

How can I make an item irremovable?

#2 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 03 August 2004 - 05:54 AM

I'm working on an NPC Kensai who, like many kensais, learns to flow with a certain blade and become one with it in combat. His particular blade happens to be a family heirloom 6 generations old, and only those born to use this blade have the expertise to weild it. Unfortunately, there's currently nothing to stop <CHARNAME> from plucking it out of his hands and taking it for himself. My NPC will then be stuck with the dreaded Lilarcor.
How do I make a weapon usable by only a certain character?

You can't, at least not as BW does. What you can do is to flag it so that only Kensais may wield it, and to set the ability-requirements like the ones your character has. Example; if your NPC has 18/14/15/9/11/15, you set the minimum requirements to the same. Sure, an kensai PC with those stats or higher (all stats must be the same or higher) can use it, but it's better than nothing.

When I try to change an item description or biography, the program threatens to overwrite something in dialogue.tlk. Why is that, and how can I stop it?

You assign the decription and itemname with weidu in the .tp2. Do NOT do this with DLTCEP or NI. This information is not stored in the item-file, but in the dialog.tlk, which you update with weidu. Do like this:

COPY ~Folder\itemname.itm~ ~override\itemname.itm~
SAY NAME1 ~Name of the item~
SAY NAME2 ~The exact same as the previous line~
SAY UNIDENTIFIED_DESC ~Unidentified description~
SAY DESC ~Identified description~

How can I make an item irremovable?

By flagging the "Undroppable" flag of the item with NI. (Or DLTCEP).

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#3 Rabain

Rabain

    God

  • Member
  • 653 posts

Posted 06 August 2004 - 04:43 AM

You could probably also create a script that would remove the item from anyones inventory and place it back in your NPC's.

Add a note to the item description saying that if you attempt to take this item the NPC will take it back!

But this might be going overboard as the script would have to be in baldur.bcs to take effect in every area!

Or you could make the weapon undroppable and unmovable and place it in a weapon slot. You would lose this weapon slot then as you would not be able to place any other weapons there at all!
A knight without armour in a savage land...

#4 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 06 August 2004 - 11:40 AM

You can't, at least not as BW does. What you can do is to flag it so that only Kensais may wield it, and to set the ability-requirements like the ones your character has.


Actually, that's exactly how Bioware does it.

You could also put something in a script that causes the item to be unequipped if the character's name is not the name of your character.

You assign the decription and itemname with weidu in the .tp2. Do NOT do this with DLTCEP or NI.


Nothing wrong with adding the description with DLTCEP or NI. Just follow it up with WeiDU's --automate function. It'll work just fine.

Edited by Rastor, 06 August 2004 - 11:40 AM.

Home of Kitanya, Improved Asylum, more...

Posted Image

#5 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 06 August 2004 - 02:06 PM

You can't, at least not as BW does. What you can do is to flag it so that only Kensais may wield it, and to set the ability-requirements like the ones your character has.


Actually, that's exactly how Bioware does it.

You could also put something in a script that causes the item to be unequipped if the character's name is not the name of your character.

Come to think of it... They do it that way, don't they?

You assign the decription and itemname with weidu in the .tp2. Do NOT do this with DLTCEP or NI.


Nothing wrong with adding the description with DLTCEP or NI. Just follow it up with WeiDU's --automate function. It'll work just fine.

If you're going to use Weidu anyway, it's a lot easier to do it with weidu. No extra steps, just plain and simple coding...

And, I generally don't recommending updating the dialog.tlk with anything but weidu. Safest, smartest, simplest.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#6 igi

igi

    IESDP Guardian

  • Administrator
  • 1059 posts

Posted 07 August 2004 - 03:15 AM

It's perfectly safe to update dialog.tlk with other tools.

As for restricting an item usage, restricting by kit/class and stats isnt ideal, as stats can be drained.
It may be better to use IDS targetting, and set your item to only stay equipped for the right race/gender/general/etc, maybe even a specific.

Visit the IESDP


#7 hlidskialf

hlidskialf

    Incarnation of the Eternal Ale Warrior

  • Modder
  • 2510 posts

Posted 07 August 2004 - 03:35 AM

Indeed, other tools work just fine. As for keeping the items personalized, there was some hardcoding done for BG1 to arrange this. I happen to prefer adding a script block or two to the DPlayer scripts that force the illicit user to drop the item, return it, or suffer other "nasty" consequences. B)

The great wolf Fenrir gapes ever at the dwelling of the gods.


#8 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 07 August 2004 - 09:24 AM

Hrm, I think there are some other questions.

Is it really the job of the mod designer to enforce good roleplay here? Part of it is that I think the custom item is an overused plot device. If I'm an evil character, why shouldn't I have the option of killing Valygar for his armor?

If the item is so much better than the goodies floating around, then that item is perhaps cheese and should be avoided.

Of course, I'm breaking this rule myself in creating race-specific armor.

#9 Jerdol

Jerdol
  • Member
  • 26 posts

Posted 07 August 2004 - 01:09 PM

Or you could make the weapon undroppable and unmovable and place it in a weapon slot.

I was actually doing that anyways, and it completely slipped my mind that I therfore wouldn't need personalization. Thanks anyways, though.

#10 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 29 September 2004 - 03:39 PM

Could someone post a sample of this "equip weapon and nasty things happen" code? I, too, have some weapons that I wish to limit to my NPC. They are good weapons, very good weapons, but not so good that you might not want to give her others after you've gotten a bit of gold. On the other hand, though she might use other weapons, she would never accept anyone ELSE using hers. She would leave your party over it, even. So, umm, could someone help? I currently have them scripted to match her race/class/stat combination, but, as was mentioned before, what happens if she gets stat-drained?

Sillara
Check out my RPG forum!

#11 seanas

seanas
  • Modder
  • 1906 posts

Posted 29 September 2004 - 03:56 PM

Sola and Chloe both do this. Sola has the following block as part of solablad.baf (the other part of solablad.baf is for the upgraded version of the weapon) which gets added to baldur.bcs:

IF
  Delay(6)
  OR(6)
    HasItemEquiped("solablad",Player1)
    HasItemEquiped("solablad",Player2)
    HasItemEquiped("solablad",Player3)
    HasItemEquiped("solablad",Player4)
    HasItemEquiped("solablad",Player5)
    HasItemEquiped("solablad",Player6)
  !HasItemEquiped("solablad","sola")  // ~Sola~
  !HasItemEquiped("solablad","solaufein")  // solaufein
THEN
  RESPONSE #100
    DisplayStringHeadOwner("solablad",115130)  // ~Eilistraee has taken back the Moonblade. It was for Solaufein only.~
    TakePartyItem("solablad")
END

and then, from the .tp2:
EXTEND_TOP      ~baldur.bcs~ ~solarom/solablad.baf~

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||


#12 Awake

Awake
  • Member
  • 685 posts

Posted 29 September 2004 - 04:12 PM

this explains why i spent all that time looking at the NPC item files looking for something significant and couldn't find it. Sorry for sounding stupid, but in that

DisplayStringHeadOwner("solablad",115130)


what is the 115130? And would it need to be different for my weapon?

another possibly stupid question, actually, i'm sure it's stupid, but i don't know. can i attatch a script to a weapon? and how?
Black Wyrm Forums host of the World Transition Project, Beastial Animations, and much more!

And the raven, never flitting, still is sitting, still is sitting
On the pallid bust of Pallas just above my chamber door;
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor;
And my soul from out that shadow that lies floating on the floor
Shall be lifted - nevermore!


Like dealing with terrorists by giving them explosives. -NotMrT

If you don't know where you're going, any road will take you there.

#13 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 29 September 2004 - 04:20 PM

DisplayStringHeadOwner("solablad",115130)  // ~Eilistraee has taken back the Moonblade. It was for Solaufein only.~


The number is the text string that is displayed. In this case, the text is commented out (after the //) after the command, so you can see what it is.

The base format of the command is:

DisplayStringHeadOwner("itemname",string-to-display)

Edited by Stone Wolf, 29 September 2004 - 04:23 PM.


#14 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 29 September 2004 - 04:21 PM

115130 is the string.

And you attach the script to baldur.bcs.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#15 seanas

seanas
  • Modder
  • 1906 posts

Posted 29 September 2004 - 04:28 PM

Dakkon's Streaming Blade (added in Tortured Souls) has a script attached to it (so that it upgrades itself automatically). One of the equipping effects is

Set AI Script [82] (0x0 0x0) DAKKON2

with Target= Self and Timing= While Equipped.

With this equipping effect, the script DAKKON2 becomes the override script for the character equipping the weapon.

Edited by seanas, 29 September 2004 - 04:28 PM.

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||


#16 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11148 posts

Posted 29 September 2004 - 04:33 PM

I hope you mean the class-script, seanas. Overwriting the override-script is not what I would call a wise move. ;)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#17 seanas

seanas
  • Modder
  • 1906 posts

Posted 29 September 2004 - 04:37 PM

no, i mean the override script. the class-script is where an assignable character script gets, err, assigned.

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||


#18 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 29 September 2004 - 04:37 PM

Umm, isn't Set AI script kinda permanent? If so, putting a script in the override slot would kill the personalized script of any NPC that uses the item. What am I missing here?

#19 seanas

seanas
  • Modder
  • 1906 posts

Posted 29 September 2004 - 04:41 PM

no, i mean the override script. the class-script is where an assignable character script gets, err, assigned.

[EDIT] although now you mention it, i've never given that weapon to anyone other than CHARNAME. i'll have to try, and see what happens... it mightn't be pretty!

[EDIT] crap. double-posting badness.

Edited by seanas, 29 September 2004 - 04:42 PM.

"A simple test of the relative merits of science and religion is to compare lighting your house at night by prayer or electricity" - A. C. Grayling
"EFF files have saves, too." - CamDawg
|| this is radio seanas || BP Series v3 || seanas at work ||


#20 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 29 September 2004 - 04:47 PM

Heh, you got asked the same question twice, so it doesn't really look like a double post. ;)

Just to clarify, I was under the impression that the Assign Script effect changed the cre file (in the saved game only) to have the assigned script in the slot specified by the parameter value. I've also read that it's a permanently change, and it won't revert back to "normal" after the item is removed or the spell expires. If that's the case, then whatever script is in the override slot is de-assigned (pretty sure that's not a word, but screw it). Most (all?) NPCs have their personal script in that slot, and that's the script that controls romances, quests for the NPC, etc. Unless Assign Script attaches a script to a character without using a slot, it could essentially nuke the character.

Edited by Stone Wolf, 29 September 2004 - 04:52 PM.