If anyone has any experience with HCR2 I cant seem to figure out how to add options to the player data item. Being a scripting hack I cant seem to come up with a script to execute h2_AddplayerDataItem for the on module load event.
If you have used this system an example script or an explanation would be very much appreciated.
Thanks.
Help with HCR2
Débuté par
WOODY069
, juin 20 2012 04:36
#1
Posté 20 juin 2012 - 04:36
#2
Posté 20 juin 2012 - 10:03
It Would help if you posted a link for the HCR2 download.
#3
Posté 21 juin 2012 - 12:19
Sorry, this is it.
http://nwvault.ign.c...&comment_page=4
The following is an excerpt from the Subsystem Developers Guide.
"The following function allows you to add menu items
to the player data item conversation dialogue:
h2_AddPlayerDataMenuItem (sMenuText, sConvResRef)
You should use a module load hook-in script to make all calls
to h2_AddPlayerDataMenuItem. When the item itself is activated, the target object and target location is saved on the PC. "
Thanks Lightfoot, I hope this helps. If not maybe someone who has used the system might see this thread.
http://nwvault.ign.c...&comment_page=4
The following is an excerpt from the Subsystem Developers Guide.
"The following function allows you to add menu items
to the player data item conversation dialogue:
h2_AddPlayerDataMenuItem (sMenuText, sConvResRef)
You should use a module load hook-in script to make all calls
to h2_AddPlayerDataMenuItem. When the item itself is activated, the target object and target location is saved on the PC. "
Thanks Lightfoot, I hope this helps. If not maybe someone who has used the system might see this thread.
#4
Posté 21 juin 2012 - 04:43
Adding items to the player data menu basically adds a link to a custom conversation. Suppose I want to allow the player to make a skill check from a conversation, and I want to let them access the conversation easily from the player data item. I first need to create my custom conversation, which I'll save as "sc_skillcheck":

Then, I need to create a hook-in script to add a link to my new conversation to the player data item menu:
The first parameter in the h2_AddPlayerDataMenuItem() function is the text I want to display to the player. The second parameter is the name of the conversation I want to link to. I'll save this script as "sc_moduleload".
Now we need to make this script load when the module loads. Close the script editor and go to Edit -> Module Properties. Click the Advanced tab, then click the little button next to Variables. Add a string variable named "OnModuleLoad2" (or whatever the next number in the sequence is) and make its value say "sc_moduleload" (without the quotes):

Click OK. Save your module and go test it.
If you did everything right, you should see your new menu item whenever you use your player data item:

Don't forget to click it and make sure it links to the right conversation:

Hope this helps!

Then, I need to create a hook-in script to add a link to my new conversation to the player data item menu:
#include "h2_core_i"
void main()
{
h2_AddPlayerDataMenuItem("Roll a skill check.", "sc_skillcheck");
}The first parameter in the h2_AddPlayerDataMenuItem() function is the text I want to display to the player. The second parameter is the name of the conversation I want to link to. I'll save this script as "sc_moduleload".
Now we need to make this script load when the module loads. Close the script editor and go to Edit -> Module Properties. Click the Advanced tab, then click the little button next to Variables. Add a string variable named "OnModuleLoad2" (or whatever the next number in the sequence is) and make its value say "sc_moduleload" (without the quotes):

Click OK. Save your module and go test it.
If you did everything right, you should see your new menu item whenever you use your player data item:

Don't forget to click it and make sure it links to the right conversation:

Hope this helps!
Modifié par Squatting Monk, 21 juin 2012 - 04:51 .
#5
Posté 21 juin 2012 - 05:24
Thank you very much Squating Monk. That was what I need, and thanks for the suggestion Lightfoot.





Retour en haut







