SC2 BETA Editor findings

User avatar

Topic author
Ricky_Honejasi
Xel'naga Solar Moderator
Xel'naga Solar Moderator
Posts: 2022
Joined: Wed Aug 16, 2006 3:50 pm
Status: Offline

Re: SC2 Editor findings

Postby Ricky_Honejasi » Sun Jun 27, 2010 10:57 am

So after poking things a bit more around, it seems banks can be used as side data tables (to fit data in) as long you don't use the "save bank" action since without saving the bank, it doesn't write on the hard drive regardless of all the bank actions you do.

Also, you can open banks for "invalid" players (ex : player 2 when there is no player 2 at all) and it's still possible to fit and extract data like if it was a data table.

However, the bank is limited to save only 7 types of variables (unit, text, string, real, point, integer, boolean). Miixing data tables and "dummy" banks might be potentially be preferable for "power triggerers" in specific special cases. Such case could be when they want to store a ridiculous quantity (like 40 millions of variables when 1-2 millions already slow down) of data in SC2's "RAM" but yet they want to split it into various "dummy" banks to minimize seek times.

I didn't test in-depth about it but for those interested, they might want to test it if they believe they might need such alternative.

==============================================================

A completely side detail for banks, if you want to validate your data type (ex : "Key "A" of Section "1" is of integer type"), you only need to use that action since it implicitly validate their existance as well (thus you are not required to do "Key "A" of Section "1" exists" beforehand to avoid red errors).


Mr.
Zerg Creep Colony Landscaper
Zerg Creep Colony Landscaper
Posts: 408
Joined: Wed Aug 30, 2006 9:48 am
Location: Virginia
Contact:
Status: Offline

Re: SC2 Editor findings

Postby Mr. » Mon Jun 28, 2010 12:36 pm

Okay, I've got a new problem that I'm trying to find an easy solution to, but it's beginning to look like there isn't one.

I want to be able to globally slow down the attack/movement speed of every single unit on the map to a certain percent.  Here's the process I've gone through already:

I COULD make that effect through triggers, except 1: That would be very inefficient, and 2: I actually don't know of a way to modify attack speed through triggers

So I turn to the data editor.  I was able to successfully make an aura ability that would target every unit on the map, and slow their attack/movement to whatever I want.  Excellent!  However, that will only let me change it to a static number, unless I were to create 99 copies of the ability.

So I tried looking at upgrades.  I was hoping that I could make an upgrade that would increase the percentage of the aura I just made by 1%, so I could just set the level of that upgrade from 1-99, and it would be perfect.  But no, of course it couldn't be that simple.  I can't modify a buff through an upgrade, it seems.

Set catalog entry doesn't seem to work for a real value this particular entry, so that's out.

So now I'm going to try to figure out how people have made abilities with levels, because I haven't tried that yet.  But I have a feeling that that will end up coming down to "make 99 copies of the buff." 

I even tried stacking the effects, thinking maybe I could get away with just making a few copies, and adding them multiple times.  But they stack by multiplying, rather than adding.  I can't figure out an efficient way of making the math work for that.



So.... I'm looking for any way of pulling this off without making tons of copies.  I might just do approximates, like making 5%, 10%, 15%, etc.  But I would much rather be able to cover the whole range.  Anyone have any suggestions?
Last edited by Mr. on Mon Jun 28, 2010 1:17 pm, edited 1 time in total.
Paging Dr. @Lavarinth

User avatar

Topic author
Ricky_Honejasi
Xel'naga Solar Moderator
Xel'naga Solar Moderator
Posts: 2022
Joined: Wed Aug 16, 2006 3:50 pm
Status: Offline

Re: SC2 Editor findings

Postby Ricky_Honejasi » Mon Jun 28, 2010 3:59 pm

Not to simply step over Bill's request (already tried to help him, still trying to help) but I found another very interesting thing.

Finally, there is a way to extract a string (more precisely text) references of catalogs and such.

For example, if you attempt to fetch via catalog "Units" "Ghost" "Description", you would fetch out "Button/Tooltip/Ghost".

