Pocket Plane Group Logo MurNeth NPC mod for BG1Tutu
Welcome, Guest. Please login or register.
March 16, 2010, 01:52:30 PM

Login with username, password and session length
Search:     Advanced search
Unfinished Business 18 released! More info available on the UB site.
131346 Posts in 13306 Topics by 3849 Members
Latest Member: Kilmor of Gelnor
* Home Help Search Login Register RSS feed
+  Pocket Plane Group
|-+  Friends and Neighbors
| |-+  Weimer Republic (WeiDU.org)
| | |-+  WeiDU (Moderators: weimer, the bigg)
| | | |-+  SAY [OFFSET] #-1
« previous next »
Pages: [1] 2 Go Down Reply Print
Author Topic: SAY [OFFSET] #-1  (Read 1857 times)
Miloch
Barbarian
Planewalker
*****
Offline Offline

Gender: Male
Posts: 564



« on: October 08, 2009, 02:25:16 AM »
Reply with quote

For some reason, this doesn't work (seems to enter the largest integer possible for the offset instead). Could've sworn it used to, or at least Nythrun seemed to think so (has it in her macros).
Logged

the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Offline Offline

Gender: Male
Posts: 3191


« Reply #1 on: October 08, 2009, 06:16:19 AM »
Reply with quote

Is there any reason (except for expecting WeiDU to actually be consistent) why you can't WRITE_LONG OFFSET (0 - 1)?
Logged

Please do not contact me for assistance in using BGT, BP, any other of the 'large mods', or a mod I didn't write or contribute to. I'm not your paid support staff, so I'd suggest you to direct your help questions to the forum relative to the mod you're playing.<br /><br />Thanks for your cooperation.
GeN1e
Planewalker
*****
Offline Offline

Gender: Male
Posts: 163


« Reply #2 on: October 08, 2009, 08:14:36 AM »
Reply with quote

Yep, have run into the same thing few days earlier while testing my new library.

You can also use ~-1~.
Logged
Miloch
Barbarian
Planewalker
*****
Offline Offline

Gender: Male
Posts: 564



« Reply #3 on: October 13, 2009, 05:08:33 PM »
Reply with quote

Is there any reason (except for expecting WeiDU to actually be consistent) why you can't WRITE_LONG OFFSET (0 - 1)?
No, I thought the SAY actually worked at one point though. And maybe I expected WeiDU to be consistent. What *was* I thinking?!
Logged

the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Offline Offline

Gender: Male
Posts: 3191


« Reply #4 on: October 13, 2009, 06:18:56 PM »
Reply with quote

Now for the non-jerk reply. The code behind SAY is the same between 185 and 211. The problem is that












http://upload.wikimedia.org/wikipedia/commons/e/ee/Beet5mov1bars1to5.ogg












standard integers in OCaml are 31 bit signed integers, rather than 32 bit signed. Apparently different versions of OCaml differ in how they hande negative numbers and bitwise operation. I've forced the 'save integer to string' code to always use 32 bit integers (which are available but well-hidden), which fixed the problem.
Logged

Please do not contact me for assistance in using BGT, BP, any other of the 'large mods', or a mod I didn't write or contribute to. I'm not your paid support staff, so I'd suggest you to direct your help questions to the forum relative to the mod you're playing.<br /><br />Thanks for your cooperation.
cmorgan
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1234

Searcher of Bugs


« Reply #5 on: October 13, 2009, 08:35:04 PM »
Reply with quote

*perfect* clip *)
Logged
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Offline Offline

Gender: Male
Posts: 3191


« Reply #6 on: October 14, 2009, 06:21:43 AM »
Reply with quote

Actually, Beethoven's 5th symphony isn't nearly ominous enough to introduce the idea of 31 bit integers, but I couldn't think of anything better.
Logged

Please do not contact me for assistance in using BGT, BP, any other of the 'large mods', or a mod I didn't write or contribute to. I'm not your paid support staff, so I'd suggest you to direct your help questions to the forum relative to the mod you're playing.<br /><br />Thanks for your cooperation.
cmorgan
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1234

Searcher of Bugs


« Reply #7 on: October 14, 2009, 06:46:32 AM »
Reply with quote

You could try movie soundtracks from "Jaws", "The Shining", or perhaps even "The Twilight Zone" Cheesy
Logged
Miloch
Barbarian
Planewalker
*****
Offline Offline

Gender: Male
Posts: 564



« Reply #8 on: October 14, 2009, 11:25:43 AM »
Reply with quote

Perhaps the Geto Boys' timeless classic "Still" (the theme played during the printer/fax machine baseball-bat-bashing in the movie "Office Space").
Logged

temujin
Planewalker
*****
Offline Offline

Posts: 48



« Reply #9 on: October 14, 2009, 10:40:24 PM »
Reply with quote

