Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: [EUD] Big String Table [Theory]
[EUD] Big String Table [Theory]
Oct 1 2013, 7:40 am
By: trgk  

Oct 1 2013, 7:40 am trgk Post #1



Proof-of-concept map. Check out scenario.chk for more details
I haven't heard about this trick before. This trick may enable you to use as much string as you want for Display Text.
Theory : Create 2 string table and change a string table pointer

Ref :
http://farty1billion.dyndns.org/EUDDB/?pg=entry&addr=0x005993D4&ver=1.16.1&plat=win
http://www.staredit.net/starcraft/CHK
Some article written by Justin Olbrantz(Quantam), King Arthu. (I don't know where the original is...)

Special thanks to O)FaRTy1billion (EUDDB)


Things that can be done with this. (Guess. I haven't personally tried below)
- Infinite (malloc limit can be regarded as Infinite) number of In-game strings
- Infinitely many In-game strings with arbitrary length.

Technique to the extreme :
[ 01 00 08 00 (String data) 00 ] * String number. (If the string are used in triggers)

Drawback : (Small)
- Need 3 trigger per one Display text.
- Cannot store Force team name, Unit name, Briefings, and so so... (Only string used at Display Text can be stored?)
(Comments, Location name, .... things not used in game or not used by trigger : Treat that to be used in trigger. It won't matter anyway.)
- Complex map editor design?
- Need EUD Enabler things.

Map editor implementing this feature should
- Use normal string table if possible. This might require using some Extended String Table section. (KSTR, STRx, ...)
- If there are too many strings, then alert that the map requires EUD, and auto-inserts defeat trigger for ones with no EUD enabler. (needed)

Attachments:
testing.scm
Hits: 7 Size: 92.92kb

Post has been edited 6 time(s), last time on Oct 1 2013, 3:20 pm by trgk.



EUD

Oct 1 2013, 2:56 pm Cinolt Post #2



So basically alter the STR pointer dynamically to a custom CHK section to increase the string limit?

Do custom CHK sections even get stored in memory in unmodded SC?

BTW I wonder if you could dynamically change displayed text using EUDA's while they're being displayed. Otherwise you could just overwrite the STR section directly using a bunch of EUDA's, which would fit well for "chapters" in an RPG or so.



None.

Oct 1 2013, 3:38 pm trgk Post #3



Quote from name:yoonkwun
So basically alter the STR pointer dynamically to a custom CHK section to increase the string limit?

Do custom CHK sections even get stored in memory in unmodded SC?

Surely STR section are loaded in memory in unmodded SC. (Excluding EUD Enabler... This method is highly dependent on EUD...) This map doesn't need any fancy custom sections. Every needed operation can be done in STR and TRIG section.

Example (This map, of course)
We want to have 2 stringtables in one STR section. So we tweak STR section.
( I'm refering stringtable to a pure TBL file format. It's basically an STR section without section header and section length...)
( One string table can effectively has 65536 bytes of storage... Maybe the last string may have more... but ignore that )
( To use more than 65536 bytes, we have to modify existing data, or use more storage)

I assumed that SC takes off "STR " and the length of STR section. (8 bytes at the front of STR things) and memcpy(fread?) that to somewhere, and
point there with a pointer found at EUDDB.

So things like this.
Code
stringtable
|
stringtablepointer


So, I just hacked this (content of STR : stringtable1 stringtable2. length are adjusted properly)
Code
stringtable1 stringtable2
|
stringtablepointer


When we want to use stringtable2, add stringtablepointer stringtable1's length.
->
Code
stringtable1 stringtable2
            |
            stringtablepointer


And everything assosiated with map's str section will work seamlessly with stringtable2. (Display text...)

Some problem with this is, unit's name and some other things are in STR section, so stringtablepointer have to be reset after every DisplayText...
This may give some limitation to this technique... Edited original post a bit.

Quote from name:yoonkwun
Otherwise you could just overwrite the STR section directly using a bunch of EUDA's, which would fit well for "chapters" in an RPG or so.

Can I? I only have a pointer to STR section. How can I dereference it?

Quote from name:yoonkwun
BTW I wonder if you could dynamically change displayed text using EUDA's while they're being displayed.
I have some utility that seems to do something similar to your idea... but I don't know what exactly it does.
Will have a deep look at it...

Something like this...
DisplayText(" \n \n \n \n \n \n \n \n \n \n \n"); //Change this in starforge style
SomeDirtyStarForgeTriggerSet


Sorry for bad english anyway.

Post has been edited 3 time(s), last time on Oct 1 2013, 3:58 pm by trgk.



EUD

Oct 1 2013, 3:54 pm jjf28 Post #4

Cartography Artisan

So for each string you do:

Change pointer to STR section to the table this specific string is in.
Then do something with the string.

And the STR section is setup such that size = (size of 1 STR section * number of tables)
Then multiple STR tables follow?

nifty! too bad it requires (at least at the moment) a mod



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Oct 1 2013, 4:37 pm Cinolt Post #5



I see, so you're just incrementing/decrementing the STR pointer to get past the 2byte size limit.

Quote from trgk
Can I? I only have a pointer to STR section. How can I dereference it?

Forgot that it was heap-allocated, so this wouldn't be feasible. Unless you use EUDA's to modify some unused location in static memory, then set the pointer there.

As you say, modifying the displayed text directly is another thing to look into.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
Please log in to shout.


Members Online: jun3hong, Oh_Man