Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: Miloch on October 08, 2009, 02:25:16 AM

Title: SAY [OFFSET] #-1
Post by: Miloch on October 08, 2009, 02:25:16 AM
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).
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on October 08, 2009, 06:16:19 AM
Is there any reason (except for expecting WeiDU to actually be consistent) why you can't WRITE_LONG OFFSET (0 - 1)?
Title: Re: SAY [OFFSET] #-1
Post by: GeN1e on October 08, 2009, 08:14:36 AM
Yep, have run into the same thing few days earlier while testing my new library.

You can also use ~-1~.
Title: Re: SAY [OFFSET] #-1
Post by: Miloch on October 13, 2009, 05:08:33 PM
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?!
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on October 13, 2009, 06:18:56 PM
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 (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.
Title: Re: SAY [OFFSET] #-1
Post by: cmorgan on October 13, 2009, 08:35:04 PM
*perfect* clip *)
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on October 14, 2009, 06:21:43 AM
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.
Title: Re: SAY [OFFSET] #-1
Post by: cmorgan on October 14, 2009, 06:46:32 AM
You could try movie soundtracks from "Jaws", "The Shining", or perhaps even "The Twilight Zone" :D
Title: Re: SAY [OFFSET] #-1
Post by: Miloch on October 14, 2009, 11:25:43 AM
Perhaps the Geto Boys' timeless classic "Still" (the theme played during the printer/fax machine baseball-bat-bashing in the movie "Office Space").
Title: Re: SAY [OFFSET] #-1
Post by: temujin on October 14, 2009, 10:40:24 PM
I think this nice little Bambi music (http://www.youtube.com/watch?v=BTpa9j60Npg) would also be appropriate.
Title: Re: SAY [OFFSET] #-1
Post by: Nythrun on January 08, 2010, 02:41:29 AM
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 :)
Title: Re: SAY [OFFSET] #-1
Post by: Miloch on January 08, 2010, 04:26:05 PM
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 (http://forums.gibberlings3.net/index.php?s=&showtopic=9157&view=findpost&p=76429) 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?
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on January 08, 2010, 04:33:25 PM
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.
Title: Re: SAY [OFFSET] #-1
Post by: cmorgan on January 10, 2010, 11:40:48 AM
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.
Title: Re: SAY [OFFSET] #-1
Post by: Miloch on January 10, 2010, 06:02:34 PM
(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?
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on January 10, 2010, 07:04:58 PM
BNOT 0 is a cool trick if you don't know 2-complement notation  :D
Title: Re: SAY [OFFSET] #-1
Post by: devSin on January 10, 2010, 07:51:39 PM
yawn
Title: Re: SAY [OFFSET] #-1
Post by: temujin. on January 10, 2010, 08:36:50 PM
Quote
« Last Edit: Today at 07:58:12 PM by devSin »

:D

<3 devSin
Title: Re: SAY [OFFSET] #-1
Post by: cmorgan on January 10, 2010, 10:17:50 PM
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!)
Title: Re: SAY [OFFSET] #-1
Post by: GeN1e on January 11, 2010, 05:24:38 AM
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: [Select]
// 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 (http://forums.gibberlings3.net/index.php?showtopic=9157&st=0&p=76429&#entry76429), AG's list (http://www.shsforums.net/topic/33231-area-modding-tool-tutorial-by-qwinn/page__view__findpost__p__452061) or IESDP (http://iesdp.gibberlings3.net/file_formats/ie_formats/are_v1.htm#formAREAV1_0_Anim).

Miloch, you go ahead and test it. I know you love testing :)
Though I see no reason it shouldn't work, the writing macro is from my personal lib and was working reliably.
Code: [Select]
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
Title: Re: SAY [OFFSET] #-1
Post by: devSin on January 11, 2010, 12:03:36 PM
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!
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on January 11, 2010, 12:46:02 PM
2-complement means that "0 - x" is expressed as "(` x) + 1".
Title: Re: SAY [OFFSET] #-1
Post by: devSin on January 11, 2010, 03:40:52 PM
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.
Title: Re: SAY [OFFSET] #-1
Post by: GeN1e on January 11, 2010, 04:24:34 PM
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.
Title: Re: SAY [OFFSET] #-1
Post by: devSin on January 11, 2010, 04:44:29 PM
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.
Title: Re: SAY [OFFSET] #-1
Post by: GeN1e on January 11, 2010, 05:02:59 PM
Eh, who said I feel bad? I thought that was you feeling all bad and jealous about pamela123 choosing the other guy over you.
Title: Re: SAY [OFFSET] #-1
Post by: aVENGER on March 26, 2010, 01:03:21 PM
Has something changed regarding this behavior for WeiDU 214? I'm getting a "ERROR: [mazzy8.cre] -> [override] Patching Failed (COPY) (Invalid_argument("index out of bounds"))" on this code:

