Author Topic: Functions and variables/strings that are set by other stuff  (Read 18291 times)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #25 on: January 08, 2010, 07:18:03 PM »
Just post (it's probably going to end up being OK separated by whitespace, though, isn't it?
Why should whitespace matter?

Quote
Just to clarify, I'm having THIS = 'where' of the calling action to use in the value (maybe if you pass it in as part of the patch action? it can't be a generic PE value, can it?), so that I can WRITE_BYTE 0x8 THIS | 0x1 instead of WRITE_LONG 0x1e LONG_AT 0x1 SHORT_UNDER 0xe BYTE_OVER 0x1e ^^ 1234456.
Yeah, I guessed that THIS = SHORT_AT offset. It's trivial to have WRITE_* offset what perform a READ_* offset THIS before doing its work.

Wes
COPY_RANDOM.
« Last Edit: January 08, 2010, 07:23:58 PM by the bigg »
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #26 on: January 08, 2010, 07:24:21 PM »
Why should whitespace matter?
Because it's hard to read? I'm not sure what you're asking, but I don't want to see everybody and anybody a year from now posting big fat codeboxes with 'duration ++' and 'count --' and
Code: [Select]
// Let's set up our variables
var1      += 0x1a
var2      -= a + b
var3      ++
would really just piss me off.

I added more to that last post against pre-init FUNCTIONS. Viva la resistance!

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #27 on: January 08, 2010, 07:48:29 PM »
You care about readability of tp2 code? Pass the bong, man.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #28 on: January 08, 2010, 08:00:27 PM »
Not so much readability as "lookability," I guess.

The popular TP2 coding styles have gotten so bad that I can hardly stand to look at them anymore, much less pay attention to what they're supposed to be doing. :-)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #29 on: January 08, 2010, 08:08:53 PM »
Meh, just picture mentally Goatse before reading TP2 code, and you won't be concerned about the lookability of tp2 anymore  :)

