Pocket Plane Group Logo Quest Pack Logo 2
Welcome, Guest. Please login or register.
September 02, 2010, 03:44:19 PM

Login with username, password and session length
Search:     Advanced search
PC Gamer UK calls Keto "one of our favourites."
132813 Posts in 13492 Topics by 3972 Members
Latest Member: nikjensen
* Home Help Search Login Register RSS feed
+  Pocket Plane Group
|-+  Friends and Neighbors
| |-+  Weimer Republic (WeiDU.org)
| | |-+  WeiDU (Moderators: weimer, the bigg)
| | | |-+  Functions and variables/strings that are set by other stuff
« previous next »
Pages: 1 [2] 3 4 5 Go Down Reply Print
Author Topic: Functions and variables/strings that are set by other stuff  (Read 5688 times)
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Online Online

Gender: Male
Posts: 3370


« Reply #25 on: January 08, 2010, 07:18:03 PM »
Reply with quote

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 » Logged

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - Some mods that I won't mention in public
Soundset and portrait packs: Alyx Vance (from Half-Life 2) - Jane "The Soldier" Doe (from Team Fortress 2)
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Contributions: See the PPG Modlist  Smiley
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #26 on: January 08, 2010, 07:24:21 PM »
Reply with quote

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:
// 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!
Logged
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Online Online

Gender: Male
Posts: 3370


« Reply #27 on: January 08, 2010, 07:48:29 PM »
Reply with quote

You care about readability of tp2 code? Pass the bong, man.
Logged

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - Some mods that I won't mention in public
Soundset and portrait packs: Alyx Vance (from Half-Life 2) - Jane "The Soldier" Doe (from Team Fortress 2)
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Contributions: See the PPG Modlist  Smiley
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #28 on: January 08, 2010, 08:00:27 PM »
Reply with quote

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. :-)
Logged
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Online Online

Gender: Male
Posts: 3370


« Reply #29 on: January 08, 2010, 08:08:53 PM »
Reply with quote

Meh, just picture mentally Goatse before reading TP2 code, and you won't be concerned about the lookability of tp2 anymore  Smiley

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?
Logged

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - Some mods that I won't mention in public
Soundset and portrait packs: Alyx Vance (from Half-Life 2) - Jane "The Soldier" Doe (from Team Fortress 2)
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Contributions: See the PPG Modlist  Smiley
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #30 on: January 08, 2010, 08:27:51 PM »
Reply with quote

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 » Logged
temujin.
Guest
« Reply #31 on: January 08, 2010, 09:11:12 PM »
Reply with quote

what about signed?
Logged
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #32 on: January 08, 2010, 09:13:34 PM »
Reply with quote

sealed and delivered?
Logged
baa baa boo boo
Guest
« Reply #33 on: January 08, 2010, 09:19:12 PM »
Reply with quote

READ_SSHORT
READ_SLONG
READ_SBYTE

?

THIS is only meant for unsigned?  i don't get it
Logged
Nythrun
Planewalker
*****
Offline Offline

Gender: Female
Posts: 89


« Reply #34 on: January 08, 2010, 09:31:26 PM »
Reply with quote

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?
Logged
temujin.
Guest
« Reply #35 on: January 08, 2010, 09:35:34 PM »
Reply with quote

how would this look using THIS?

WRITE_SHORT 0x18 (ABS (SSHORT_AT 0x18))
Logged
lol
Guest
« Reply #36 on: January 08, 2010, 10:42:12 PM »
Reply with quote

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_-
Logged
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #37 on: January 08, 2010, 10:58:22 PM »
Reply with quote

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 » Logged
lololol
Guest
« Reply #38 on: January 08, 2010, 11:10:24 PM »
Reply with quote

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.
Logged
aVENGER
Sneaksie!
Planewalker
*****
Offline Offline

Gender: Male
Posts: 137


« Reply #39 on: January 09, 2010, 02:28:40 AM »
Reply with quote

Sane behavior going in.

Thank you. Smiley
Logged

Retired modder

Rogue Rebalancing - Author
aTweaks - Author
BG2 Fixpack - Contributor
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Online Online

Gender: Male
Posts: 3370


« Reply #40 on: January 09, 2010, 06:44:50 AM »
Reply with quote

Quick solution: WRITE_* create STHIS as well as THIS (doing so takes me less time than arguing back and forth  Smiley ).

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).
Logged

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - Some mods that I won't mention in public
Soundset and portrait packs: Alyx Vance (from Half-Life 2) - Jane "The Soldier" Doe (from Team Fortress 2)
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Contributions: See the PPG Modlist  Smiley
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #41 on: January 09, 2010, 04:46:53 PM »
Reply with quote

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:
// 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"
Logged
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Online Online

Gender: Male
Posts: 3370


« Reply #42 on: January 09, 2010, 06:28:04 PM »
Reply with quote

Sure.
Logged

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - Some mods that I won't mention in public
Soundset and portrait packs: Alyx Vance (from Half-Life 2) - Jane "The Soldier" Doe (from Team Fortress 2)
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Contributions: See the PPG Modlist  Smiley
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #43 on: January 09, 2010, 06:54:56 PM »
Reply with quote

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.
Logged
temujin.
Guest
« Reply #44 on: January 09, 2010, 07:50:50 PM »
Reply with quote

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)
Logged
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #45 on: January 09, 2010, 10:16:28 PM »
Reply with quote

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 » Logged
temujin.
Guest
« Reply #46 on: January 09, 2010, 10:40:38 PM »
Reply with quote

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?  Huh

Logged
temujin.
Guest
« Reply #47 on: January 09, 2010, 10:48:30 PM »
Reply with quote

you n00b!  why did you edit your post?   Angry  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!  Angry
Logged
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1550


« Reply #48 on: January 09, 2010, 11:04:39 PM »
Reply with quote

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 » Logged
temujin.
Guest
« Reply #49 on: January 09, 2010, 11:58:28 PM »
Reply with quote

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....  Angry



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
Logged
Pages: 1 [2] 3 4 5 Go Up Reply Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Valid XHTML 1.0! Valid CSS!