Aller au contenu

Photo

Trying to create an item (rod) I can Activate and run a script


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

I'm attempting to create a custom rod (but it could be anything really) that the user can right-click and select "Activate" from the item's menu. Activating the item would then run the tag-based script I've written, which toggles a global variable. 

 

This is meant to be a simple way for the player to toggle something global to the game, to tailor it for their game experience. All the tag-based script does is set a Global Int. 

 

The problem is that I cannot get the "Activate" menu item to show up on the Rod. I just don't know how to do it. 

 

Anyone have any clues? 

 

I don't want to assign a spell to cast if I don't have to... 



#2
Darin

Darin
  • Members
  • 282 messages

Is it not showing up under the Properties menu of the rod?



#3
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Nevermind. As usual, two seconds after I post, I try another search and find the answer (http://www.nwn2tools...ng/lesson7.html)

 

There is a spell you can assign called "Unique Power Self Only" that makes the "Activate" menu item appear. 

 

Now to make the script work.. 



#4
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Worked like a charm. 



#5
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
I suggest you use an item specific activate script rather than a module activate script as described in that lesson though. Tag-based scripting is better than module based and more flexible. I have several items that use activation scripts. They are now available at my blog <http://bbellina.blog...tware-by.html>.

Regards

#6
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

It's a tag-based script Kaldor. I only referenced the tutorial because it mentions the item property that I didn't know existed (Unique Power On Self). 

 

I had all the bits figured out except for that property... couldn't figure out how to make an "Activate" menu item appear when you right-click the rod. 

 

Now that I know.. might have to throw a couple more items like this in the mod. 



#7
Dann-J

Dann-J
  • Members
  • 3 161 messages

I've used tag-based scripting to create a variety of unique weapon properties:

 

http://www.nexusmods...inter2/mods/255



#8
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Those are some pretty nifty changes DannJ.