DM wand?
#1
Posté 06 février 2011 - 12:41
When I activate the wand the message, [PC] uses item's powers, or something like that, but nothing happens.
I thought it would be easy to put an ActionStartConversation script into the tag based script but not so.
Is what I am aiming to do possible?
The reason I want to do it is to add functionality to my MP campaign as it progresses - I had hoped an item that fired a campaign conversation would allow this.
Cheers
#2
Posté 06 février 2011 - 01:38
#3
Posté 06 février 2011 - 05:06
What you are asking for can be done.
#4
Posté 06 février 2011 - 08:06
I am using the standard template for Item Activate:
void main()
{
object oDM = GetItemActivator();
object oItem = GetItemActivated();
object oTarget = GetItemActivatedTarget();
location lTarget = GetItemActivatedTargetLocation();
// Start the conv_dm_wand conversation
ActionStartConversation(oDM,"conv_dm_wand",TRUE,FALSE,TRUE,TRUE);
}
The item tag is dm_wand and the script is i_dm_wand_ac.
The item is created on a DM (only) that starts the campaign so there is no check for GetIsDM() in the one above. The creation of the item works successfully so I haven't posted the script here.
I have never used ItemEventNumber so I'm sure there will be some new things for me to learn there, too.
Edit: the event is called by the module's activate scripts so I am guessing I need to specify somehow who or what is starting the conversation. I assume DMs in visible or invisible mode can have private conversations (with themselves)?
Thanks for the help.
Cheers
Modifié par El Condoro, 06 février 2011 - 08:12 .
#5
Posté 06 février 2011 - 09:05
ActionStartConversation(oDM,"conv_dm_wand",TRUE,FALSE,TRUE,TRUE);
To this:
AssignCommand(oDM, ActionStartConversation(oDM,"conv_dm_wand",TRUE,FALSE,TRUE,TRUE));
Without assigning the command to oDM to begin the convo with themselves, they are trying to have a convo with the wand item (or rather to be more specific, in your original line the wand is being told to converse with oDM).
Modifié par _Knightmare_, 06 février 2011 - 09:08 .
#6
Posté 07 février 2011 - 07:04
void main()
{
object oPC = GetItemActivator();
object oItem = GetItemActivated();
object oTarget = GetItemActivatedTarget();
location lTarget = GetItemActivatedTargetLocation();
// Start the conv_dm_wand conversation
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionStartConversation(oPC, "conv_dm_wand", TRUE, FALSE, FALSE, FALSE));
}
I saw on another thread a reference to a flag to set on the module properties to allow tag-based scripts. What is that flag? - I can't see it in the module properties.
#7
Posté 07 février 2011 - 08:34
This is from Jassper's Noob Corner.
The script name MUST be prefixed with “i_” AND suffixed (postfixed) with “_ac” for activate. So in the example in NWN1, our script would need to be named “i_test_item_ac”. The prefix and suffix is in place to provide a sense of security for on line modules that allow local vault players.Each event has a different suffix (postfix) as follows;
For the OnHit Cast Spell: Unique
power Postfix = “_hc”
For the OnItemEquip Event Postfix = “_eq”
For the OnItemUnequip Event Postfix = “_ue”
For the OnAquire Event Postfix = “_aq”
For the OnUnAquire Event Postfix = “_ua”
For the OnActivate Event Postfix = “_ac”
For casting a spell on the item Postfix = “_ci”
Modifié par Mad.Hatter, 07 février 2011 - 08:36 .
#8
Posté 07 février 2011 - 08:50
#9
Posté 07 février 2011 - 09:07
If you've already done that, are you using a custom or altered OnModuleLoad script?
#10
Posté 07 février 2011 - 09:33
Thanks to everyone for your help. Cheers





Retour en haut






