add_gold_to_party

正在查看此主题的用户

Mydrall

Regular
OK...so my last college class ended at 3. I came home and started working on the new module system. I have been working through the module documentation. I have been working the good part of three hours on this one operation add_gold_to_party. In header_operation.py it is like this.

add_gold_to_party              = 1070 # party_id should be different from 0
      # (add_gold_to_party,<value>,<party_id>),




Here is my code.....
########################################################################

module_parties.py

("mod_town","Hamlet",  icon_mod_town|pf_hamlet, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-1, 1),[], 10),
########################################################################

##this is of course embedded inside of the other encounter try statements.
module_scripts.py

(else_try),
          (eq, "$g_encountered_party", "p_mod_town"),
          (jump_to_menu, "mnu_mod_town"),

########################################################################

module_game_menues.py

(
    "mod_town",0,

    "You enter a modular town",
    "none",
    [],
    [
       
      ("add_xp",[],"Get xp.",[(add_xp_as_reward,100000),]),
                                #(add_gold_to_party,<value>,<party_id>),
      ("getgold",[],"Get GOLD_1",[(add_gold_to_party,10000000, "trp_player")]),
      ("getgoldy",[],"Get GOLD_2!",[(add_gold_to_party,1000000, "p_main_party")]),
      ("leave",[],"Leave.",[(leave_encounter),(change_screen_return)]),

      ]
  ),

########################################################################


I can open the town menu and select the "Get xp" or "Leave", those both work fine. Neither of the add_gold_to_party functions work.

...any help would be appreciated.

Thanks.
-Rhider

 
For player, use:

(trp_add_gold, "trp_player, 10000)

Much easier.

For party, may be:

(add_gold_to_party, 10000, "main_party")

I'm not sure.
 
oooh. Thanks. I will have to try the other function. As for using "main_party". I tried that and it said "main_party"was not defined when I compiled it. To refrence parties from another file I am supposed to put a "p_" in front of the part name. I don't know...maybe I am wrong there...I mean, even with the "p_" in front of it it still didn't work...=-/
Thanks though...when I get home I am going to have to try that out.

-Rhider
 
Base on the description of the function "add_gold_to_party" in your first post, it seems that you can't use "p_main_party" since its ID is 0.
 
u know what? everything makes a whole lot more sense....thank you very much.

(trp_add_gold, "troop_player, 10000)

This works perfectly. Thank you very much.
 
heheh, lol ya, the compiler caught that. =-P...I just forgot to put the last quote in the post =-P

small detail though, it is <(troop_add_gold, "trp_player", 10000)>

the difference is that in my post I put the 'o' the wrong place, and in yours you put <trp_add_gold> instead of <troop_add_gold>.
I am posting this not to be a syntax jerk, but just to let u know in case u try to use it. Or anyone else reading this post.
This will keep brand new people from asking this same question again...maybe.

-Rhider
 
后退
顶部 底部