I think this nice little Bambi music would also be appropriate.
Logged
Nythrun
Planewalker
*****
Offline Offline

Gender: Female
Posts: 89


« Reply #10 on: January 08, 2010, 02:41:29 AM »
Reply with quote

Nythrun seemed to think so (has it in her macros).

I never. SAY is solely for adding new strings, and has been since the .tp2/.d grammar split Smiley
Logged
Miloch
Barbarian
Planewalker
*****
Offline Offline

Gender: Male
Posts: 564



« Reply #11 on: January 08, 2010, 04:26:05 PM »
Reply with quote

Nythrun seemed to think so (has it in her macros).
I never. SAY is solely for adding new strings, and has been since the .tp2/.d grammar split
I dunno, maybe it was something Yovaneth added then. I think I was working with a version of this code which, no, does not seem to have that syntax in its original form.

Speaking of which, do we have a macro that does this yet (adds an animation entry to an area) maybe in the last batch added? If not, is it something we can macroise/functionise?
Logged

the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Offline Offline

Gender: Male
Posts: 3191


« Reply #12 on: January 08, 2010, 04:33:25 PM »
Reply with quote

Since I'm the usual lazy asshole I'm not going to code macros for handling ARE files, but if you code (and test) them up I have no problems with adding them to 214.
Logged

Please do not contact me for assistance in using BGT, BP, any other of the 'large mods', or a mod I didn't write or contribute to. I'm not your paid support staff, so I'd suggest you to direct your help questions to the forum relative to the mod you're playing.<br /><br />Thanks for your cooperation.
cmorgan
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1234

Searcher of Bugs


« Reply #13 on: January 10, 2010, 11:40:48 AM »
Reply with quote

Sorry, late to the party, but either Smoketest or devSin taught me back in the day

    WRITE_LONG INITIAL_MEETING (BNOT 0x0) // BLANKING SOUNDS

as a fancier looking code-guru-like way of doing it.
Logged
Miloch
Barbarian
Planewalker
*****
Offline Offline

Gender: Male
Posts: 564



« Reply #14 on: January 10, 2010, 06:02:34 PM »
Reply with quote

(BNOT 0x0)... fancier looking...
"Fancier looking"? Like the bigg said... pass the bong.

Why wouldn't you just use (0 - 1) or ~-1~ if you want to set them to -1, which it appears you want to do?
Logged

the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Offline Offline

Gender: Male
Posts: 3191


« Reply #15 on: January 10, 2010, 07:04:58 PM »
Reply with quote

BNOT 0 is a cool trick if you don't know 2-complement notation  Cheesy
Logged

Please do not contact me for assistance in using BGT, BP, any other of the 'large mods', or a mod I didn't write or contribute to. I'm not your paid support staff, so I'd suggest you to direct your help questions to the forum relative to the mod you're playing.<br /><br />Thanks for your cooperation.
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1479


« Reply #16 on: January 10, 2010, 07:51:39 PM »
Reply with quote

yawn
« Last Edit: January 10, 2010, 07:58:12 PM by devSin » Logged
temujin.
Guest
« Reply #17 on: January 10, 2010, 08:36:50 PM »
Reply with quote

Quote
« Last Edit: Today at 07:58:12 PM by devSin »

Cheesy

<3 devSin
Logged
cmorgan
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1234

Searcher of Bugs


« Reply #18 on: January 10, 2010, 10:17:50 PM »
Reply with quote

As a working musician, I know lots of notation, but don't get "complements"... (that is a pun, or feeble wordplay humor, for you ESL folks!)
Logged
GeN1e
Planewalker
*****
Offline Offline

Gender: Male
Posts: 163


« Reply #19 on: January 11, 2010, 05:24:38 AM »
Reply with quote

Quote
Speaking of which, do we have a macro that does this yet (adds an animation entry to an area) maybe in the last batch added? If not, is it something we can macroise/functionise?
Code:
// writing macro, can later be used for other ADD_STUFF functions
DEFINE_PATCH_MACRO wpt_wo BEGIN
  LPM ~wpt_lo_%ext%_%obj%~
  PHP_EACH $wpt_lo("%ext%""%obj%""nam") AS ind => res BEGIN
    PATCH_IF VARIABLE_IS_SET res BEGIN
      len=$wpt_lo("%ext%""%obj%""len""%ind%")
      off=$wpt_lo("%ext%""%obj%""off""%ind%")+offset
      PATCH_IF len=1 BEGIN WRITE_BYTE  off EVAL ~%res%~ END
      PATCH_IF len=2 BEGIN WRITE_SHORT off EVAL ~%res%~ END
      PATCH_IF len=4 BEGIN WRITE_LONG  off EVAL ~%res%~ END
      PATCH_IF (len!=1)&(len!=2)&(len!=4) BEGIN WRITE_ASCIIE off EVAL ~%%res%%~ (len) END
    END
  END
