LocUnlock v1

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

LocUnlock v1

Postby poiuy_qwert » Mon Sep 15, 2008 4:53 am

LocUnlock is an MPQDraft and FireGraft v0.93 plugin supporting SC:BW versions 1.15.1 to 1.15.3 (1.15.2 and 1.15.3 are currently not supported by FireGraft v0.93), designed to allow modders the use of locations in game types other then Use Map Settings. The two things you can do with this plugin is make the Anywhere location cover the whole map with all elevation levels, or set one or more values (top left x/y, bottom right x/y, and elevation flags) of any location you want.

Download:
LocUnlock.zip

Usage:
LocUnlock uses the EnableDebugMode (which is currently only supported by PyTRG) action to edit locations, and takes its parameters from the Start Locations (unit 214) death count of different players:
Player 2: Location number
Player 3: Values to change (bitmask: 1 = top left X, 2 = top left Y, 4 = bottom right X, 8 = bottom right Y, 16 = flags)
Player 4: Top left X
Player 5: Top left Y
Player 6: Bottom right X
Player 7: Bottom right Y
Player 8: Elevation flags (bitmask: 1 = Low Elevation, 2 = Medium Elevation, 4 = High Elevation, 8 = Low Air, 16 = Medium Air, 32 = High Air)

If the Location number or Values to change is 0, then the Anywhere location is automatically set to cover the whole map with all flags set (like how it starts for UMS maps).


MPQDraft Installation/Application:
1) Extract LocUnlock.qdp to your MPQDraft folder
2) When creating a SEMPQ or loading an MPQ patch, make sure the "LocUnlock v1" plugin checkbox is checked


FireGraft v0.93 Installation/Application:
1) Extract LocUnlock.qdp to your FireGraft folder
2) When editing your project, go to the Plugins tab
3) Click tha add Add button under MPQDraft plugin, and select LocUnlock.qdp

Examples:
Make Anywhere cover the whole map at the start of the game:

Code: Select all

Trigger(All Players):
   Conditions:
      Always()
   Actions:
      EnableDebugMode()


Cover 2x2 square of tiles in the top left with location 1 when switch 1 is set:

Code: Select all

Trigger(All Players):
   Conditions:
      Switch(1, Set)
   Actions:
      SetDeaths(Player 2, Start Location, Set To, 1)
      SetDeaths(Player 3, Start Location, Set To, 31)
      SetDeaths(Player 4, Start Location, Set To, 0)
      SetDeaths(Player 5, Start Location, Set To, 0)
      SetDeaths(Player 6, Start Location, Set To, 64)
      SetDeaths(Player 7, Start Location, Set To, 64)
      SetDeaths(Player 8, Start Location, Set To, 63)
      EnableDebugMode()



Credits:
bajadulce: Giving me the idea to make this and for hosting!
Doodle: Some code I used to learn from
A_of-s_t: Helping, and being cool
DiscipleOfAdun: Supplied function to get the SC version and for mucho grande help!
a_of_s_t
Posts: 51
Joined: Sun Mar 23, 2008 5:39 am

Postby a_of_s_t » Mon Sep 15, 2008 5:12 am

I dont know which forum to post on, so Ill just post here:

Good job :D !
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Tue Sep 16, 2008 1:35 am

:) Im glad you like it. I have had so many ideas that would only be possible with locations, im just surprised it took me this long to make it :P
User avatar
Hercanic
Posts: 39
Joined: Sat Sep 27, 2008 6:42 am

Postby Hercanic » Wed Oct 01, 2008 2:36 am

Dear Poiuy Qwert:
I was just reading your post, and spontaneously thought of a solution to a balance problem I've been wrestling, the solution of which is only possible with your program. Once again, thank you for making it! =o)
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Wed Oct 01, 2008 2:42 am

I'm just happy it can be put to use. I'm thinking of adding more functionality, as in being able to retrieve location settings, and supporting vanilla along with broodwar (Heinerman found something that might make this totally useless outside of broodwar, so i gotta check it out and add support if its true). Thanks!
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Thu Oct 30, 2008 12:22 am

Ok well I finally get a chance to look at this again (sorry it was so long). I still do not get any crashes using MPQDraft and LocUnlock. I think there should be no way LocUnlock is making MPQDraft crash, maybe you are experiencing a crash unrelated to LocUnlock (MPQDraft likes to crash when I change the input/output paths and do other things). Also so far all my tests have shown that LocUnlock works fine, except the Giving of units in your example isn't working. If you SetResources(Player 1, Set To, 1000, Ore and Gas) right after the GiveUnitstoPlayer, you'll see the trigger does fire (meaning the Anywhere location is correctly set up to detect the medic), just the SCV's arn't being given. I don't know whats going on there, but its not LocUnlocks fault. Right now all i can think of is either PyTRG is compiling the GiveUnitstoPlayer trigger incorrect (the trigger works fine in staredit though, so i believe this is not the case), or there may be another melee based restriction on giving units.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Wed Nov 05, 2008 1:47 am

1) I've tested it on v2008.4.6.1 and v2008.8.21.1, the SEMPQ included is using the later
2) It can be tested on any map, but I included the one I used. These are the triggers I use to test both functions at the same time (included in zip):
[spoiler]

Code: Select all

Trigger(All Players):
   Conditions:
      Always()
   Actions:
      SetResources(All Players, Set To, 0, Ore and Gas)
      Wait(100) #This wait does not matter
      EnableDebugMode()
      SetDeaths(Player 2, Start Location, Set To, 10)
      SetDeaths(Player 3, Start Location, Set To, 31)
      SetDeaths(Player 4, Start Location, Set To, 320)
      SetDeaths(Player 5, Start Location, Set To, 320)
      SetDeaths(Player 6, Start Location, Set To, 352)
      SetDeaths(Player 7, Start Location, Set To, 352)
      SetDeaths(Player 8, Start Location, Set To, 63)
      EnableDebugMode()
      Wait(100)
      CreateUnit(All Players, 1, Terran Marine, Location 10)
      CreateUnit(All Players, 1, Terran Ghost, Location 10)
      CreateUnit(All Players, 1, Terran SCV, Anywhere)
[/spoiler]
4) I downloaded the attached plugin for my testing. I've included the one i used in the tests just in case, and the new v2 for you to try (tested and works for me also).

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest