Author Topic: Help with HCR2  (Read 388 times)

Legacy_WOODY069

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Help with HCR2
« on: June 20, 2012, 05:36:23 pm »


                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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Help with HCR2
« Reply #1 on: June 20, 2012, 11:03:28 pm »


               It Would help if you posted a link for the HCR2 download.
               
               

               
            

Legacy_WOODY069

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Help with HCR2
« Reply #2 on: June 21, 2012, 01:19:01 am »


               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.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Help with HCR2
« Reply #3 on: June 21, 2012, 05:43:41 am »


               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

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

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

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

'Image

Hope this helps! '<img'>
               
               

               


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


            

Legacy_WOODY069

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Help with HCR2
« Reply #4 on: June 21, 2012, 06:24:46 pm »


               Thank you very much Squating Monk. That was what I need, and thanks for the suggestion Lightfoot.