Then you can use do "Set variable (Text Variable, NOT String) = (Game text for "Button/Tooltip/Ghost").

This text variable will have the text :

Code: Select all

Sniper. Can use Snipe, EMP Round and Cloak.  Can call down Nukes built at the Ghost Academy.

<c val="#ColorAttackInfo">Can attack ground and air units.</c>


Note that you can also apply the same thing to fetch out the proper names of units (ex : "Warp Prism" instead of the internal ID of "WarpPrism"), proper names of researches, button's descriptions and so on.

For modders or power users, it should even extend to lots of string field from the String files such as GameStrings.txt, TriggerStrings.txt, etc both in used MPQs' strings and the map's strings. If you need to find the ID of a specific string, you can find under the ID when trying to mass check your text fields.

Unfortunately, I didn't found a single action that allowed to modify such text.

As attachments below are some picture examples.
Attachments
GameText0.JPG
GameText1.JPG
GameText2.JPG
GameText3.JPG
GameText4.JPG

User avatar

Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 759
Joined: Mon Oct 23, 2006 3:29 pm
Status: Offline

Re: SC2 Editor findings

Postby Xenon » Mon Jun 28, 2010 5:05 pm

Bill> For the stacking math, try this. Does the modify attack speed by multiplying by the period or the cooldown speed? In either case, here's the math:

