login

Author Topic: Ask Winter  (Read 65767 times)

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Ask Winter
« Reply #90 on: April 17, 2008, 01:29:05 AM »
The problem with your spt_mercenary is that it has no new code attached to it. Just because you slapped in a new constant doesn't mean the game knows what to do with it. You have to code in that functionality yourself, for example in the script game_event_party_encounter. The game has several bits that key on party type and I've used them extensively for the Storymod Chapter 2 war system, so believe me they work fine.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #91 on: April 17, 2008, 06:52:04 AM »
The code for it that I have added is:

Code: [Select]
(taken from the trigger that spawns all the kingdom secondary parties)
(try_begin),
        (this_or_next|eq, ":cur_kingdom", "fac_kingdom_1"),
        (this_or_next|eq, ":cur_kingdom", "fac_kingdom_3"),
        (eq, ":cur_kingdom", "fac_kingdom_5"),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", 100),
        (display_message, "@before script call"),
        (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_mercenary),
(try_end),

Code: [Select]
(taken from script_cf_create_kingdom_party)
(else_try),
        (eq, ":party_type", spt_mercenary),
        (assign, ":party_template", "pt_hired_mercenaries_party"),
        (display_message, "@party temp assigned"),

(else_try),
          (eq, ":party_type", spt_mercenary),
          (display_message, "@before pt add"),
          (party_add_template, ":result", "pt_mercenaries_c"),
          (display_message, "@after pt add"),

It seems to me like this is the only code that spawns lets say a patrol, and my patrols spawn fine.

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Ask Winter
« Reply #92 on: April 17, 2008, 07:28:09 AM »
. . . Okay, so what's the problem? You've still not explained what it is that's wrong with it.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #93 on: April 17, 2008, 08:19:42 AM »
I dont know what is wrong with it.  No mercenary parties spawn, even though the chance to spawn is 100%, and the messages in the script do not display.  The display message in the triggers displays right before the script call, but once the script is called, nothing happens if the spt is set to mercenary.

Edit:  Somehow deleting quick strings, tag uses, and variable uses fixed the problem...Sorry for my stupidity.

« Last Edit: April 17, 2008, 08:33:55 AM by grailknighthero »

Offline fujiwara

  • Master
  • *****
  • Posts: 858
    • View Profile
Re: Ask Winter
« Reply #94 on: April 20, 2008, 09:49:44 PM »
I recommend deleting those files at every compile. I wrote a process_init.py file to do just that. I realize they get overwritten, but I've seen stranger things happen.

The horses tend to get their legs caught in the catapult rather than being properly launched.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #95 on: April 21, 2008, 03:18:09 PM »
This isnt the first time something like this has happened to me, and I should have known from the beginning.  All I need to do is this right:
try:
  os.remove(export_dir + 'variable_uses.txt')
except:
  a = []

Well ya, that's what it does for quick strings and tag uses, but I just want to make sure so I dont screw anything up.  I've never messed with deleting files with python, just creating files and folders.

Offline fujiwara

  • Master
  • *****
  • Posts: 858
    • View Profile
Re: Ask Winter
« Reply #96 on: May 01, 2008, 10:41:51 PM »
EXACTLY!

My process_init.py code:

Code: [Select]
from module_info import *
import os

print "Initializing..."

try:
os.remove(export_dir + 'tag_uses.txt')
except:
pass
try:
os.remove(export_dir + 'quick_strings.txt')
except:
pass

I don't typically delete variable_uses.txt everytime, but it certainly wouldn't hurt. Pretty much anything the module system generates (quick_strings.txt, tag_uses.txt, variables.txt, variable_uses.txt) can be deleted without consequence.
« Last Edit: May 01, 2008, 10:44:49 PM by fujiwara »

The horses tend to get their legs caught in the catapult rather than being properly launched.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #97 on: May 02, 2008, 02:53:07 PM »
Sorry, I should have stated that I figured it out awhile ago.  Ill make sure mine is like yours when I have time to mod again.

Offline fujiwara

  • Master
  • *****
  • Posts: 858
    • View Profile
Re: Ask Winter
« Reply #98 on: May 03, 2008, 08:52:36 AM »
I would NOT delete variable_uses.txt; That's where the compiler stores all the globals it finds as it compiles. I tried it, and it forgot all the globals, so I got this horde of "Usage of undeclared global variable" messages.

The horses tend to get their legs caught in the catapult rather than being properly launched.

Kolba

  • Guest
Re: Ask Winter
« Reply #99 on: June 17, 2008, 08:00:48 AM »
I tried making some conversations, but while "building module" encountered some weird problems

Code: [Select]
C:\Documents and Settings\andrzej\Moje dokumenty\modulesystem\ModuleSystem>python process_dialogs.py
exporting triggers...
exporting dialogs...
********************************************************************************
**
********************************************************************************
**
ERROR: INPUT TOKEN NOT FOUND:ulric_e
********************************************************************************
**
********************************************************************************
**
Traceback (most recent call last):
  File "process_dialogs.py", line 121, in <module>
    compile_sentence_tokens(dialogs)
  File "process_dialogs.py", line 90, in compile_sentence_tokens
    cause_error()
NameError: global name 'cause_error' is not defined
Aby kontynuowa?, naci?nij dowolny klawisz . . .


Here is mine conversation:

