Aller au contenu

Photo

Setting plot flag based on item in inventory


37 réponses à ce sujet

#26
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Add this to your module_core switch statement:

case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:
{
   object oAcquirer = GetEventCreator(ev); // item acquierer
   object oItemAcquired = GetEventObject(ev, 0); // the item that's been acquired
   // Insert event-handling code here.
   PrintToLog( "**** Acquired item " + GetTag(oItemAcquired) + " by " + GetName(oAcquirer) + " ****" );
   break;
}


Recompile module_core, run your module, and check to see if the message shows in your log. The only way this could fail is if the item doesn't have that flag set or if you didn't export the item after setting the flag. I have done this so I know it works.

EDIT: I really hate the way this forum screws up scripts. :(

Modifié par FalloutBoy, 11 janvier 2010 - 06:27 .


#27
cstanish

cstanish
  • Members
  • 90 messages
Well, I followed FalloutBoy's suggestion and it is still not happening. The variable is definitely set on the item and it has been repeatedly saved, checked in, and re-exported, but the event is still not happening.

#28
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
Do you have some kind of custom module script that you got from somewhere, or are you modifying module_core, or did you create a new module script with the module script template? My recommendation would be #3 although #2 should work as well.


#29
Craig Graff

Craig Graff
  • Members
  • 608 messages
One thing to be aware of is that certain core assets (including module_core and possibly player_core) are preloaded before the addins folders are checked, meaning they can't be overridden from ModuleID\\Core\\Override but instead must go in \\packages\\core\\override (unless and until we are able to make a patch that changes this behavior).

#30
cstanish

cstanish
  • Members
  • 90 messages
It's a new module script using the module script template

#31
Craig Graff

Craig Graff
  • Members
  • 608 messages
Yes, but you said on the last page that you weren't getting the log messages from player_core, hence my comment.

Edit: And then I realized you were responding to FalloutBoy.

Modifié par Craig Graff, 13 janvier 2010 - 05:28 .


#32
ArathWoeeye

ArathWoeeye
  • Members
  • 205 messages
It won't help about the issue itself but maybe you can buy it from the merchant via dialogue and set flags in that way? Could add some nice haggling RP too, if you like :P

#33
cstanish

cstanish
  • Members
  • 90 messages

ArathWoeeye wrote...

It won't help about the issue itself but maybe you can buy it from the merchant via dialogue and set flags in that way? Could add some nice haggling RP too, if you like :P


That's not a bad notion and I did have that very same idea myself.  I tried it and discovererd the problem with it is that it opens up the possibility of setting the flag through the dialogue even if the player doesn't actually buy it.  Then the game will let you carry on with the quest but you wouldn't be able to finish without the actual item.

And also, I'd like to fill whatever gap in my knowledge is causing me to run into this problem, because someday I will run out of clever workarounds. :)

#34
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
The b2b package you sent me works perfectly:

Script    SetPlot [83CA726284D348AF92357FBA3C4B63AE] [] -> [1]
Script    GetPlot [DA64053DF18C47628B40B4D68EF0368B] [] = [0]
Script    GetPlot [shl000pt_main] [] = [0]
Script    plot flag should be set
Script    SetPlot [sod_gift_plot] [GIFT_OBTAINED] -> [1]
Script    **** Acquired item sod_book by Soren ****
Script    SetPlot [tut_first_gift] [TUT_FIRST_GIFT_1] -> [1]
Script    SetPlot [tut_journal] [TUT_JOURNAL_1] -> [1]

I created a new module, imported your stuff, set the module start area/waypoint. Then I created a chest placeable and put your book inside it. I placed the chest next to the start point. Switched to the All tab on palette, then selected the SOD folder and did export with dependant rec's. Ran the game, looted the chest, and it gave me the quest. Maybe you weren't exporting it properly.

Modifié par FalloutBoy, 14 janvier 2010 - 07:50 .


#35
cstanish

cstanish
  • Members
  • 90 messages

FalloutBoy wrote...

The b2b package you sent me works perfectly:

Script    SetPlot [83CA726284D348AF92357FBA3C4B63AE] [] -> [1]
Script    GetPlot [DA64053DF18C47628B40B4D68EF0368B] [] = [0]
Script    GetPlot [shl000pt_main] [] = [0]
Script    plot flag should be set
Script    SetPlot [sod_gift_plot] [GIFT_OBTAINED] -> [1]
Script    **** Acquired item sod_book by Soren ****
Script    SetPlot [tut_first_gift] [TUT_FIRST_GIFT_1] -> [1]
Script    SetPlot [tut_journal] [TUT_JOURNAL_1] -> [1]

I created a new module, imported your stuff, set the module start area/waypoint. Then I created a chest placeable and put your book inside it. I placed the chest next to the start point. Switched to the All tab on palette, then selected the SOD folder and did export with dependant rec's. Ran the game, looted the chest, and it gave me the quest. Maybe you weren't exporting it properly.


That's crazy.  I will try it again, maybe something is so broken that I have to make a whole new module and try again from the beginning.  I'm kind of scared of what I might have done that makes this not work. 

#36
cstanish

cstanish
  • Members
  • 90 messages
Also, thanks FalloutBoy for going to to so much trouble to help me out.

#37
cstanish

cstanish
  • Members
  • 90 messages
OK I believe I have found the problem. And, once again, it's one of those really weird things that happens when you have a customized "default_player.utc" in module/override folder. I guess that's really not worth doing, I suppose. I'm going to have to find a different way to skip character generation without the PC being the same bald, featureless guy.

#38
hunharibo

hunharibo
  • Members
  • 126 messages
why dont you take a look at chargen scripts to get an idea about needed functions then create a custom script to generate the PC you want in the background (not using the chargen).