END


// loading offsets
DEFINE_PATCH_MACRO wpt_lo_are_anima BEGIN
  DEFINE_ARRAY wpt_lo_are_anima_nam BEGIN name position_X position_Y schedule bam_source flags position_Z loop END
  DEFINE_ARRAY wpt_lo_are_anima_off BEGIN 0x0  0x20       0x22       0x24     0x28       0x34  0x38       0x3e END
  DEFINE_ARRAY wpt_lo_are_anima_len BEGIN 32   2          2          4        8          4     2          1    END
END


// launcher itself
DEFINE_PATCH_FUNCTION add_area_animation
  INT_VAR
    flags=1+4
    schedule=`0
    loop=100
BEGIN
  LPM wapt_Q_ARE_InitVars    //launch variable initiation macro
  LPM wapt_Q_AREAdd_InitVars //launch variable initiation macro for adding new sections
  Q_New_Anima=1
  LPM wapt_Q_AREAdd_Process  //launch macro that adds new space for above listed entries
  offset=Q_NewOffset_Anima   // from where we'll do writing
  SPRINT ext are
  SPRINT obj anima
  LPM wpt_wo
END
Does it need more writable offsets? Nythrun's list, AG's list or IESDP.

Miloch, you go ahead and test it. I know you love testing Smiley
Though I see no reason it shouldn't work, the writing macro is from my personal lib and was working reliably.
Code:
COPY_EXISTING ar0500.are override
  LPF add_area_animation
    INT_VAR
 flags=7
 position_X=2400
 position_Y=1400
 position_Z=85
    STR_VAR
 name=ag_test_anima
 bam_source=fire_3
  END
BUT_ONLY
Logged
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1479


« Reply #20 on: January 11, 2010, 12:03:36 PM »
Reply with quote

BNOT 0 is a cool trick if you don't know 2-complement notation  :D
OK, I don't understand this. With TP2 syntax and a determinate data size, it's simple to express -N as BNOT N-1 (e.g., `0 is -1, or Miloch's version of fancy ~-1~ about as fancy as a cow's rear, or "all bits," which is what we really mean with a null strref).

I call bullshit that you actually had a point there. TP2 CODE OR IT DIDN'T HAPPENZ!
Logged
the bigg
The Avatar of Fighter / Thieves
Moderator
Planewalker
*****
Offline Offline

Gender: Male
Posts: 3191


« Reply #21 on: January 11, 2010, 12:46:02 PM »
Reply with quote

2-complement means that "0 - x" is expressed as "(` x) + 1".
Logged

Please do not contact me for assistance in using BGT, BP, any other of the 'large mods', or a mod I didn't write or contribute to. I'm not your paid support staff, so I'd suggest you to direct your help questions to the forum relative to the mod you're playing.<br /><br />Thanks for your cooperation.
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1479


« Reply #22 on: January 11, 2010, 03:40:52 PM »
Reply with quote

Like I said, how is `(x-1) a "cool trick" over `1 + 1 at a fixed data size?

E.g., if I want to WRITE_SHORT -126, your implication was that two's-complement would give me something "cooler" than `125?
WHAT COULD BE COOLER THAN `125?

I expect some uber pwnage when you make a statement like "BNOT 0 is a cool trick if you don't know 2-complement notation."



I caught GeN1e stalking pamela123, checking out her profile. You want to ask her out, don't you, GeN1e?
You should. She goes down on the first date.
« Last Edit: January 11, 2010, 03:45:48 PM by devSin » Logged
GeN1e
Planewalker
*****
Offline Offline

Gender: Male
Posts: 163


« Reply #23 on: January 11, 2010, 04:24:34 PM »
Reply with quote

Quote
I caught GeN1e stalking pamela123, checking out her profile.
I thought you were ranking a mere member here, no? Or how can you be knowning if I was checking out a specific profile?

Besides, dev, don't you think you're taking it too far? We all are one big family and we all understand if you can't resist the urge to try and get rough with every underteen slut that comes to PPG, but surely ascribing your perverted carnal desires to me as a form of revenge for me robbing your grandma (hey, that was your suggestion, not mine!) of the photo of you and temujin making out is going beyond all norms assumed in any decent society.
Logged
devSin
Planewalker
*****
Offline Offline

Gender: Male
Posts: 1479


« Reply #24 on: January 11, 2010, 04:44:29 PM »
Reply with quote

but surely ascribing your perverted carnal desires to me as a form of revenge for me robbing your grandma (hey, that was your suggestion, not mine!) of the photo of you and temujin making out is going beyond all norms assumed in any decent society.
Yeah, that's what I thought.

You been busted, boy! Got caught with your hands in the cookie jar.

But don't feel bad. pamela123's got space for lots of hands.
Logged
Pages: [1] 2 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!