Code: [Select]
[trp_ulric,"start", [], "Who are you? You'll not get anything from me!", "ulric_aa",[]],
  [trp_ulric|plyr,"ulric_aa", [], "What are you talking about?", "ulric_b",[]],
  [trp_ulric,"ulric_b", [], "Excuse me sir, I am really old and I'm often talking about stupid things. Do you know my story? No? Listen...my name is Ulric. I was born in town of Zendar. My father signed up to Swadian army, went to West Territories and never came back. My mother died few years later. I had nothing to do, so like my father I joined Swadian Army. With my only one companion and friend Rolf, I fought many battles, killed many Vaegirs and outlaws. Finally, King Harlaus allowed us to became knights. After that, we went with army to the West Territories in search of my father. We found an old, looks abandoned keep. We explored all rooms, but didn't find anybody! I decided to sleep here, since there were many beds upstairs. Next day, I woke up early and I was going to talk with Rolf, but he wasn't there, where he should be. I thought that he went outside of keep, but sadly ALL THE CASTLE WAS EMPTY! I dind't find any soldiers! I left keep and tried to look for them in near areas, but with no results. Finally, I decided to go alone to the West and find father. It was a long way, too big to tell you. I found another castle, but little bigger. In the courtyard I found...my father lying on the grass! He was death. I found a letter. It was for me...", "ulric_c",[]],
  [trp_ulric|plyr,"ulric_c", [], "And what happened next?", "ulric_d",[]],
  [trp_ulric,"ulric_d", [], "If you want to know, give me mystic potion. It's in town, where Sea Raiders land. I'll give you my lore book.", "ulric_da",[]],
  [trp_ulric|plyr,"ulric_da", [],  [(player_has_item,"itm_vial")], "Here you are...", (troop_remove_item,0,"itm_vial"),(troop_add_item, "trp_player","itm_lore_book"), "ulric_e",[]],
  [trp_ulric|plyr,"ulric_da", [], "I'll try to search.", "close_window",[]],
  [trp_ulric,"ulric_e", [], "When I was opening letter, ten or eleven undeads jumped from castle tower to me. They tried to kill me, but at the last moment Rolf appeared and throw away few of them. We escaped, because more and more undeads appeared. Suddenly, I saw the fog and lost from eyes Rolf. Then, I felt hard hit on head and I don't remember anything more...", "close_window",[]],


I know probably what's the problem - symbols "[]" before dialogue text are wrong placed in "ulric_da" line. Where should I put them? And I'm not sure about having/removing/adding items scheme in this line - does it work?





grailknighthero

  • Guest
Re: Ask Winter
« Reply #100 on: June 18, 2008, 12:07:26 AM »
[trp_ulric|plyr,"ulric_da", [],  [(player_has_item,"itm_vial")], "Here you are...", "ulric_e",[(troop_remove_item,0,"itm_vial"),(troop_add_item, "trp_player","itm_lore_book"),]],
 
I think this fixes it.

Offline fujiwara

  • Master
  • *****
  • Posts: 858
    • View Profile
Re: Ask Winter
« Reply #101 on: June 18, 2008, 12:08:32 PM »
Code: [Select]
[trp_ulric|plyr,"ulric_da",  [(player_has_item,"itm_vial")], "Here you are...", "ulric_e",[(troop_remove_item,0,"itm_vial"),(troop_add_item, "trp_player","itm_lore_book"),]],
Try this.

The horses tend to get their legs caught in the catapult rather than being properly launched.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #102 on: June 18, 2008, 01:35:27 PM »
Ya, I missed the first two extra brackets.  Thanks fujiwara.

I suggest having another look at this http://forums.taleworlds.net/index.php/topic,12733.0.html and native dialogs.

grailknighthero

  • Guest
Re: Ask Winter
« Reply #103 on: June 27, 2008, 02:21:52 PM »
Lets say I have the following

slot_item_first_slot = 1
slot_item_second_slot = 2
slot_item_third_slot = 3

can I do
(assign, ":slot", slot_item_first_slot),
(val_add, ":slot", 2)

to have ":slot" be slot_item_third_slot

So I can do

(item_get_slot,":n","itm_item",":slot"),

I am having error messages display in battle for a trigger that does this.

Ok I fixed it.  That works for all I know so far, I had a different mistake.


Also, can anyone get (agent_get_entry_no,<destination>,<agent_id>), to work?

I have
(try_for_agents, ":a"),
                (agent_get_entry_no,":entry",":a"),
                (assign, reg25, ":entry"),
                (display_message, "@Agent entry point: {reg25}"),

and nothing displays.

I got this to display from changing 0, 0, ti_once to 1,0, ti_once
« Last Edit: June 27, 2008, 03:39:05 PM by grailknighthero »

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Re: Ask Winter
« Reply #104 on: June 27, 2008, 03:22:52 PM »
Lets say I have the following

slot_item_first_slot = 1
slot_item_second_slot = 2
slot_item_third_slot = 3

can I do
(assign, ":slot", slot_item_first_slot),
(val_add, ":slot", 2)

to have ":slot" be slot_item_third_slot

So I can do

(item_get_slot,":n","itm_item",":slot"),

I am having error messages display in battle for a trigger that does this.

You can certainly do that, it's exactly how the module system works. I do it all the time in Craftmod. Your error messages may be related but not a direct consequence.

Regards,
Ryan