Author Topic: TP2 Awe  (Read 2801 times)

Offline Shed

  • Planewalker
  • *****
  • Posts: 48
  • Gender: Male
  • ZOMG!
    • OMGWeRTehFuny
TP2 Awe
« on: September 01, 2004, 02:28:02 PM »
Wow. That is some coding, Sim! I especially like the bit when you append action.ids. I would never have thought of that (and may use this in future) but how exactly does it work?
Quote from: jcompton
Whatever, man. We'll just see what happens when Seifer and Shed have another attack of "omg we are teh funy".

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: TP2 Awe
« Reply #1 on: September 01, 2004, 03:57:58 PM »
Wow. That is some coding, Sim!
Thanks.

Quote
I especially like the bit when you append action.ids. I would never have thought of that (and may use this in future) but how exactly does it work?
I assume you're talking about this:

APPEND ~ACTION.IDS~
~163 IG(S:GLOBAL*,S:Area*D0VTYPE,I:Value*)~
UNLESS ~163 IG(S:GLOBAL*,S:Area*D0VTYPE,I:Value*)~

It became necessary when I needed to replace all ReputationInc actions in dialogues with IncrementGlobal("D0Change2","GLOBAL",x). The problem is that the latter is a lot longer, and a simple REPLACE_TEXTUALLY would mess up the offsets in the DLG files.
It should at this point be noted that this coding was before REPLACE_ACTION_TEXT_REGEXP was implemented. I suppose really I should modernize.
Anyway, I needed to shorten the IncrementGlobal action as much as possible. The obvious change is shortenning the variable name. Next stage is changing the action to be shorter. This can be done by appending to IDS, so the IG action uses the same opcode as IncrementGlobal.
However, IG("X","GLOBAL",1) is still too long. The only bit left to shorten is the "GLOBAL". Therefore, I create a custom IDS file referenced in the new action I'm appending, which allows me to use 0 in place of "GLOBAL" in the action. The result is that IG("D0Chg2",0,1) is just the right length.

Offline Shed

  • Planewalker
  • *****
  • Posts: 48
  • Gender: Male
  • ZOMG!
    • OMGWeRTehFuny
Re: TP2 Awe
« Reply #2 on: September 01, 2004, 08:45:17 PM »
Okay, cool.

I have progressed from "OMG I can  COPY - check my l33t $k||$" to "OMG I can  CHAIN- check my l33t $k||$".

I hope to progress to WHILE and COPY_REGEXP, as soon as I find a good reason for doing so, that is ;).

I was a bit confused because I didn't see your own .ids D0VTYPE.ids in the .tp2 (just below). I didn't realise the the X*XType actually directly references other .ids files :).
Quote from: jcompton
Whatever, man. We'll just see what happens when Seifer and Shed have another attack of "omg we are teh funy".

 

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