Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
@Sonyer:
Yes you will have to, most of the troops ( their ID ) are called in other files such as module_scripts, party templates and others. You won't have to change it if you keep the ID.
For example:
Code:
["swadian_recruit","Swadian Recruit","Swadian Recruits",tf_guarantee_armor,0,0,fac_kingdom_1,[itm_scythe,itm_hatchet,itm_pickaxe,itm_club,itm_stones,itm_tab_shield_heater_a,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_shirt,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1,swadian_face_middle_2],
you can modify it without changing the files where it is called by keeping the ID swadian_recruit,
Code:
["swadian_recruit","New Troop","New Troops",tf_guarantee_armor,0,0,fac_kingdom_1,[itm_custom,itm_custom2,itm_custom3,itm_custom4,itm_custom5],def_attrib|level(4),wp(60),knows_common,swadian_face_younger_1,swadian_face_middle_2],

If you still want to change the ID use notepad to find and replace the ID in the files it is called.
 
Is it possible to have different marshall titles for different factions?

Such as it being General for kingdom 1, Marshall for Kingdom 2 and so on?
 
Cozur said:
Is it possible to have different marshall titles for different factions?

Such as it being General for kingdom 1, Marshall for Kingdom 2 and so on?
Everything is possible. Just do a bunch of strings in an ordered loop, then assign the correct one based on the faction offset (naturally the strings' order is going to be the same as the factions').
 
Little problem with a Animation in NW :
Code:
				(try_begin),
					(eq,":isFixed",0),
					(agent_set_animation,":playerAgent","anim_equip_bayonet"),
						(else_try),
					(agent_set_animation,":playerAgent","anim_unequip_bayonet"),
				(try_end),

i have animations with the same name in the module_animations too, but ingame it has still a other animation as this one i want

Animations:
Code:
 ["equip_bayonet", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  [0.3, "fix", 0, 129, arf_blend_in_3],
 ##   [0.8, "equip_arms", 253, 276, arf_blend_in_0]
 ],
 ["unequip_bayonet", 0, amf_priority_equip|amf_play|amf_restart|amf_client_prediction,
  [0.3, "unfix", 0, 129, arf_blend_in_3],
 ##   [0.2, "equip_arms", 254, 250, arf_blend_in_0]
],

i dont know what should be wrong here....
 
Hey, Im trying to write a script that makes certain troops walk when spawned - it prevents them from running in battle (this is because they have very heavy armour on)

I have came up with the following but it doesn't work

slow_trig = (
    0, 0, ti_once,  [],
  [  (try_for_agents,":troop"),
      (agent_get_troop_id,":tro", ":troop"),
      (eq, ":tro", "trp_test"),
      (agent_set_speed_limit,":troop",0.1),
    ])

my trp_test is the troop i want to only be able walk (i've set them up fine and all its just the above part i need help with)

Would greatly appreciate any help given
 
Set agent_speed to 5, 0.1 is way too low, and might cause it not to work. 5 Is walking speed. And add a (try_end), because you start with try_for_agents, but don't close the try actually.
 
Hello, is there any known explanations of the send_url feature? How do I direct it to a particular URL and does it default to something? i.e localhost?
 
  File "process_parties.py", line 46
    file.write("%f %f "%(default_behavior_location[0],default_behavior_location[
1]))
    ^
IndentationError: unexpected indent

What does this mean.
I get this when I press build Module

 
Dion/Folcwar said:
  File "process_parties.py", line 46
    file.write("%f %f "%(default_behavior_location[0],default_behavior_location[
1]))
    ^
IndentationError: unexpected indent

What does this mean.
I get this when I press build Module

It means that there are too much(or not enough) spaces infront of the code. Python is quite nitpicky about those things. Just look at the amount of spaces on the code above or below it, and align the spaces infront of your code with that.
 
DirtyMorth said:
It means that there are too much(or not enough) spaces infront of the code. Python is quite nitpicky about those things. Just look at the amount of spaces on the code above or below it, and align the spaces infront of your code with that.
Wrong answer, actually.
It means that you've missed a bracked or a field delimited (comma, or some other bracket) somewhere in your module_parties.

DirtyMoth, you're right, but this is not Python. This is MABL that gets compiled by Python, and given that no one would modify process_parties (real pythonic code) without having enough knowledge of what he/she's doing and how to avoid silly errors like bad indent, I'm 100% certain that the problem is in the module code, not in the compiler. Plus, bad input for the compiler results in it throwing errors like that.
 
Malok said:
Hello, is there any known explanations of the send_url feature? How do I direct it to a particular URL and does it default to something? i.e localhost?

[font=consolas,courier](send_message_to_url, <string_id>, <encode_url>1),[/font]?


You call the operation normally like this:
[font=consolas,courier](send_message_to_url, "str_enl_version_check_url"),[/font]

Where the string is a valid URL:
[font=consolas,courier]("enl_version_check_url", "{!}http://shock.pt/enlversion"),[/font]

You will get your response, which is basically the content of the webpage, on [font=consolas,courier]script_game_receive_url_response[/font].
The game engine will split the response into a range of registers depending on type (integer or string) using the vertical bar "|" as a delimiter.
The script header has a good explanation.

I tend to send an integer from the webserver as a sort of "response ID" for added convenience like so:

Code:
("game_receive_url_response", [
  (store_script_param, ":num_integers", 1),
  (store_script_param, ":num_strings", 2),
  (try_begin),
    #Error checking
    #   Since we always send a response ID from the webserver
    # we can tell something unexpected happened when we only
    # receive a string.
    (ge, ":num_strings", 1),
    (eq, ":num_integers", 0),
    (display_message, "@^Error: Could not check for updates. "),
  (else_try),
    (eq, reg0, response_version), # response_version = 100
    (eq, ":num_strings", 0),
    (eq, ":num_integers", 4),
    
    (assign, reg4, enl_ver_major),
    (assign, reg5, enl_ver_minor),
    (assign, reg6, enl_ver_patch),
    
    (store_mul, ":cur_version", reg1, 1000),
    (store_mul, ":cur_minor", reg2, 10),
    (val_add, ":cur_version", ":cur_minor"),
    (val_add, ":cur_version", reg3),
    
    (store_mul, ":local_version", reg4, 1000),
    (store_mul, ":local_minor", reg5, 10),
    (val_add, ":local_version", ":local_minor"),
    (val_add, ":local_version", reg6),

    ...
  (else_try),
    # Define other response IDs as needed
    (eq, reg0, response_2),
    ...
  (else_try),
    # Define other response IDs as needed
    (eq, reg0, response_n),
    ...
  (try_end),
]),

In this case enlversion mentioned in the URL is a simple text file that I update manually when a new version of ENL is released but most people will most likely want to use something like php for dynamic content and interaction with a database.

1 You can enable url_encoding by setting it to 1.
 
La Grandmaster said:
Jezze said:
Set agent_speed to 5, 0.1 is way too low, and might cause it not to work. 5 Is walking speed. And add a (try_end), because you start with try_for_agents, but don't close the try actually.
You sir, are a genius  :grin:
I wish it was so :razz:. I would suggest that you use the documented header_operations of Lav, which explains a lot about the different operations and how to use them. Is a great addition, really.
 
Lumos said:
DirtyMorth said:
It means that there are too much(or not enough) spaces infront of the code. Python is quite nitpicky about those things. Just look at the amount of spaces on the code above or below it, and align the spaces infront of your code with that.
Wrong answer, actually.
It means that you've missed a bracked or a field delimited (comma, or some other bracket) somewhere in your module_parties.

DirtyMoth, you're right, but this is not Python. This is MABL that gets compiled by Python, and given that no one would modify process_parties (real pythonic code) without having enough knowledge of what he/she's doing and how to avoid silly errors like bad indent, I'm 100% certain that the problem is in the module code, not in the compiler. Plus, bad input for the compiler results in it throwing errors like that.

Ah, I see. The more you know :smile:
 
I get this error
Code:
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
Error: Unable to find object:mt_multiplayer_iv
ERROR: Illegal Identifier:mt_multiplayer_iv
also when i go ingame and try to host a game with the new gamemode(Invasion) then i get this error
6BB19281FACF190AEB422DC344026B65CF135E2E

could someone help me?
 
CTCCoco said:
The entry point limit is 127 on my map editor. Is there a way to increase it?
Lumos said:
I'd guess not or very difficult, or cmp'd have probably done it already. What I was thinking of though, is that you can probably use some unique scene props that could act as some sort of makeshift entry points. Retarded, I know, but it's the best idea I've got on this, and I do think it can work fine.
:razz:
 
Status
Not open for further replies.
Back
Top Bottom