Jump to content


Photo

Adding items to the world, maybe as quest rewards?


5 replies to this topic

#1 subtledoctor

subtledoctor
  • Modders
  • 1903 posts
  • Gender:Male

Posted 27 December 2016 - 07:02 AM

I'm in the process of adding learnable bard songs to the game, and it is pushing me into areas I am not used to. I know how to add stuff to stores, but I think it would be cool to give (some of) them as quest rewards. Like, a special Mirror Image song to be given at the end of the Astral Prison quest. Any suggestions? I'm looking for a combination of easy and cool.

I suppose I could just add it to the Demon Knight... it would just drop as loot then, right?

But it might be more interesting to pop it into the player's (or Haer'Dalis') inventory during the conversation with Raelis. Is that difficult? (Is the answer "go look at the Branwen mod?")

I have an undead-related song that I think should go on a corpse under the Athkatla sewers - the leavings of a failed adventurer, like you sometimes find in IWD. How do I identify a loot pile (I guess it's technically a container?) in an area, and add an item to it?

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#2 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 5854 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 27 December 2016 - 07:44 AM

How do I identify a loot pile (I guess it's technically a container?) in an area, and add an item to it?

The old approach is to take a look up the container name in Near Infinity, and use the area script for example to add it in, the container name is "Chest 7" in Near Infinity in this example, and the area is the first SoA dungeon, .tp2 code:
		EXTEND_BOTTOM ~ar0602.bcs~ ~Impilation/Item/AR0602.baf~
.baf code:
IF
  Global("IJ#BAC9","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobal("IJ#BAC9","GLOBAL",1)
    ActionOverride("Chest 7",CreateItem("IJ#brac9",0,0,0)) 
END

I suppose I could just add it to the Demon Knight... it would just drop as loot then, right?

Yeah that's right. It also done easily by just copying the char and ADD_CRE_ITEM -macro.

To add the item to a container, you could copy the .are -file and add the item bitwise... and make a horrible mess out of it if it fails to account any resource. :devlook:
Of course weidu also has a ADD_AREA_ITEM macro/patch function, that has container_to_add_to -variable, which is far less likely to fail than just the bitwise added resource.
 
To add items to the rewards, you just need to edit the dialog file of the quest... which is not where my expertise lies.

Edited by Jarno Mikkola, 27 December 2016 - 08:52 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.

Here's how to install all the stable mods you ever really could want to Infinity Engine games.


#3 Roxanne

Roxanne
  • Modders
  • 1002 posts
  • Gender:Not Telling

Posted 27 December 2016 - 08:39 AM

But it might be more interesting to pop it into the player's (or Haer'Dalis') inventory during the conversation with Raelis. Is that difficult?

Maybe here? (Original dialogue)

~A reward for your troubles... and then my troupe and I must return home. There is little else to keep us here. We shall wait until you depart.~

__________________________________________________

Create a file raelisadd.d with any of those options

 

Spoiler

 

In your tp2   Have a

COMPILE ~Mymod/dialogues/raelisadd.d~

__________________________________________________________________

 

I suppose I could just add it to the Demon Knight... it would just drop as loot then, right?

In your tp2

 

COPY_EXISTING ~pwarden.cre~ ~override~
ADD_CRE_ITEM ~MyItem~ #0 #0 #0 ~IDENTIFIED~ ~inv11~


Edited by Roxanne, 27 December 2016 - 09:30 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#4 agb1

agb1
  • Modders
  • 410 posts
  • Gender:Male

Posted 27 December 2016 - 09:14 AM

Typo in second example: Raelis, vs Realis

If MyItem has charges, and you want it to be usable immediately, change the first #0 to #numofcharges.

BiG World Fixpack (community collection of mod fixes and compatibility patches, with user-friendly cross-platform script)

 

BiG World Setup (tool to automate best-practice installation of Infinity Engine mods on Windows, with conflict analysis)

Latest version:    https://bitbucket.or.../get/master.zip


#5 subtledoctor

subtledoctor
  • Modders
  • 1903 posts
  • Gender:Male

Posted 27 December 2016 - 09:44 AM

It's functionally like a spell scroll: single-use, then it disappears.  I copied a scroll and edited it to remove the Learn Spell ability and keep the 'use from quickslot' ability.  Do scrolls have charges?

 

@Roxanne thank you!  I have just coded up a version that adds it to the demon knight, then saw this, and adding it to Raelis does seem easy.  I'm always terrified of doing stuff like that - when my little mods have bugs they tend to only produce a bit of weird text, or an item that misfires or something.  But when mods have bugs that affect major NPCs, that can be game-stopping.  So I have always steered clear of this kind of thing.  But, that seems manageable.


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#6 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 5854 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 27 December 2016 - 10:12 AM

Do scrolls have charges?

Check what happens in a EE game, when you use this:

C:CreateItem("MyItem",5,0,0)

And if you don't have a EE game, just replace the first C: with CLUAConsole: ...

So in a sense yes.

But the difference between #0 and #1 should be negligee-able in your item. Now, were it a wand of fireball, there would be a difference between #0 and #30.


Edited by Jarno Mikkola, 27 December 2016 - 10:13 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.

Here's how to install all the stable mods you ever really could want to Infinity Engine games.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users