Code: [Select]
// Correct a minor issue in Mazzy's soundset (aVENGER)

ACTION_FOR_EACH ~file~ IN                                                          // for each of the following files
               ~mazzy8~                                                            // Mazzy at level 8 (SoA)
               ~mazzy9~                                                            // Mazzy at level 9 (SoA)
              ~mazzy11~                                                            // Mazzy at level 11 (SoA)
              ~mazzy12~                                                            // Mazzy at level 12 (SoA)
              ~mazzy15~                                                            // Mazzy at level 15 (ToB)
BEGIN                                                                              // execute the following
ACTION_IF FILE_EXISTS_IN_GAME ~%file%.cre~ BEGIN                                   // if the file exists
COPY_EXISTING ~%file%.cre~ ~override~
PATCH_IF (%SOURCE_SIZE% > 0x2d3) THEN BEGIN                                        // file size sanity check (filters out 0 byte files i.e. ALLOW_MISSING)
  SAY EXISTANCE2 #29727 SAY EXISTANCE3 #-1                                         // assign the Spell Failed sound to the proper soundslot
END                                                                                // ends file size check
BUT_ONLY_IF_IT_CHANGES
END                                                                                // ends ACTION_IF FILE_EXISTS_IN_GAME block
END   
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on March 26, 2010, 01:52:49 PM
*sigh*

Uploading a fixed copy of 214.
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on March 26, 2010, 02:08:14 PM
Uploaded. can you devSin reupload the Mac version?
Title: Re: SAY [OFFSET] #-1
Post by: aVENGER on March 26, 2010, 02:18:55 PM
Cheers, it works properly now.
Title: Re: SAY [OFFSET] #-1
Post by: devSin on March 26, 2010, 02:21:45 PM
So basically, what you're saying is that months of effort spent "testing" new releases in private is just a complete fucking waste of time and effort? It doesn't make one god damn bit of difference?

If you admit it, then I will reupload.
Title: Re: SAY [OFFSET] #-1
Post by: the bigg on March 26, 2010, 03:43:54 PM
So basically, what you're saying is that months of effort spent "testing" new releases in private is just a complete fucking waste of time and effort? It doesn't make one god damn bit of difference?
In this particular case, no mod was ever doing SAY xyz #-1 because it didn't work even before, so it wasn't in the test cases. In general, I agree with you that using proper unit testing would be faster than having cmorgan install all mods under the Sun twenty times.
Title: Re: SAY [OFFSET] #-1
Post by: devSin on March 26, 2010, 03:56:15 PM
In this particular case, no mod was ever doing SAY xyz #-1 because it didn't work even before, so it wasn't in the test cases. In general, I agree with you that using proper unit testing would be faster than having cmorgan install all mods under the Sun twenty times.
I think aVENGER's comment was that he was using this pre-214. Now, it may not have written 2^32 before, but it's always done 2^31 or whatever and it was used in the prehistoric eras.

I uploaded, like, 10 minutes after talking shit in any case. For $150, I will compile a very special personalized version of WeiDU*. Contact me for details.




*Limited time offer. Not available in certain parts of New York. Limit one compile per customer.
Title: Re: SAY [OFFSET] #-1
Post by: cmorgan on March 26, 2010, 04:15:57 PM
Plus, I'm teh slow, and sometimes have to be told which of the big button-thingies on the funny glowing tube to press in order to misunderstand what I am looking at. But I am much cheaper than devSin. For $5 and a smile, I'll do anything. A N Y T H I N G.
Title: Re: SAY [OFFSET] #-1
Post by: Echon on March 26, 2010, 04:35:32 PM
For $5 and a smile, I'll do anything. A N Y T H I N G.

Even moose stuff?