Jump to content

GiveItemCreate - object targeting difference (BGEE vs. IWDEE)


Recommended Posts

The Script Actions page doesn't really go into detail on this. When using GiveItemCreate and targeting a specific actor (ex. "Minsc"):

  • BGEE games: It needs to target the script name/death variable on the CRE file
  • IWDEE: It needs to target the actor name in the ARE file

UPDATE: kjeron notes in the next post that in IWDEE, all or most creatures stored in ARE files have a flag set to use their actor name over their script name. This explains why certain script actions like GiveItemCreate may need to be used differently in IWDEE if targeting an existing actor in an ARE file.

 

As an example:

This action adds an item to an enemy in BG2EE:
GiveItemCreate("d2wkzm7","Dragblac",0,0,0)

This action adds an item to an enemy in IWDEE:
GiveItemCreate("d2wkzm7","Icasaracht",0,0,0)

In BG2EE, it uses the script name, "Dragblac". The actor name, "Black Dragon" or "BlackDragon", doesn't work.
In IWDEE, it uses the actor name, "Icasaracht". The script name, "Icasa", doesn't work.

 

I haven't done in-game testing with the classic versions, but looking at the scripts in Near Infinity, they work the same way. For IWD1, it uses the actor name. For BG2, it uses the script name. 

In classic IWD1 and IWD2, some scripts use GiveItemCreate to target a container in the ARE file. I tested in IWDEE and this one doesn't seem to work (these script blocks were removed from the EE version). For EEs (as well as classic), you can do an ActionOverride on the container name, and use CreateItem to add an item.

Edited by Dan_P
Link to comment

Icasaracht's actor entry in area AR9604 is specifically flagged to "Override Script name (BIT3)", which is done with the "Actor Name" field.

It's very likely most if not all area actors in IWDEE have this flag set.

If you were to create the creature new from the console, it would accept it's script name from the CRE file.

Link to comment
3 minutes ago, kjeron said:

Icasaracht's actor entry in area AR9604 is specifically flagged to "Override Script name (BIT3)", which is done with the "Actor Name" field.

It's very likely most if not all area actors in IWDEE have this flag set.

If you were to create the creature new from the console, it would accept it's script name from the CRE file.

 

Thanks. That explains the difference for this. Looks like pretty much every creature in IWD has this flag set, as you said. I don't see this flag in classic IWD (in Near Infinity), so must be added with the EE.

Something useful to keep in mind for anyone looking to use GiveItemCreate on existing creatures in IWDEE vs. in the BGEE games.

Link to comment
6 minutes ago, Dan_P said:

Thanks. That explains the difference for this. Looks like pretty much every creature in IWD has this flag set, as you said. I don't see this flag in classic IWD (in Near Infinity), so must be added with the EE.

oIWD just works like this by default, which is why IWDEE uses the flag. oIWD Icasaracht (icasa.cre) sets 'icasa' as the script name in the creature file, but all the scripts target her with "icasaracht" which is her value in the actor listing.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...