wurstscript / wurst4vscode

Wurst extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=peterzeller.wurst
Apache License 2.0
24 stars 2 forks source link

feature request: extract TRIGSTRs #40

Open Cokemonkey11 opened 6 years ago

Cokemonkey11 commented 6 years ago

Would be useful for migrating old maps and it should be fairly trivial to do, I would think?

Frotty commented 6 years ago

do you mean just plain extract? why not use an mpq editor?

Cokemonkey11 commented 6 years ago

I meant to extract and replace "TRIGSTR_003" in wurst, with contents of map strings. (Strings get created by GUI AFAIK)

Frotty commented 6 years ago

Already done for wurst created objects. Inlining of WTS entries is more a task for the finalizer, not compiler imo.

Cokemonkey11 commented 6 years ago

Hmm, I was thinking just a tool in the editor. But extracting to a file would be fine too. I don't care too much how it's done.

Frotty commented 6 years ago

I still don't get it.

I meant to extract and replace "TRIGSTR_003" in wurst

In wurst? What does that even mean?

Hmm, I was thinking just a tool in the editor

So a command just to extract the .wts from a map? Why?

Maybe write a user story of what you're actually trying to accomplish. Seems pretty pointless to me.

(Strings get created by GUI AFAIK)

They get created by the world editor in all sorts of places

peq commented 6 years ago

I think the story is something like this:

  1. have map written in GUI
  2. convert to Jass files
  3. replace TRIGSTRs with new tool
  4. start rewriting Jass to Jurst/Wurst
  5. ???
  6. profit
Frotty commented 6 years ago

Ah okay, GUI. I was confused because nonGUI map code only contains like 4 TRIGSTRs. But who converts GUI maps to wurst?

Cokemonkey11 commented 6 years ago

But who converts GUI maps to wurst?

I did, here: https://www.hiveworkshop.com/pastebin/575155029c53ff3ff4364546b25ed4bc16336/

It was for the contest, which had a theme "Update a map that is 15 years old".

In this case it was particularly annoying because the starting map was a cinematic with hundreds of TRIGSTRs

Krypt0n commented 5 years ago

use this: https://bin.wurstlang.org/dipejosobi.wurst

Cokemonkey11 commented 5 years ago

Just from skimming that code, it looks like it won't work if you have two TRIGSTR on the same line

Krypt0n commented 5 years ago

that is true, I used it only once, may need adaptions to other situations