OK I can create an item and put it in the inventory - How can I now get it to run a script when activated , a bit like a rings in Baldors Gate.
Ivw banged my head against the wall all day - Tried the Script field - Never gets called - At a total loss
Thanks in advance
Please help a newbe
Débuté par
nn125
, déc. 02 2009 09:38
#1
Posté 02 décembre 2009 - 09:38
#2
Posté 03 décembre 2009 - 01:05
I think the best way is probably to add an entry to the ABI_base 2da essentially adding a new ability for your item. That ability can reference your script file and do pretty much whatever you want. Have a look at the entry for Kolgrim's Horn for an example.
I haven't tried doing it with items yet, but I've added new talents and spells to the game by modifying 2das.
http://social.biowar...t/index.php/2DA
I haven't tried doing it with items yet, but I've added new talents and spells to the game by modifying 2das.
http://social.biowar...t/index.php/2DA
#3
Posté 03 décembre 2009 - 11:26
OK done that (I think) - How do I give it to the hero
Unique ID - 1304 - GDA in single player overide directory
Do I need to make a corisponding Item in the toolset If i do, how do I connect them together
What do I put in the UT_AddItemToInventory if I use this function
Unique ID - 1304 - GDA in single player overide directory
Do I need to make a corisponding Item in the toolset If i do, how do I connect them together
What do I put in the UT_AddItemToInventory if I use this function
#4
Posté 03 décembre 2009 - 12:49
once the GDA is in the override directory - restart the toolset - then you should have the new item-ability in your drop-downlist
now you just need to check for that ability in your item-script.
now you just need to check for that ability in your item-script.
#5
Posté 03 décembre 2009 - 01:12
Brilliant, thanks - It works!!!!!
A seperate question - This item when clicks gives a floaty no location info, etc, How do I get the Area ID
The GetName gived the full text name
Ive tried the GetAreaId, both with a Hero Object and Area object, both time the toolbox complains that incorrect parameters, Ive seached all the include files and the Wiki without any success for the paramater id's
Thank's in advance
A seperate question - This item when clicks gives a floaty no location info, etc, How do I get the Area ID
The GetName gived the full text name
Ive tried the GetAreaId, both with a Hero Object and Area object, both time the toolbox complains that incorrect parameters, Ive seached all the include files and the Wiki without any success for the paramater id's
Thank's in advance
#6
Posté 03 décembre 2009 - 01:30
Steps
1) Create an ability in a M2DA that will add to ABI_Base.GDA. Two fields are especially important. ID needs to be unique. Spellscript needs a name for a script you'll create later in the toolset. Name it something you'll remember.
2) Convert to a GDA and copy to an override directory so the toolset can see it like\\packages\\core\\override.
3) Start the toolset. Create an item and assign as it's ability the ability you created in step 1.
4) Create the script the ability references. Item_unique_power.nss is a good template to work from, Some things to consider.
If the item is expected to be permanent, then increase the stack count in the EVENT_TYPE_SPELLSCRIPT_PENDING case. The is a auto-decrement on the stack count deeper in the code.
EVENT_TYPE_SPELLSCRIPT_IMPACT is where you the effects should be scripted.
6) Add a module script to grant the item to your character.
1) Create an ability in a M2DA that will add to ABI_Base.GDA. Two fields are especially important. ID needs to be unique. Spellscript needs a name for a script you'll create later in the toolset. Name it something you'll remember.
2) Convert to a GDA and copy to an override directory so the toolset can see it like
3) Start the toolset. Create an item and assign as it's ability the ability you created in step 1.
4) Create the script the ability references. Item_unique_power.nss is a good template to work from, Some things to consider.
If the item is expected to be permanent, then increase the stack count in the EVENT_TYPE_SPELLSCRIPT_PENDING case. The is a auto-decrement on the stack count deeper in the code.
EVENT_TYPE_SPELLSCRIPT_IMPACT is where you the effects should be scripted.
6) Add a module script to grant the item to your character.
#7
Posté 03 décembre 2009 - 01:38
Thanks for all the help
Do you know the parameters for
GetAreaId()
I thought it would be an area object (how wrong) - Looked through the Include files and Wiki and can't find it
Thanks in advance
Do you know the parameters for
GetAreaId()
I thought it would be an area object (how wrong) - Looked through the Include files and Wiki and can't find it
Thanks in advance
#8
Posté 03 décembre 2009 - 05:16
There is a GetArea( object ) call -- is that the one you are looking for? There is also GetAreaFromLocation( location )





Retour en haut