Also:
Quote
Quote
Just to clarify, I'm having THIS = 'where' of the calling action to use in the value (maybe if you pass it in as part of the patch action? it can't be a generic PE value, can it?), so that I can WRITE_BYTE 0x8 THIS | 0x1 instead of WRITE_LONG 0x1e LONG_AT 0x1 SHORT_UNDER 0xe BYTE_OVER 0x1e ^^ 1234456.
Yeah, I guessed that THIS = SHORT_AT offset. It's trivial to have WRITE_* offset what perform a READ_* offset THIS before doing its work.
Dat OK?
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #30 on: January 08, 2010, 08:27:51 PM »
Basically, as long as THIS is equivalent to the value of whatever offset being written to (at the size we're writing).

WRITE_LONG eo + 0x9a 0x12 -> THIS = READ_LONG eo + 0x9a
WRITE_BYTE 0x18 f | 0x1 -> THIS = READ_BYTE 0x18
WRITE_ASCIIT 0x12 + 43 / 1 * 5 + (eo - i) hey -> THIS = error?
WRITE_SHORT 0x12 + 43 / 1 * 5 + (eo - i) -> THIS = READ_SHORT 0x12 + 43 / 1 * 5 + (eo - i)

e.g.,

READ_BYTE 0x18 f
WRITE_BYTE 0x18 f | 0x1

is equivalent to

WRITE_BYTE 0x18 BYTE_AT 0x18 | 0x1

is equivalent to

WRITE_BYTE 0x18 THIS | 0x1
« Last Edit: January 08, 2010, 08:29:30 PM by devSin »

temujin.

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #31 on: January 08, 2010, 09:11:12 PM »
what about signed?

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #32 on: January 08, 2010, 09:13:34 PM »
sealed and delivered?

baa baa boo boo

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #33 on: January 08, 2010, 09:19:12 PM »
READ_SSHORT
READ_SLONG
READ_SBYTE

?

THIS is only meant for unsigned?  i don't get it

Offline Nythrun

  • Planewalker
  • *****
  • Posts: 89
  • Gender: Female
Re: Functions and variables/strings that are set by other stuff
« Reply #34 on: January 08, 2010, 09:31:26 PM »
There's no WRITE_S* , so that can't matter. READ_S* is only so you can be lazy with patch expressions anyway (and READ_SLONG == READ_LONG).

I can hardly stand to look at them anymore

When did you start reading other people's code?

temujin.

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #35 on: January 08, 2010, 09:35:34 PM »
how would this look using THIS?

WRITE_SHORT 0x18 (ABS (SSHORT_AT 0x18))

lol

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #36 on: January 08, 2010, 10:42:12 PM »
Exactly how you wrote it?

Or WRITE_SHORT 0x18 THIS >> 15 ? ` THIS + 1 : THIS

Or WRITE_SHORT this_is_less_useful_than_inlined_files_named_only_-

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #37 on: January 08, 2010, 10:58:22 PM »
When did you start reading other people's code?
What is this? I can't tell if it's code or post.

It must be code because I didn't read it. :P

WRITE_SHORT 0x18 (ABS (SSHORT_AT 0x18))
You shouldn't ever have cause to do this.
« Last Edit: January 08, 2010, 10:59:58 PM by devSin »

lololol

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #38 on: January 08, 2010, 11:10:24 PM »
Quote
Exactly how you wrote it?

so you're saying

WRITE_SHORT 0x18 ((ABS (SSHORT_AT 0x18)) * blah)

is equivalent to

WRITE_SHORT 0x18 ((ABS (THIS)) * blah)

which, in turn, is equivalent to

WRITE_SHORT 0x18 ((ABS (SHORT_AT 0x18)) * blah)

?


Quote
Or WRITE_SHORT 0x18 THIS >> 15 ? ` THIS + 1 : THIS

uh... i don't see how this is an improvement on "lookability" when you're spamming the line with multiple THISes.



Quote
You shouldn't ever have cause to do this.
That's what they all say... but you never know.

Offline aVENGER

  • Planewalker
  • *****
  • Posts: 143
Re: Functions and variables/strings that are set by other stuff
« Reply #39 on: January 09, 2010, 02:28:40 AM »

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #40 on: January 09, 2010, 06:44:50 AM »
Quick solution: WRITE_* create STHIS as well as THIS (doing so takes me less time than arguing back and forth  :) ).

