random battle scenes?

正在查看此主题的用户

freak_oz

Squire
is it possible to have 3 different battle scenes and 1 is choosen randomly every time you fight..
 
Try writing a routine which randomly assigns one of the scene names to a variable - say, "$fight_scene" - and then wherever your (jump_to_scene, ______) operation is being called, change it from the current contents, which will be "scn_XXXXX" of some kind, to "$fight_scene" instead.  As I understand it, that should be all you need.  Note, if you're editing the standard encounter temlate rather than one of your own devising, you'll want to make sure that $fight_scene is set properly for encounters other than the one you're thinking about, too.
 
Hellequin 说:
Try writing a routine which randomly assigns one of the scene names to a variable - say, "$fight_scene" - and then wherever your (jump_to_scene, ______) operation is being called, change it from the current contents, which will be "scn_XXXXX" of some kind, to "$fight_scene" instead.  As I understand it, that should be all you need.  Note, if you're editing the standard encounter temlate rather than one of your own devising, you'll want to make sure that $fight_scene is set properly for encounters other than the one you're thinking about, too.
i dont really understand what you're saying but what i want is:
i have 3 scenes
battle_scene 1,2 and 3
i want a script that randomly chooses 1 of them or something..


nevermind but i don't understand how to write the routine
and what it has to contain, i'm very unexpirienced
 
I think you need to spend a lot more time perusing the stuff in Native and figuring out how it works, and reading through Winter's docs, then.  I'm also very inexperienced, prior to the last three weeks or so which have been intensive, but you need to look through header_operations.py and find likely-looking operations, try them out, look for instances of them in the Native code (check out the scripts which randomly select governors' quests, for instance), and so forth.  Otherwise you'll be back here every twenty seconds or so.  That's my first line of recourse, and it's worked well so far.
 
i tried something but what's wrong with this code?

("random_scene_choose",
[
     (store_random_in_range,fight_scene,1,4)
     if fight_scene > 1:
      $fight_sceneb ="scn_battle_scene1"

     if fight_scene > 2:
      $fight_sceneb="scn_battle_scene2"

     if fight_scene > 3:
      $fight_sceneb="scn_battle_scene3"
]),

 
freak_oz 说:
i tried something but what's wrong with this code?

("random_scene_choose",
[
    (store_random_in_range,fight_scene,1,4)
    if fight_scene > 1:
      $fight_sceneb ="scn_battle_scene1"

    if fight_scene > 2:
      $fight_sceneb="scn_battle_scene2"

    if fight_scene > 3:
      $fight_sceneb="scn_battle_scene3"
]),
If "fight_scene" was >3, it would also be >2, >1 etc.
You could use

插入代码块:
("random_scene_choose",
 [
     (store_random_in_range,fight_scene,1,4)
     if fight_scene > 1 and < 2:
      $fight_sceneb ="scn_battle_scene1"

     if fight_scene > 2 and < 3:
      $fight_sceneb="scn_battle_scene2"

     if fight_scene > 3 and < 4:
      $fight_sceneb="scn_battle_scene3"
]),

But I don't know if that'll work :???:
 
your script was not correctly but however i fixed it for a bit but now it gives this error

插入代码块:
Exporting strings...
Exporting sounds...
Exporting particle data...
Exporting skins...
Exporting map icons...
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_items.py", line 56,
in <module>
    from process_operations import *
  File "C:\mb_module_system_0808_0\imperial bandits\process_operations.py", line
 15, in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_scene_props.py", lin
e 7, in <module>
    from process_operations import *
  File "C:\mb_module_system_0808_0\imperial bandits\process_operations.py", line
 15, in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax
Exporting scene data...
Exporting troops data
Exporting party_template data...
Exporting parties
Exporting quest data...
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_scripts.py", line 4,
 in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_mission_tmps.py", li
ne 8, in <module>
    from process_operations import *
  File "C:\mb_module_system_0808_0\imperial bandits\process_operations.py", line
 15, in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_game_menus.py", line
 8, in <module>
    from process_operations import *
  File "C:\mb_module_system_0808_0\imperial bandits\process_operations.py", line
 15, in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_simple_triggers.py",
 line 5, in <module>
    from process_operations import *
  File "C:\mb_module_system_0808_0\imperial bandits\process_operations.py", line
 15, in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "C:\mb_module_system_0808_0\imperial bandits\process_dialogs.py", line 9,
 in <module>
    from process_operations import *
  File "C:\mb_module_system_0808_0\imperial bandits\process_operations.py", line
 15, in <module>
    from module_scripts import *
  File "C:\mb_module_system_0808_0\imperial bandits\module_scripts.py", line 21
    if fight_scene > 1 and fight_scene < 2:
                                          ^
SyntaxError: invalid syntax

______________________________

Script processing has ended.
Press any key to exit. . .
 
("random_scene_choose",
[
     (store_random_in_range,":fight_scene",1,4),
     (try_begin),
     (eq, ":fight_scene", 1),
     (assign, "$fight_sceneb", "scn_battle_scene1"),
     (else_try),
     (eq, ":fight_scene", 2),
     (assign, "$fight_sceneb", "scn_battle_scene2"),
     (else_try),
     (eq, ":fight_scene", 3),
     (assign, "$fight_sceneb", "scn_battle_scene3"),
     (try_end),
   ]),

You`re using Python code. M&B code is inside the list scripts, but is not python code. It is functions in header_operations.py only:
"if a > 3" is a python code

which won`t work in game (it will be executed at compilation of the module system and be static),

"(ge, "$a", 3)," is M&B code
 
Scion 说:
You`re using Python code. M&B code is inside the list scripts, but is not python code. It is functions in header_operations.py only:
"if a > 3" is a python code

which won`t work in game (it will be executed at compilation of the module system and be static),

"(ge, "$a", 3)," is M&B code

That makes sense.
 
后退
顶部 底部