Author Topic: M&B Scripting Q&A  (Read 63560 times)

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: FAQ project!
« Reply #15 on: January 16, 2007, 11:27:46 AM »
Yoshi - could you not make a version of the skybox which was scaled up enough to enclose the map entire (even if the PC party's in one corner), and use that for the mesh instead?

I have a couple more questions:

1) How do I make the camera switch back to the player (instead of the conversation partner) during a conversation?
2) Can I (and how can I) bring a third party into a conversation, giving them lines and camera time?

Yoshiboy

  • Guest
Re: FAQ project!
« Reply #16 on: January 16, 2007, 12:06:23 PM »
Yoshi - could you not make a version of the skybox which was scaled up enough to enclose the map entire (even if the PC party's in one corner), and use that for the mesh instead?

I have a couple more questions:

1) How do I make the camera switch back to the player (instead of the conversation partner) during a conversation?
2) Can I (and how can I) bring a third party into a conversation, giving them lines and camera time?

Well, you can't scale it up too much anyway or it just breaks but even still the same problem occurs. As soon as the center of a mesh goes out of view on the world map, it is not drawn. As soon as the player icon/skybox icon center goes out of view the reflection goes.

1) Just make the next part of the conversation be said by the player. e.g

[trp_trainer|plyr,"novicemaster_introduce", [], "{playername}.", "novicemaster_introduce_2",[]],

(done by adding the |plyr tag to the entry).

2) check the FAQ ;P

Just make the state use the other troop tag. E.g

[trp_trainer|other(trp_yourNPChere),"novicemaster_introduce", [], "{playername}.", "novicemaster_introduce_2",[]],

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: FAQ project!
« Reply #17 on: January 16, 2007, 12:19:04 PM »
Thanks.  Sorry - I did check it; just not right now!  And thank you, I should just have checked Winter's docs for the first one.  In a way, I had it backwards; I hadn't ever not offered multiple dialogue entries for the player, it hadn't occurred to me that anything special would happen then.

Is there any way I can use a variable instead of an explicit troop name in the |other(trp_XXX) syntax, for example if I want that to devolve on my best healer?  Does 'anyone' work in that construction?  (And does store_conversation_troop within such a statement store the original conversation partner, or the person currently speaking the line?)

And, lastly, one more - what's the skinny on the [options] parameter on the (play_sound) operation?  Can we dynamically set the volume (without having a bunch of near-duplicate snd_ objects)?

Leprechaun

  • Guest
Re: FAQ project!
« Reply #18 on: January 16, 2007, 12:25:05 PM »
Yoshi - could you not make a version of the skybox which was scaled up enough to enclose the map entire (even if the PC party's in one corner), and use that for the mesh instead?
Well, you can't scale it up too much anyway or it just breaks but even still the same problem occurs. As soon as the center of a mesh goes out of view on the world map, it is not drawn. As soon as the player icon/skybox icon center goes out of view the reflection goes.
I haven't found that - when I zoom right out the skybox reflects on every bit of water in sight just fine. Even if I move away from the party so it's no longer in sight. Or have I misunderstood your point?

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: FAQ project!
« Reply #19 on: January 16, 2007, 12:27:58 PM »
Maybe you've set it to pf_always_visible and Yoshi hasn't?

Yoshiboy

  • Guest
Re: FAQ project!
« Reply #20 on: January 16, 2007, 12:35:37 PM »
Thanks.  Sorry - I did check it; just not right now!  And thank you, I should just have checked Winter's docs for the first one.  In a way, I had it backwards; I hadn't ever not offered multiple dialogue entries for the player, it hadn't occurred to me that anything special would happen then.

Is there any way I can use a variable instead of an explicit troop name in the |other(trp_XXX) syntax, for example if I want that to devolve on my best healer?  Does 'anyone' work in that construction?  (And does store_conversation_troop within such a statement store the original conversation partner, or the person currently speaking the line?)

And, lastly, one more - what's the skinny on the [options] parameter on the (play_sound) operation?  Can we dynamically set the volume (without having a bunch of near-duplicate snd_ objects)?

Well, what you need to do is list all the possible troops with conditions of which one to pick.

[anyone|other(trp_man1),"man_introduce", [(eq,":man_to_talk_to",1)], "Hi, I am man 1.", "man_introduce_2",[]],
[anyone|other(trp_man2),"man_introduce", [(eq,":man_to_talk_to",2)], "Hi, I am man 2.", "man_introduce_2",[]],
[anyone|other(trp_man3),"man_introduce", [(eq,":man_to_talk_to",3)], "Hi, I am man 3.", "man_introduce_2",[]],

This is unfortunately the only way to do it, its not possible to put a variable for the troop name.
Quote
I haven't found that - when I zoom right out the skybox reflects on every bit of water in sight just fine. Even if I move away from the party so it's no longer in sight. Or have I misunderstood your point?

Are you talking about a new party skybox that is added like I said? Or what is already there? What is already there you cannot change. You have to use this workaround.

Quote
Maybe you've set it to pf_always_visible and Yoshi hasn't?

Nah, thats to do with visibility of the party, not the camera. I'm pretty sure this thing is Hardcoded, me and Thorgrim were thinking ways around it for a long time.

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: FAQ project!
« Reply #21 on: January 16, 2007, 12:45:01 PM »
does store_conversation_troop within such a statement store the original conversation partner, or the person currently speaking the line?)

I think it stores the current speaker, I've had silly errors when I use the command when the player is talking.

Yoshiboy

  • Guest