This is assuming the editor has a logarithm function (I don't have it up right this moment).

For cooldown speed multiplier: stacks = log(speed ratio)/log(speed multiplier per stack)
So for a speed of 50% and a modifier of 99%, stacks are log(.5) / log(.99) = 68.9675639, round up if possible

For period multiplier: stacks = log(speed ratio)/(-log(period multiplier per stack))
So for a speed of 50% and a modifier of 101%, stacks are log(.5) / (-log(1.01)) = 69.6607169

It isn't exactly precise, but whatever. Given the usage of n/4096 fractions for the fixed reals, you might want to use a n/4096 number for the buff speed multiplier to improve accuracy, but I'm not sure it will help. Also remember that the stack number gets much higher for speed ratios approaching 0, so consider a minimum speed limit.
Last edited by Xenon on Mon Jun 28, 2010 5:10 pm, edited 1 time in total.

User avatar

Master Jademus Sreg
Terran Battlecruiser Janitor
Terran Battlecruiser Janitor
Posts: 190
Joined: Mon Sep 25, 2006 2:32 am
Status: Offline

Re: SC2 Editor findings

Postby Master Jademus Sreg » Mon Jun 28, 2010 9:11 pm

I haven't observed the data editor to permit even arithmetic operations in its data fields. Sad, because if it were permitted, there would be no less need to script variable-dependent effects (such as deal attack damage + 20 or recover Intelligence * 2.25 life).
No more humans, please.


Mr.
Zerg Creep Colony Landscaper
Zerg Creep Colony Landscaper
Posts: 408
Joined: Wed Aug 30, 2006 9:48 am
Location: Virginia
Contact:
Status: Offline

Re: SC2 Editor findings

Postby Mr. » Mon Jun 28, 2010 9:27 pm

Okay, so that sucks.  Q, again, you are brilliant, and I was super excited, and got to work implementing your math.  And I was almost done, when I realized that there is no built in function for logarithms :(
Paging Dr. @Lavarinth

User avatar

Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 759
Joined: Mon Oct 23, 2006 3:29 pm
Status: Offline

Re: SC2 Editor findings

Postby Xenon » Mon Jun 28, 2010 10:23 pm

How obnoxious for them to leave out one of the fundamental math functions... You can try creating a loop instead, like this:

variable stacks (integer)
variable i (integer)
variable speed (real)  ratio from 0-1
variable modifier (real) 0.99 or w/e
variable tempspeed (real) = 1
For each integer i from 0 to 400
    if tempspeed <= speed then
        break
    else
        set tempspeed = tempspeed * modifier
set stacks = i

The "break" function exits the current loop, leaving the variable i at its current value.

It shouldn't take too much processing power as long as you only use it once whenever the speed is changed, and store the resultant number of stacks as a variable you can retrieve at any time.

You could also try using the Power function instead of multiplying. (use Power(multiplier, real(i)) <= speed as the if condition and remove the tempspeed part) I don't know whether this would be more accurate or not but it probably would be slower.

Edit: The default attack ability has a minimum attack rate ratio (I think 20%). You may want to edit this.
Last edited by Xenon on Tue Jun 29, 2010 7:39 am, edited 1 time in total.


Mr.
Zerg Creep Colony Landscaper
Zerg Creep Colony Landscaper
Posts: 408
Joined: Wed Aug 30, 2006 9:48 am
Location: Virginia
Contact:
Status: Offline

Re: SC2 Editor findings

Postby Mr. » Tue Jun 29, 2010 2:12 pm

Well, what I ended up doing was just making a bunch of different buffs with different percentages.  I made :

10
20
30
40
50
55
60
65
70
75
80
85
90
95
99

And for 1-9%, I just use 10% x 10-90%, everything else is rounded down to fives.  For 15% I use 30% x 50%, etc

Yeah, kindof a pain in the ass to make so many duplicates, but it works well enough for me.  Also, I tried to change the default attack rate minimum (normally 0.25), but there is a hardcoded minimum of 0.125.  That's kinda retarded, but oh well.  I don't think it will make that big of a difference, because any time I will set the speed below 15%, or change it at all, really, it won't last for very long.  I'll be able to accomplish the visual effect, and if the attack rate doesn't match up perfectly, it won't be so bad.

Thank you again, Q.

I would also like to point out, while I'm here, that when you're using a "search area" effect, the "Extend by unit radius" flag doesn't seem to do anything at all.  I was trying to make triggers for making an air unit collide with ground units, and I was using the search area effect for collision, and I noticed that no matter how much I increased the unit radius, it was still treating it as zero.  Finally I changed the radius of the effect itself, and it magically worked. 

On top of that, using the "Create effect at point from unit/player" actions will not actually work properly.  I could only get it to work if I was creating the effect on a unit, and had the unit at the exact point that I needed the effect.  Otherwise, it would create it wherever the unit was, regardless of the point specified.
Paging Dr. @Lavarinth

User avatar

Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 759
Joined: Mon Oct 23, 2006 3:29 pm
Status: Offline

Re: SC2 Editor findings

Postby Xenon » Tue Jun 29, 2010 6:41 pm

Maybe extend by unit radius only works on the unit being targeted for impact point (I always target the missile doing the search).


Mr.
Zerg Creep Colony Landscaper
Zerg Creep Colony Landscaper
Posts: 408
Joined: Wed Aug 30, 2006 9:48 am
Location: Virginia
Contact:
Status: Offline

Re: SC2 Editor findings

Postby Mr. » Wed Jun 30, 2010 8:16 pm

Here's a very handy discovery I just made:

If you have a folder full of triggers and variables, and those triggers use those same variables... you can copy/paste the whole folder, and the copied triggers will reference the copied variables, rather than the old ones.  Which saved me a TON of trouble just now, because I had a dialog that I wanted to copy, with 1 trigger, 5 action definitions, and 15 variables.  Just did copy+paste, moved the position of the new dialog, and I now have a completely independent copy! 

Woo!

I just need to adjust the values of some of the variables, and I'll be good to go!
Paging Dr. @Lavarinth

User avatar

IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8776
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: SC2 Editor findings

Postby IskatuMesk » Sat Jul 03, 2010 11:34 am

I've got a challenge for you guys. Let'see who's MAN ENOUGH

I want to see if you can make a Cluster Munition. Just like the cloud of death in SupCom. You remember the Aeon rapid fire arty? No? Okay, here's two examples I want to see.

- An air-to-air missile that explodes half-way to target and splits into 12 smaller missiles that fan out in a big circle and swarm their target.
- An inaccurate artillery shell launched that explodes as it descends to the target and rains the vicinity with small exploding bomblets.

And if you've really got balls of steel

- Artillery that explodes in the upper air and splits into projectiles that then explode and split into MORE projectiles as they near the ground. CLOUD OF DEATH

Oh, and no triggers.
Last edited by IskatuMesk on Sat Jul 03, 2010 11:35 am, edited 1 time in total.
Image~[Gameproc]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.

User avatar

Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 759
Joined: Mon Oct 23, 2006 3:29 pm
Status: Offline

Re: SC2 Editor findings

Postby Xenon » Sat Jul 03, 2010 6:31 pm

Bah. I figured I'd mess around with this since my latest Dwarf Fortress game got corrupted. I almost got the double-split artillery working perfectly, but of course there had to be a hidden snag...

It appears that the game only keeps track of one target for each effect type in a tree even if it branches. Meaning, instead of each of the stage 3 rockets hitting a point offset from the target of the stage 2 rocket that spawned it, all of the stage 3 rockets hit a point offset from one of the stage 2 rockets. They effectively hit in a circle that has been offset twice, rather than a "circle of circles".

Here's the map if you're interested. For the offsets I had to tediously enter 25 polar offset points for the game to pick at random.
Attachments
rockit.JPG

[The extension has been deactivated and can no longer be displayed.]


User avatar

IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8776
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: SC2 Editor findings

Postby IskatuMesk » Sat Jul 03, 2010 7:03 pm

Excellent!

I'm looking at this in the editor and trying to make sense out of it. And failing. Care to explain how exactly it works?
Image~[Gameproc]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.

User avatar

Xenon
Zerg Queen's Nest Slave Trainee
Zerg Queen's Nest Slave Trainee
Posts: 759
Joined: Mon Oct 23, 2006 3:29 pm
Status: Offline

Re: SC2 Editor findings

Postby Xenon » Sat Jul 03, 2010 7:47 pm

Yes, it is absurdly complicated. :P


Create Persistent: picks a random offset from an array and launches a missile.

Launch missile : launches the missile, uses a search as a launch effect
  -Picks a mover depending on range. The only difference between the movers is its "outro" setting, which determines when it exits the current movement phase and enters the next. A positive value means how far the missile moves to do this; a negative value means it gets that close to the target. The second movement phase is the same as the first but used to signal the behavior later. (the mover for 3rd stage missiles is a unique guided without a second phase.)

Search: disigned to find the missile just launched and apply a behavior

Apply behavior: has validators so that it will only apply the behavior to the correct missile type, and only to missiles that don't have a related behavior already on them. If there were (or is) a way to directly reference the missile it would save a lot of trouble. :P

Behavior: has a periodic effect with a disable validator requiring the missile to be in its second movement phase (and therefore at a certain distance). At this point it starts over with another create persistent with some modifications, and the missile self-destructs.


The point at which is splits leaves something to be desired, since you can't use any math to tell it to split at the halfway point. A larger array of movers could improve it.

And due to the way this post is constructed, the damn text box is acting up again. AAAAAA

Edit: The 3rd stage missiles targeting the wrong point looks to be caused by the search function slapping its buff on all missiles just spawned, instead of just the one it was supposed to. Going in to the FractalAtrilleryMissileSearch2 effect and setting the "maximum count" in its area dialog to 1 will improve the spread pattern, though the missiles that target those points may be other than the intended ones.
Last edited by Xenon on Sat Jul 03, 2010 8:07 pm, edited 1 time in total.

User avatar

IskatuMesk
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 8776
Joined: Sat Feb 07, 2009 1:40 pm
Location: M͈̙̞͍͞ͅE̹H̨͇̰͈͕͇̫Ì̩̳CO̼̩̤͖͘
Contact:
Status: Offline

Re: SC2 Editor findings

Postby IskatuMesk » Sat Jul 03, 2010 7:54 pm

Okay that confused me even more but I guess when I start actually playing with projectiles it will make more sense.

I hope.
Image~[Gameproc]~Image
Warning: dialogue contains politically incorrect content. Viewer rearsore may occur.


Return to “StarCraft II Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest