Aller au contenu

Photo

Gift Mechanics


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

#1
Karma

Karma
  • Members
  • 391 messages
I need more information on the scripting behind gift mechanics. There are several things I'd like to do:

1) I want a conversation to commence when a custom gift is given to a specific follower (like when Alistair is given his mother's amulet). How does the OC do this? I've tried a bunch of things, but none of it seems to work. I get the approval but not the conversation.

2) I'd like to restrict who can receive the custom gift to that specific follower. I have no idea how to do this.

3) Right now, I have a very simplistic gifting system set up to give 5 approval points for each gift regardless of gift count and motivation. How do I set up gift count and motivation? I think I've got the 2DAs (motivations and var_module) set up for it, but how/where do I assign a motivation to the follower? I think the gift count is set up in the module script, but I'm not sure what to do from there.

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
You have to trap the EVENT_TYPE_MODULE_HANDLE_GIFT in your module script or a separate script that you can call from the module script.

Check the sp_module_item_acq in the Single Player module for how it is done in the OC.



Basically, for

1) You just do a UT_Talk command between the player and the follower. The plot flags set when the gift is given should push the conversation to the appropriate node (where those same plot flags will be in the conditions tab)



2) If the custom gift is given to another follower, you just inform the player (via the follower) that they cannot accept the gift.



3) Not sure of yet.

#3
Craig Graff

Craig Graff
  • Members
  • 608 messages
3) Approval_GetFollowerIndex in approval_h.nss. This isn't really a problem for stand-alone mods, but for addins to the main campaign it can be troublesome.

#4
Karma

Karma
  • Members
  • 391 messages
1) I had the EVENT_TYPE_MODULE_HANDLE_GIFT event in my module script already and had it so that if the item being given had the right tag, it would fire UT_Talk just as they were doing it in the sp_module_item_acq. But I think because of the way my if-else sections were ordered, another if statement was overriding that one. Dumb mistake on my part. When I add in the refund section and rearrange the if-else statements, I'll test it.

EDIT: So dialogue initiates now, but refund doesn't happen. The other follower plays the bad idea soundset but the gift still disappears. I should be able to fix that fairly easily.

2) sp_module_item_acq is perfect. Will this will get rid of the pesky +5 approval to the controlled party member upon receipt of the gift? Or will I still have to add a line to the script to counteract this?

EDIT: It does not get rid of the pesky +5 to controlled party member. Line to counteract this is still needed.

3) So the index should match the motivation number? It's an add-in. I've customize the approval_h script to include my custom companions, included the new version of approval_h in my scripts instead of the original approval_h, set up a 2da for var_module that includes the variables APP_APPROVAL_RATE_CULLEN and APP_APPROVAL_GIFT_COUNT_CULLEN, changed the module's variable 2DA to the new one, and made a motivations 2DA that includes the new motivation for my follower... Now what?

Modifié par satans_karma, 03 août 2010 - 03:41 .


#5
Karma

Karma
  • Members
  • 391 messages
1) Solved. Conversation initiates.
2) Solved but for one glitch. When I implemented the refund system as was seen in sp_module_item_acq, the follower who received the gift wouldn't return it and would give approval. I fixed both with some inelegant tweaks, but the problem now is that the follower still receives and keeps their follower bonus even though no extra approval was generated.
3) I got the decrease in approval working for gifts. Still working on the motivations.

Modifié par satans_karma, 06 août 2010 - 01:58 .