Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
KnightV said:
Lua error: attempt to call a nil value  - so what does it mean? How to fix the issue?

It means you are trying to use a value as an operation, aka a non-existent operation

Something like this

Code:
(assign, reg2, str_store_troop_name),
(reg2, s5, "trp_player"),
 
Efe Karacar said:
KnightV said:
Lua error: attempt to call a nil value  - so what does it mean? How to fix the issue?

It means you are trying to use a value as an operation, aka a non-existent operation

Something like this

Code:
(assign, reg2, str_store_troop_name),
(reg2, s5, "trp_player"),

Could it cause crash in the battle ? It is something interesting as i am using PBOD scripts . I don't think they could be wrong
 
Hey again,

Getting a really strange error when I try to compile:

*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... DONE.
Allocating identifiers... DONE.
Compiling module... FAILED.
COMPILER INTERNAL ERROR:
Traceback (most recent call last):
  File "compile.py", line 310, in <module>
    entities[index] = entity_def['processor'](entities[index], index)
  File "C:\Users\Joe\Desktop\Mod Sys w WRECK\Source\compiler.py", l
ine 1202, in process_mission_templates
    try: output.append('%f %f %f  %s  %s ' % (t0, t1, t2, parse_module_code(scri
pt1, 'mt.%s(#%d).%s.condition' % (e[0], index, trigger_to_string(t0))), parse_mo
dule_code(script2, 'mt.%s(#%d).%s.body' % (e[0], index, trigger_to_string(t0))))
)
  File "C:\Users\Joe\Desktop\Mod Sys w WRECK\Source\compiler.py", l
ine 1488, in parse_module_code
    raise MSException('failed to parse operand %r for operation %s in %s on line
%d' % (operand, opcode_to_string(command[0]), script_name, index+1), *e.args)
  File "C:\Users\Joe\Desktop\Mod Sys w WRECK\Source\compiler.py", l
ine 1379, in opcode_to_string
    if opcode & this_or_next: result.append('this_or_next')
TypeError: unsupported operand type(s) for &: 'str' and 'int'


COMPILATION FAILED.

Displaying W.R.E.C.K. performance information.
Use show_performance_data = False directive in module_info.py file to disable.

    2.632 sec spent to load module data.
    0.001 sec spent to load plugins.
    0.883 sec spent to check module syntax.
    0.274 sec spent to allocate identifiers.
    1.456 sec spent to compile module.

    >>> 5.258 sec total time spent. <<<

Press any key to continue . . .

Anyone got any ideas on what it could mean?
 
Guitarma said:
Getting a really strange error when I try to compile:

Code:
ine 1202, in process_mission_templates

you have a syntax error on your code as indicated above. It breaks the parser. Find your last changes, fix it, recompile.
 
Code:
if opcode & this_or_next: result.append('this_or_next')
TypeError: unsupported operand type(s) for &: 'str' and 'int'

seems like you typed a string ("something") where the ms expected an operation (something)
 
I'm trying to teleport bots to a particular position at a certain point in the round. I have been using the (try_for_agents, ":agent"), the only issue is it only teleports one or a couple of bots. Is there a way to make sure you are selecting all of the bots/agents?
 
I'm trying to improve the performance of ACOK on the world map, as it has a tendency to stutter a bit much, while at the same time also having some weird pathfinding for the player character.

What are the most common reasons for the two above?
 
simple triggers with huge loops could case stuttering.
one thing I`ve seen to fix that is to break down the loop into several (ie: trigger that does half the parties every day instead of all parties every other day)
 
PitchPL said:
pete99 said:
I'm trying to teleport bots to a particular position at a certain point in the round. I have been using the (try_for_agents, ":agent"), the only issue is it only teleports one or a couple of bots. Is there a way to make sure you are selecting all of the bots/agents?


show full code

(1, 0, 0, [
(multiplayer_is_server),
(store_mission_timer_a, ":current_time"),
                (store_sub, ":seconds_past_in_round", ":current_time", "$g_round_start_time"),
                (eq, ":seconds_past_in_round", 22),
                (neq, ":seconds_past_in_round", "$g_multiplayer_round_max_seconds"),],

[
(try_begin),
    (scene_prop_get_num_instances, ":num_instances_of_scene_prop", "spr_barrier_cone"),
    (try_for_range, ":cur_prop_instance", 0, ":num_instances_of_scene_prop"),
      (scene_prop_get_instance, ":prop_instance_id", "spr_barrier_cone", ":cur_prop_instance"),
(scene_prop_get_instance, ":effected_object_instance_id", "spr_barrier_cone", ":cur_prop_instance"),
(prop_instance_get_starting_position, pos8, ":effected_object_instance_id"),
    (try_end),
  (try_for_agents, ":cur_agent"),
      (neg|agent_is_human,":cur_agent"),
      (agent_is_alive,":cur_agent"),
(agent_set_position,":cur_agent",pos:cool:,
(try_end),
(try_end),
]),
 
      (neg|agent_is_human,":cur_agent"),  = Only Horses


Code:
agent_is_human                           = 1704  # (agent_is_human, <agent_id>),
                                                 # Checks that the agent is human (i.e. not horse).
 
Cozur said:
I'm trying to improve the performance of ACOK on the world map, as it has a tendency to stutter a bit much, while at the same time also having some weird pathfinding for the player character.

What are the most common reasons for the two above?

I recently had a similar problem on a much smaller Warband map than your ACOK one. It had a lot of impassable mountain terrain simulating city streets. However, as they were just barriers as opposed to real mountains they were flat. AI seemed to move ok, but the player stuttered and would ignore movement clicks on passable terrain too frequently. This problem only disappeared when I elevated the blocking/mountain terrain fractionally. It was as if having different elevations assisted the player’s pathfinding algorithm - possibly allowing a number of options to be quickly discounted.
 
Cozur said:
I'm trying to improve the performance of ACOK on the world map, as it has a tendency to stutter a bit much, while at the same time also having some weird pathfinding for the player character.

What are the most common reasons for the two above?

look at VC and how they changed the big triggers (stuff like economy) from a single event (once a day/week), to something that happens often (say every second, but only one party/NPC/etc at time). By using a new distribution of resources they managed to eliminate the lag on world map (as VC has dozens of kingdoms, hundreds of centers, NPCs, etc).

example:
Code:
 #walled centers weekly ON AVERAGE
  (1.4,
    [
      #Party AI: pruning some of the prisoners in each center (once a week)
      (store_random_in_range, ":center_no", walled_centers_begin, walled_centers_end),
 

if you have any trigger causing lag (easy to test, as you can run them by themselves and see the impact), that is a easy way to fix it.
 
Someone suggested I should post this here instead.

So....

How do you edit NPC relation to one another?, like how would I make Lord Irya always be the brother of Lord Aedin?.

Is there any way I can edit already existing relationships?, like making Klagrus no longer the father of Beranz.

Also I would appreciate if someone could tell me how to make custom relationships like in Diplomacy with Sanjar Khan
Hmhzb.png

(NOT SAVEGAME EDITING, I AM USING THE MODSYS)
 
Cozur said:
kalarhan said:
if you have any trigger causing lag (easy to test, as you can run them by themselves and see the impact), that is a easy way to fix it.

How?

likely you dont know how to profile a C app, so just use the easy route of changing your modsys. Disable (as in, remove) triggers and see which ones slow things down. You should have a good grasp about which ones are the likely offenders, so it shouldnt take more than 1 hour to have a complete list for your triggers impact.
 
Status
Not open for further replies.
Back
Top Bottom