Please note that WRITE_SBYTE/SSHORT does the same thing as the non-signed variety, and that STHIS + 5 or STHIS | 3 does the same thing as the non-signed variety (but they're still needed if you need intuitive comparison/multiplication/bit shift).
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #41 on: January 09, 2010, 04:46:53 PM »
How about WRITE_ASCII_LIST (WRITE_ASCIIL): for each string N0-... in space-delimited list, WRITE_ASCII where + 8 * N string #8 (using whatever the standard non-EVALUATED behavior is).
Code: [Select]
// Version 213
COPY_EXISTING OOMPAH.CRE OVERRIDE
WRITE_ASCII 0x248 BLOW #8
WRITE_ASCII 0x250 UP #8
WRITE_ASCII 0x258 GO #8
WRITE_ASCII 0x260 BOOM #8
//WRITE_ASCII 0x268 WTFSIGHT #8
WRITE_ASCII 0x268 "3-2-1-0" #8

// Version 214
COPY_EXISTING OOMPAH.CRE OVERRIDE
WRITE_ASCIIL 0x248 BLOW UP GO BOOM /* WTFSIGHT */ "3-2-1-0"

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #42 on: January 09, 2010, 06:28:04 PM »
Sure.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #43 on: January 09, 2010, 06:54:56 PM »
Dude, if we make it up to 250, I'm going to be like "Just build my fucking TP2 into WeiDU and install it with the --devsin switch." ;-)

Thanks. I hate having to do WRITE_ASCII too many times in a row.

temujin.

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #44 on: January 09, 2010, 07:50:50 PM »
can I have a look inside your TP2, dev?  

i wanna see what exactly it is that you're coding that's making you lazier by the minute with these funny abbreviated requests.



and what good is WRITE_ASCIIL if you don't want to EVALUATE the strings inside?  
(not a request, just a question)

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #45 on: January 09, 2010, 10:16:28 PM »
Ack, there's nothing here you want to see, trust me.

The feature will be useful to me. As with lots of my suggestions, that will probably be the extent of its use, but hey, I can't complain. I've had the good fortune to be very well taken care of here.
« Last Edit: January 09, 2010, 10:21:38 PM by devSin »

temujin.

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #46 on: January 09, 2010, 10:40:38 PM »
Quote
I think I'm under 60K lines of TP2 (not counting the 1500 scripts and 700 dialogues compiled at install)

yes, but what are these scripts and dialogues about?  What have you been working on for more than half a decade of WeiDU usage?

I would still like to see it, please (for learning purpose at least).  Especially your local fixpack changes.

...unless you're too shy to share it with others?  ???


temujin.

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #47 on: January 09, 2010, 10:48:30 PM »
you n00b!  why did you edit your post?   >:(  That was some interesting stuff you said.



sigh.. anyway,

Quote
The feature will be useful to me. As with lots of my suggestions, that will probably be the extent of its use, but hey, I can't complain. I've had the good fortune to be very well taken care of here.

I was just messing you, Dev.  I'd be lying if I said I wouldn't use THIS or THAT or HERE or THERE or whatever fancy idea you come up with.



ok, I'm going to bed now.  Don't do something dumb like post a long response, then change your mind and delete it.  

Insecure n00b!  >:(

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Functions and variables/strings that are set by other stuff
« Reply #48 on: January 09, 2010, 11:04:39 PM »
What have you been working on for more than half a decade of WeiDU usage?
Just changes to the game. Nothing that has ever intended to be public (I'm not working on some Birthright TC or whatever, with corresponding BiTCh Editor Supreme!).

Especially your local fixpack changes.
I don't have changes for any public mods, sorry. There'll probably be a rotation in the next couple months where I post links to two of my TP2s; I try to make sure they're accessible at least once a year.

ok, I'm going to bed now.  Don't do something dumb like post a long response, then change your mind and delete it.
You can't delete posts here. Otherwise, there'd be far fewer posts from me. ;-)

Oh, yeah: you missed it all! Sucks to be you!
« Last Edit: January 09, 2010, 11:31:38 PM by devSin »

temujin.

  • Guest
Re: Functions and variables/strings that are set by other stuff
« Reply #49 on: January 09, 2010, 11:58:28 PM »
Oh, yeah: you missed it all! Sucks to be you!

I LIED!  I wasn't going to bed.  Cause I knew you would do exactly what I thought you would do.


Fool me once....  >:(



Everyone,

this is exactly what devSin originally said before the insecure n00b suddenly changed his mind and edited his most recent post.


yes, but what are these scripts and dialogues about?  What have you been working on for more than half a decade of WeiDU usage?
They're all vanilla. There's nothing original coming from this end, I assure you. Take a look at the resource list in NI some time and pick a script to look at. It's extremely likely there's some reason I had to change something about that script you're looking at (and our BCS patching tools were and still are shit, so I just compile the whole thing; I remember years and years ago when I had like 4,000 REPLACE_BCS_BLOCK part-files, what a nightmare to deal with).

Some day, I'll leave, and all the stuff will be posted somewhere. Until then, it's not finished, although I occasionally link to the TP2's (which have been available online for over half a decade, if you can find them), and I'd rather make an edit here or change a line there than blab to the world about crap that's older than dirt.

If you were the author of DSotSC, and you never released your work but slowly kept working at it, do you think you actually have the courage to show it to anybody now? Fuck no, you wouldn't!

I would still like to see it, please (for learning purpose at least).  Especially your local fixpack changes.
My local fixpack. I don't have any version of the official of anything, and nothing that could be adapted for quick use with anything, sorry. I implement my own changes, with bare hands and sweat. And lots and lots of blow.

And when I run out of coke, I whore out that skanky slut pamela123 to get some candy money for her daddy.



ok, now I'm REALLY going to bed.  I don't care if you retell War and Peace, or reveal who really killed JFK, or whatever.  I gotta wake up early.


good night, dev.

<3

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

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:
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)?: