screpl.utils.byterw module

class screpl.utils.byterw. REPLByteRW [source]

Bases: object

classmethod add_method ( method ) [source]

Dynamically add method on REPLByteRW

getoffset ( ) [source]

Returns current offset

read ( ) [source]
seekepd ( epd ) [source]
seekoffset ( ptr ) [source]
write ( val ) [source]
write_action_epd ( epd )

Write trigger action with eudplib syntax

write_aiscript ( val )
write_binary ( number ) [source]
write_bool ( value ) [source]
write_bytehex ( number ) [source]
write_condition_epd ( epd )

Write trigger condition with eudplib syntax

write_constant ( table_epd , val )
write_decimal ( number ) [source]
write_f ( fmt , * args ) [source]
Parse formatted string with python (not in-game)

and write it with EUDVariable or ConstExpr

CAUTION: This does NOT make null end

Available formats:
  • %H: hexadecimal value starts with 0x

  • %D: decimal value

  • %I8d: write_s8

  • %I16d: write_s16

  • %I32d: write_s32

  • %I8u: write_u8

  • %I16u: write_u16

  • %I32u: write_u32

  • %S: string with ptr

  • %E: string with epd

  • %C: single character

  • %:{funcname};: function call with given arguments

For example:

writer.write_f("Val%D - %:strn;...", 10, (0x57EEEB, 5))

is same to:

writer.write_strepd(EPDConstString("Val"))
writer.write_decimal(10)
writer.write_strepd(EPDConstString(" - "))
writer.write_strn(0x57EEEB, 5)
writer.write_strepd(EPDConstString("..."))

Write %% to represent %

write_hex ( number ) [source]
write_location ( val )
write_memory_table ( offset , cnt ) [source]
write_memory_table_epd ( epd_ , off_ , cnt ) [source]
write_s16 ( value ) [source]
write_s32 ( value ) [source]
write_s8 ( value ) [source]
write_scmd_action ( act )
write_scmd_action_epd ( epd )
write_scmd_condition ( cond )
write_scmd_const ( table , value )
write_scmd_trigger ( player , conditions , actions , preserved = True )

write scmd trigger

Note

This is minimalized function to utilize for boundeditor plugin. So, there are many limitations, such as assigining trigger for more than one player.

Parameters
  • player ( int , EUDVariable ) – trigger player

  • conditions ( list ) – list of Condition

  • actions ( list , tuple ) – list of Action, or tuple of (# Actions, EUDArray of actions)

write_scmd_unit ( unit )
write_str ( srcptr ) [source]
write_strepd ( srcepd ) [source]
write_string ( val )
write_strn ( srcptr , n ) [source]
write_strnepd ( srcepd , n ) [source]
write_strx_string ( strId ) [source]
write_switch ( val )
write_u16 ( value ) [source]
write_u32 ( value ) [source]
write_u8 ( value ) [source]
write_unit ( val )