Jump to content

weidu help for newb modder with item and script issue


smeagolheart

Recommended Posts

I have an item, in this case I'm making magic tomes. I want when player X uses it (single use item) to call a script in baldur.bcs.

 

Using near infinity, I think I need to create a spell or something that activates when I use the item?

 

I did look around for tutorials and couldn't find exactly what I was looking for, any ideas? Looking at the game it seems like maybe the figurines are doing something similar to what I need although I'm not entirely sure because it seems they are destroyed and replaced by something else? The "Complete Scripting Guide" mentions this : "The appropriate blocks in the script can be activated from the item by setting a variable". That would work : how do I set a variable after using an item?

 

This is my first Weidu mod, so I only think I kinda know what I'm doing and I'm learning.

Link to comment

You don't need to use a spell. You can simply give the item a magical ability and add the effect there. The effect you want is #265 (Script: Modify Global Variable).

 

If you make your item set the variable MYITEMACTIVATED to 1, here is an example script block that would make your item only usable once:

IF
 Global("MYBLOCKTRIGGERED","GLOBAL",0)
 Global("MYITEMACTIVATED","GLOBAL",1)
THEN
RESPONSE #100
 // do main script actions here
 SetGlobal("MYBLOCKTRIGGERED","GLOBAL",1)
END

The MYBLOCKTRIGGERED variable prevents the script from triggering more than once. You should replace these stupid variable names with your own that use your modder prefix.

 

An example item and script that do something like this in the vanilla game are MISCA5.ITM and AR2100.BCS, which enable activation of the Stoneshape scroll in the Underdark.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...