• 0

    posted a message on Variables
    Quote from SouLCarveRR: Go

    I think he needs a brief introduction in to what "scope" is and how it relates to Global and local variables as well.....

    Try googling.... "Global Variable" and "Local variable" You will find a wealth of knowledge. This is basic programing stuffs, its pretty educational.

    Scope is very important when programming. SC2 Galixy Scope does not differ that much really.

    Scope is a way of managing what can be seen from any point in code. Global variables that are created outside of a trigger are visible to all triggers. A local variable created within a trigger is only visible with the trigger, and when the trigger is finished, the variable is destroyed.

    The variable being destroyed when the trigger is finished it a good thing. Knowing this means that we need to decide at any point when a variable needs to be global, or when it should be local to the trigger.

    Let’s say you were keeping score. And you have a trigger that adds points to a players score. It would be bad to create the scoring variable local to the trigger. If we did, the score would be created, the points added, and then the score variable would be deleted. The next time the trigger tries to add points to the score, it would start over, and again delete the score. If we did the same scenario with global variable for score. The trigger would start, it would add points to the score, and then the trigger would destroy itself when done. But our global variable of score is still intact outside of the trigger.

    Let’s take this example and include both global and local variable for score. First we have a global variable that is the total score. Then a trigger fires to add points to the score. It creates a local variable for adding up points. A number of math routines add numbers to the local variable based on how many units were killed, and what type of unit is worth how many points. After the score for the trigger adding the points has work out its total. It then adds that local variables value of kill total, to the global variable of total score. The trigger finishes and destroys the local kill total variable before exiting. The players total score as a global variable is left intact.

    Back to the topic of scope, a trigger can see(Scope) any variables that are global. A trigger cannot see variables that are local to other triggers. So the scope for any trigger is itself and global.

    Without going off topic into ways of sharing other triggers local variable values with other triggers. You should be able to make your map without using those techniques. When you understand these concepts, you can start to look for functions, parameters and such.

    Cheers, ItsAboutTime: Sldprt

    Posted in: Triggers
  • 0

    posted a message on Variables
    You can think of a variable as a container. It is sized to fit the biggest possibility of a value. For example a byte is 0 to 255. A total of 256. Internally the program would handle it as HEX. Smallest being 00 and largest being FF. So when you define a variable as a byte. You have early bounded this variable to allocate space for FF. Now if you tried to put let’s say a string into the byte. Each character in a string is also hex 0 to 255. The alphabet has 26 lower case letters, and 26 upper case characters. It has 0-9, and shift 0-9(!@#$%^&*()). It also have things like (_+-=[]{}:”;’<>,./?\|). Some of these characters are reserved by galaxy editor, so using them in strings causes errors. Now if our string was let’s say “This is my String, I created it.” This string has 32 characters, which is 32 bytes. You can see how a 32 byte String “String[31]” won’t fit in 1 byte “byte[0]”. Early binding your variables is very important, and understanding when you can’t have it. Early binding means the variable containing is already defined to hold the largest value possible. Early binding allows you to speed your program up a lot in most areas. StarCraft II Pretty much everything requires early binding, and when it does not, it fakes late binding. This is because the Scope of Galaxy Script is only the possibilities. One area where galaxy script fakes late binding is with Dialog Controls. It is multiple different types of dialog controls with only one object handler. The object handler is sized to the biggest type. This is already long and maybe I’ll post more but. Size matters, so using the right variable to hold the data is important. Boolean[0] = True or False. 0 to 1 That’s one bit and very small. Byte[0] = 0-255. 00 to FF If you held True or False in a String, then. “False”[4]Bite’s “True”[3]Byte’s As opposed to. Bit False[0]Bit’s Bit True[1]Bit’s Bit False[0]Bit’s
    Posted in: Triggers
  • 0

    posted a message on SC2_WOW-Trading Card Game
    Quote from Aenigma: Another option is to include the art in a mod file and have the map use the mod as a dependency. Mods can hold up to 20MB of info so you could boost the quality of your images by 3x.
    I’m a programmer in real life, and I got to say I am new but not new to SC2 map like editing. With your simple post, it solved all of my problems. My 3500 picture files on their own, with a compression quality of 20(A program I wrote for working with pictures). I was able to get them down to 30MB. I wrote another program that takes it a step further. It crops every cards artwork, and saves them into pictures on 10X10. (2020X1540) rez. By grouping 100 pictures together, the JPG Same Compression got the file size on disk down to 10MB. I plan on move the picture with a form, in order to hide show specific card. Already tested, and JPG files work.
    Posted in: Triggers
  • 0

    posted a message on SC2_WOW-Trading Card Game
    Quote from SouLCarveRR: Go

    @sldprt: Go

    umm.... skip the art work for now and just make the game... see how that goes....

    Thanks for the input.

    Posted in: Triggers
  • 0

    posted a message on SC2_WOW-Trading Card Game
    Quote from Aenigma: Go

    I'm not sure if this is what is shown in your picture, but to save space have you considered creating one card template in game and simply replacing the artwork in each card while the game fills in the card info like name and class? From the size of those cards it could essentially halve the size of each image.

    I could be wrong or crazy.

    This is a great idea, and I am doing it for the most part. There are 3500 cards. I managed to, with my compression methods. Get each cards artwork down to 2k. That’s 7 MB of cards. At the same time, the quality sacrifice is large. So I am going to do what you described for most cards. But hero’s allies and quests will be handled through 3d models, and written quests.

    I don’t want to leave out any cards. I plan on letting people build decks, saved to the bank. Horde and Alliance Decks. The Scourge, Onixia, Lich King will all be AI players. The map will be 2v2 with the bosses actively playing as computer players. The point of the game is to defeat the other human players. At the same time they share common threats.

    Posted in: Triggers
  • 0

    posted a message on SC2_WOW-Trading Card Game

    My Map Project has been going for a while now, just me programming outside of the editor. I am pretty close to finalizing my library. I have written my own JPG compression Program, Trying to get every card in the game. This has led me to the point of saying it’s not possible without sacrifice in large quality. Even when redrawing the card picture, and generating the other values.

    So I have decided to change the format a bit. I am going to use wow models for hero’s, Ally’s, and Quests. I am writing a logic system right now to deal with card rules. Game play time lines, self, target, card requirements in both.

    Anyways the following slides should explain where I am at, and what I am doing to recreate WOW-TCG

    dia1

    dia2

    dia3

    dia4

    dia5

    dia6

    dia7

    There is a Team and Final Asset already setup. This is a work in progress. I am looking for people to join in all areas. I want people to join, but don’t want them to start any work as of yet. The format must be strict due to file size, for models and such.

    I am posting here because I want Comments: Please!!!

    Posted in: Triggers
  • 0

    posted a message on $10,000 if you find how to fix that

    i've had the same bug before. make a new region. set all spawns to that region. then change them back to the right region.

    You first use of the region is refreshing itself, and this is due to blizzard handling both what the trigger is displaying its name to you, and what it internally calls the trigger.

    try it and let me know if it works. otherwise without reading your code. create a local variable. right after the create use. set the variable to the last created unit. then use the variable moving forward. if two triggers end up running at the same time, the variable will hold the local triggers last created unit, and they wont overlap.

    Posted in: Triggers
  • 0

    posted a message on New Rules - Ya feeling pretty yet?

    @OneTwoSC: Go

    Quote from OneTwoSC: Go

    I put a lot of time into my jpg avatar. Years of research and thousands of graphic design dollars.

    I must say. I like the artist’s rendition of this happy face. The left eye is lower than the right, and off center further to the left. Or is the right eye further to the left, and higher than the left. It just makes me laugh when the artist he or she quirks a smile at me.

    I still want to be the last unicorn! It looks like a lot of man hours went into this rendition too!

    Posted in: General Chat
  • 0

    posted a message on New Rules - Ya feeling pretty yet?
    ok here you go. this will search the image to see how many frames it has. if it has more then 1. then it will redraw the image to a bitmap, and save it to the same name. in order to do this it gets complicated with file access and the GUI. so thats why you see the using statement, and the moving(renameing) the old file first before saving the new one. please test this before using it of course. and the nice thing about this is all files are backed up with the prefix "Rename_" before saving them to the flatten gif file. Sub getdirpics(ByRef d As System.IO.DirectoryInfo) Dim dd As System.IO.DirectoryInfo Dim f As System.IO.FileInfo For Each f In d.GetFiles("*.gif") Dim count As Integer Dim StoreImage As Image = Nothing Using img As Image = Image.FromFile(f.FullName) Dim frmD As Imaging.FrameDimension = New Imaging.FrameDimension(img.FrameDimensionsList(0)) count = img.GetFrameCount(frmD) If count > 1 Then StoreImage = New Bitmap(img.Width, img.Height, img.PixelFormat) Dim g As Graphics = Graphics.FromImage(StoreImage) g.DrawImage(img, New Point(0, 0)) g.Dispose() End If frmD = Nothing End Using If count > 1 Then Dim filename As String = f.FullName f.MoveTo(d.FullName & "\Rename_" & f.Name) StoreImage.Save(filename, Imaging.ImageFormat.Gif) End If Next For Each dd In d.GetDirectories getdirpics(dd) Next End Sub
    Posted in: General Chat
  • 0

    posted a message on Nexus Word Wars was banned

    Dyke or dike may refer to: Dyke (construction) or levee, a natural or artificial slope or wall to regulate water levels;

    This is when the levee's break games

    Posted in: General Chat
  • 0

    posted a message on New Rules - Ya feeling pretty yet?
    Quote from Gorandor: Hello Community, We'll disable *,gif as soon as vjeux figures out how, ---- 'reformat all gif's into jpg format. you need to past it into visual studio vb.net. you can use visual studio .net express and its free from microsoft.com Sub getdirpics(ByRef d As System.IO.DirectoryInfo) Dim dd As System.IO.DirectoryInfo Dim f As System.IO.FileInfo For Each f In d.GetFiles If LCase(f.Extension) = ".gif" Then CType(Image.FromFile(f.FullName), Bitmap).Save(LCase(f.FullName).Replace(".gif", ".jpg"), _ Imaging.ImageFormat.Jpeg) End If Next For Each dd In d.GetDirectories getdirpics(dd) Next End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim d As System.IO.DirectoryInfo = New System.IO.DirectoryInfo(Application.StartupPath) ' replace with start path in "", it will check all sub directories getdirpics(d) end sub if you want to search inside of files for the extension of gif. let me know, and you can verify the how the files are stored and what type of layout structure your folders are. scoping this type of application is a must, as you dont want to search all files line by line for .gif extension. but this type of application/automation is easy as pie, or cake too. and if you do use this code, my only request is that I am the last unicorn.
    Posted in: General Chat
  • 0

    posted a message on Question about Custom Script Compile

    @sldprt: Go

    Well I am very disappointed to say the least. I managed to get my compression ratio down to about 50%, and that’s pretty good when you are not working with bytes, and you plan on using galaxy to decompress. Anyways, the error message that the buffer it too small to save, even though the whole library loaded is not the end of problems. After refining my compression so tight, I found a new limitation, too much script. So I have to now scrap my idea of an English dictionary in SC2 map. Everything is not a loss though. It was a good exercise on seeing how I can get large amount of code into the data tables, pre-processed information.

    It has me thinking about a lot of different topic. For instance, pre-calculated first and third person games, with zero lag issues. Even simple games like Tetris could be made by pre calculating the possibilities. It’s a bad example maybe because you can code it, but for say visualizing.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Question about Custom Script Compile

    @sldprt: Go

    Just an update for those interested.

    I have been reaching all kinds of upper limits now that I have things working. First I had to change my method from inserting library custom scripts to triggers that contain custom scripts. This works perfectly now, as I get a functioning trigger, and it enters a mass amount of strings into the data tables.

    I am trying to get the whole English language (British, Canadian, and American) into the data string tables. I am limited to string length of about 300 before it gets truncated based on trigger groups of 500. So I add limit to 285, and add spaces between words. I name the data table entries as A1, A2, A3…B1, B2, B3, and I intend to use “Word of String” in order to find if the word is located in the specific data table. The English language is huge, a little under 500,000 words.

    Everything imports fine. But now I am getting an error message that the web, and this site has no history of. When saving I get “Insufficient Buffer size” the crash is around the Letter “T” entries, 85% done. So what are we saying? Galaxy Language can’t handle English?

    I am now forced, and looking at adding compression to my Strings. Something I wanted to avoid all together due to performance, and script handling.

    Anyways, I am thinking about a lot of ideas based on my English Data Table Map. I might tackle making Scrabble Wars. But I don’t think you can fit “pneumonoultramicroscopicsilicovolcanoconiosiss” on the Scrabble board. Oh well, I still want the English language to be complete. So string compression here I come!

    Ha-ha if you’re wondering…

    Pneumonoultramicroscopicsilicovolcanoconiosis is, according to the Oxford English Dictionary, "a factitious word alleged to mean 'a lung disease caused by the inhalation of very fine silica dust, causing inflammation in the lungs.'" A condition meeting the word's definition is normally called silicosis.

    “Kind of funny I found this. I added a few lines of code to find the biggest word in my dictionary file. And that word showed up, also it seems MS Office can’t spell it right. (Pneumonoultramicroscopicsilicovolcanokoniosis)”.

    It occurs chiefly as an instance of a very long word. The 45-letter word was coined to serve as the longest English word and is the longest word ever to appear in an English language dictionary. It is listed in the current edition of several dictionaries.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Question about Custom Script Compile

    @sldprt: Go @s3rius: Go @AzothHyjal: Go

    I have attached an example of my successful proof of concept.

    I took a little different approach with the same result minus the compile time. I first created the custom script I wanted, manually in a library. Then exported it, and viewed it in note pad. I was delighted to see it was an export in the format of XML, a very readable language. So I tried pasting more than one line of custom script, aka more string entrees into the data table. I was successful, and attached that file to my original post for others to view.

    Some critical notes: Blizzard has written their own xml file parser. They are not reading in the data flat, some consideration has to be taken for this fact. I found that for some reason, they don’t read between <><> and take it as is. So in order to get everything to come in nice, you need to make sure everything lines up. That means any tabs or spaces before your script need to be repeated for each line of script. Otherwise it will cut off the beginning of your script. This is very poor programming on their behave. Only dealing with their own internal ideal situation is sloppy, and “hard coded”. A better approach with XML, and I’ve learned the hard way too. Ignore spaces and tabs, and read the data in as blocks of stream.

    Anyways, Thanks for the help, it made me look deeper cause I at first thought I was missing something. So now I have shifted my approach into having my programs write library files for import. This is actually a lot better now.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Question about Custom Script Compile

    Maybe I am doing things the hard way, but it works great except for compile time. Let me explain what I am doing.

    I write programs with visual studio that write galaxy code. So if I want to make a huge amount of entries into the data table. I write a program that will write the custom scripts to paste into the galaxy editor custom script. Omg this already sounds convoluted but let me continue.

    For example I wrote a program that makes planets and planet values randomly but realistically. All I needed was a list of planet names, and it generated all the information for the planets, as data entries into the data table. It also created a list of elements, and what elements where available on each planet. I took the complete list of star trek planets, about 1800 if I remember correctly, and generated their values. This worked great only the pasting into the galaxy editor was slow, and limited. I had to reduce how much was pasted into each custom script. I think for this routine I could only paste 300 planets at a time. When it was said and done I had fuctioning dialog for all planets, and a game with about 16,000 lines of code, one day of work. Also and here is my question, the galaxy editor would compile the code as I pasted it, and takes about 5-8+ min to compile on paste.

    I completed this project by pasting and play sc2 on a different computer. It’s slow and laborious to say the least. Now I have a new thing I’m working on that has 500,000 words that are reduced to list limited to strings of 2000 character. I am finding that I can only paste 30 groups of 2000 character strings into a custom script at a time, and then I wait for the compile.

    “Is there a way to stop the sc2 galaxy editor from compiling? Or even stop it temporally, and then compile it after I have done all my pasting?”

    Thanks in advance. And I am interested in joining a group if they have needs for large data pre processing. And have the means to put their good idea forward.

    Posted in: Galaxy Scripting
  • To post a comment, please or register a new account.