Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: devSin
« on: February 18, 2010, 03:22:53 PM »

All looks to work now.
Posted by: the bigg
« on: February 18, 2010, 05:30:32 AM »

Doh.
Posted by: devSin
« on: February 17, 2010, 08:43:56 PM »

THIS/STHIS
It looks like this only works the first time eval fails (e.g., afterward, THIS & STHIS are always set to something and never updated again)?
Posted by: devSin
« on: February 17, 2010, 07:58:56 PM »

I'm half/half on EVALUATED (the string has to be "%%" for evaluation, right?) since everything I do is non-eval; how is it handled in normal WRITE_ASCII (it should be the same for L, just sticking a bunch in one command).

What is e1 in that context? It is kind of sad-looking in any case, yeah.

EDIT: ah, it's where, now that I looked at the diffs, duh.

Did you decide to switch the inc/dec postfix to prefix (I guess it'll still be sort of useful, just horrendously painful to use)?
Posted by: the bigg
« on: February 17, 2010, 07:21:55 PM »

THIS/STHIS and WRITE_ASCII_LIST coded (the latter is EVALUATED).

Fun snippet of the day:

Code: [Select]
Array.to_list (Array.mapi (fun i x ->
  Tp.TP_PatchASCII(Tp.PE_Add(Tp.PE_Mul(Tp.get_pe_int (string_of_int i), Tp.get_pe_int "8"), e1), x, true, Some (Tp.get_pe_int "8"))
  ) (Array.of_list e2))

I don't know what should I comment first: having to write e1 + i * 8 in 50 characters because of dumb absence of casting, or having to use array_to_list array.mapi array_of_list since list.mapi wasn't available.
Posted by: devSin
« on: February 16, 2010, 05:19:14 PM »

Sigh. I hate life.

++misery
Posted by: the bigg
« on: February 16, 2010, 02:46:48 PM »

Looks like it'll work:

| ['0'-'9''A'-'Z''a'-'z''_']['0'-'9''A'-'Z''a'-'z''#''_''-''.''\'']*
Posted by: devSin
« on: February 16, 2010, 01:56:22 PM »

What TP2s that you know aren't in English? They can suck it. :-)
But yeah, I would fight against it. The language is already enough of a cosmic joke as-is.

Would the prefix work (wouldn't still just eat --i as "--i" or does it have to be \w first then can be - or # or whatever without quote)? Prefix is kind of fugly, but what can you do, I guess.
Posted by: the bigg
« on: February 16, 2010, 03:41:08 AM »

But I think you'll still need to console me with THIS and WRITE_ASCIIL so I don't go completely apeshit.
they're coming up, I'm just a bit on hiatus.

Quote
You should remove -- since it's so flaky.
...or make ++ and -- be prefix  ;)

Quote
Or maybe we can switch to 8-bit characters (pick an encoding) and use en-dashes instead of dashes... ;-)
Not if I want all dirty ignorant subhuman masses people not playing in English to get angry at me.
Posted by: devSin
« on: February 16, 2010, 03:13:55 AM »

Yeah, similar happened when Wes originally tried to use ~ for BNOT.

But I think you'll still need to console me with THIS and WRITE_ASCIIL so I don't go completely apeshit.

You should remove -- since it's so flaky. Or maybe we can switch to 8-bit characters (pick an encoding) and use en-dashes instead of dashes... ;-)
Posted by: the bigg
« on: February 16, 2010, 01:51:22 AM »

All I can do about this is laugh at the state of things as I inherited them.  :)
Posted by: devSin
« on: February 16, 2010, 12:57:44 AM »

'--' doesn't actually work (without a space after var) since it takes as a string first (but ++ works as expected, useless as that one is). Lame.
Posted by: Wisp
« on: January 26, 2010, 12:01:02 PM »

Okay, thanks.
Posted by: wut
« on: January 25, 2010, 03:56:53 PM »

STR_VAR dmg_input = EVAL "%desc1%"
Posted by: Wisp
« on: January 25, 2010, 03:16:12 PM »

If sane function behaviour goes in, I've a little problem to report.

Test case:
Code: [Select]
OUTER_PATCH ~12~ BEGIN                                                                                         
  WRITE_BYTE 1 0x09
  READ_ASCII 1 tab (1)  // 0x09, tab
END
OUTER_SPRINT null ""

DEFINE_PATCH_FUNCTION change_damage INT_VAR change_ab = 1 RET dmg_output BEGIN
  READ_LONG  0x64 ab_off
  READ_SHORT 0x68 num_ab
  FOR (i=0;i<num_ab;i+=1) BEGIN
    READ_SHORT ab_off + 0x38*i ab_type ELSE 999
    PATCH_IF ab_type = change_ab BEGIN
      WRITE_SHORT ab_off + 0x38*i + 0x16 size
      WRITE_SHORT ab_off + 0x38*i + 0x18 dice
    END
  END
  SPRINT thac0 thac0 //@0
  SPRINT thaco thaco //@1
  SPRINT damage Damage //@3
  INNER_PATCH_SAVE dmg_output "%dmg_input%" BEGIN
    REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH "%thaco%" "%thac0%"
    REPLACE_TEXTUALLY CASE_INSENSITIVE EVALUATE_REGEXP "^%damage%:?[ %tab%%null%]+[0-9]+d[0-9]+" "%damage%: %dice%d%size%"
  END
END

COPY_EXISTING sw1h43.itm override
  READ_STRREF 0x50 desc1
  //SPRINT dmg_input "%desc1%"
  LPF change_damage INT_VAR size = 4 dice = 2 STR_VAR dmg_input = "%desc1%" RET desc2 = dmg_output END
  SAY_EVALUATED 0x54 "%desc2%"
BUT_ONLY

Using STR_VAR to pass the string variable to the function sets desc2 to the unaltered description. Setting dmg_input with SPRINT makes the function correctly return the altered description as desc2.

Am I doing something wrong or is this functionality missing for whatever reason?