Re: FAQ project!
« Reply #22 on: January 16, 2007, 01:02:01 PM »
Quote
And, lastly, one more - what's the skinny on the [options] parameter on the (play_sound) operation?  Can we dynamically set the volume (without having a bunch of near-duplicate snd_ objects)?

Sorry, don't know this one. I don't think it does anything.

svaucher

  • Guest
Re: FAQ project!
« Reply #23 on: January 17, 2007, 03:19:40 AM »
I'm wondering about debugging. How do you gurus do it?

I currently use dialogs with a ficticious character who'd tell me the state of different global variables. I also use add_xp to see different values in the game when it's a triggered event.

Also, how do you start the game so that it's quickest? Since I play with the mechanics, I always start a new character to test a small increments, and it's a really a pain.

Yoshiboy

  • Guest
Re: FAQ project!
« Reply #24 on: January 17, 2007, 03:31:29 AM »
I'm wondering about debugging. How do you gurus do it?

I currently use dialogs with a ficticious character who'd tell me the state of different global variables. I also use add_xp to see different values in the game when it's a triggered event.

Also, how do you start the game so that it's quickest? Since I play with the mechanics, I always start a new character to test a small increments, and it's a really a pain.

Commonly the best way is to assign variables to a register and then use the display message command with a string containing that register. Like the test string for example. Then put this in the script you are testing. Although your techniques seem to work just as well :)

There isn't really a quickest way. Just click all the options as fast as you can.

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: FAQ project!
« Reply #25 on: January 17, 2007, 11:43:03 AM »
Yah.  If you want to speed things up slightly, you might try adding a definition for int_1 & agi_1 to header_troops.py, and setting trp_player to those.  (Or just using troop_raise_attribute with a negative raise, during the opening menus, such as when hitting a "Debugging quickstart" option instead of Male/Female.)  Similarly you could put a call to troop_add_proficiency_points with a negative raise there, so as to have none of those to spend - haven't tried this, though, can't confirm that this function accepts negative args nor do I know what happens if you go below zero points this way.

But that's about it.

Incidentally, when doing high-volume debugging (esp. on loops), your method is probably working better, because you can overload the (display_message) queue pretty easily, all it takes is more than about six messages in a short time.

Highlander

  • Guest
Modding Q&A
« Reply #26 on: January 18, 2007, 10:12:36 AM »
could somebody give a good explanation of "player not placed on the scene"?
I'm getting mad here while trying to fix it for more than two hours.

btw: this is my script,
Code: [Select]
   (modify_visitors_at_site,"scn_wh_battle1"),(reset_visitors),
    (set_visitor,0,"trp_orc"),
    (set_visitor,1,"trp_orc"),
    (set_visitor,2,"trp_orc"),
    (set_visitor,5,"trp_orc"),
    (set_visitor,6,"trp_orc"),
    (set_visitor,8,"trp_orc"),
    (set_visitor,9,"trp_orc"),
    (set_visitor,10,"trp_space_marine"),
    (set_visitor,11,"trp_space_marine"),
(set_visitor,13,"trp_player"),
    (set_visitor,15,"trp_space_marine"),
    (set_visitor,16,"trp_space_marine"),
    (set_visitor,18,"trp_space_marine"),
    (set_visitor,19,"trp_space_marine"),
    (set_visitor,20,"trp_chaos_space_marine"),
    (set_visitor,21,"trp_chaos_space_marine"),
    (set_visitor,25,"trp_chaos_space_marine"),
    (set_visitor,26,"trp_chaos_space_marine"),
    (set_visitor,28,"trp_chaos_space_marine"),
    (set_visitor,29,"trp_chaos_space_marine"),
   (jump_to_scene,"scn_wh_battle1"),
   (set_jump_mission,"mt_warhammer40k_battle1"),
        (change_screen_mission),
[...]
    [
(1,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(1,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(4,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(7,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(2,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]), #players entry point
(5,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(5,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(8,mtef_visitor_source|mtef_team_2,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(3,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(6,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
(9,mtef_visitor_source|mtef_team_3,0,aif_start_alarmed,1,[]),
     ],
the thing that is making me mad is, that (set_visitor,0,"trp_player"), works well.

Offline Hellequin

  • Journeyman
  • ***
  • Posts: 254
    • View Profile
Re: FAQ project!
« Reply #27 on: January 18, 2007, 10:29:23 AM »
As ever, Armagan is on top of it.  Check it:

Quote from: Armagan
I am afraid the opcode definition of play_sound is misleading. Currently the options are ignored.

Quote from:  Hellequin on January 17, 2007, 05:53:39 pm
Is there a way to make a played sound stop, such as ending when the encounter or mission ends?
Sorry. There's no operation for that ATM. If you like I can add an operation which will stop all sounds.

Quote
BTW, there's a bug in (question_box), see (link) bug report for details, if you haven't already seen it.  Not a big issue, but I wanted to make sure you were aware it existed.
Ooops. Fixing it right away. Thanks a lot! :)

My response:

Quote
Quote from: armagan on Today at 09:41:43 am
If you like I can add an operation which will stop all sounds.
That would make a good segment of the modding community jump up and down for sheer joy.  Yes, please!

Yoshiboy

  • Guest
Re: FAQ project!
« Reply #28 on: January 18, 2007, 11:42:05 AM »
Good to know :)

Offline Winter

  • I am Tek Jansen!
  • Administrator
  • *****
  • Posts: 476
  • MBX Forum owner
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
Modding Q&A
« Reply #29 on: January 18, 2007, 01:55:19 PM »
Always put the player's spawn entry first in the mission template. That should fix your problem.

Appropriately,
Winter