Aller au contenu

Photo

Help with HCR2


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

#1
WOODY069

WOODY069
  • Members
  • 7 messages
 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.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
It Would help if you posted a link for the HCR2 download.

#3
WOODY069

WOODY069
  • Members
  • 7 messages
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.

#4
Squatting Monk

Squatting Monk
  • Members
  • 446 messages
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":

Image IPB

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):

Image IPB

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:

Image IPB

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

Image IPB

Hope this helps! :)

Modifié par Squatting Monk, 21 juin 2012 - 04:51 .


#5
WOODY069

WOODY069
  • Members
  • 7 messages
Thank you very much Squating Monk. That was what I need, and thanks for the suggestion Lightfoot.