• 0

    posted a message on World of Starcraft - Loading Screen Contest

    @Shakeslol: Go

    Yeah I am looking for a bit more original, and or starcraft based inspiration, World of Starcraft is just a production title I am using to give people a brief summary of what my game will be like :P

    Posted in: Artist Tavern
  • 0

    posted a message on World of Starcraft - Public Engine Released

    The data will be encrypted so the only abuse that could stem from xml data storage is people resetting their characters to previous versions, which was one of the problems of Save/Load codes, which banks surpass with unlimited data storage and hassle-free storage for the user.

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on Banking Hero Inventory-Items and upgrades.

    @Pandaros_Brewmaster: Go I am out of ideas, it is very difficult for me to check over your code because it isn't meant to be read by someone other then yourself. One last thing I could suggest is trying to store the unit types into a unit array, and try load through the array instead of using the bank unit restoration feature, I don't believe it is fully fleshed out yet because I couldn't get it working properly in my World of Starcraft map as well. If that doesn't work you must have some kind of typo or logical error hidden somewhere in those triggers.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Banking Hero Inventory-Items and upgrades.

    Your Player 1 Load Command is:

    Bank - Restore Player 1 - Hero Name of section "Hero" from bank (Last opened bank) for player 1 at (Center of Start Zone) facing 0.0

    You tell it to Restore "Player 1 - Hero Name", as the key for your bank section called "Hero".

    But here's what your Bank structure looks like in the XML...

    <?xml version="1.0" encoding="utf-8"?>
    <Bank version="1">
    <Section name="Hero">
    <Key name="-hero scmapper">
    <Type string="Lightning"/>
    <Shields fixed="0"/>
    <Life fixed="700"/>
    <Energy fixed="0"/>
    </Key>
    </Section>
    </Bank>

    The Key isn't Player 1 - Hero Name, it's -hero scmapper, so you need to fix that.

    Also make sure to add a Map Initialization Trigger that preloads each bank for each player, otherwise you will hit a stump when playing multiplayer and doing bank saves and loads. The reason the load works in game is because you are loading your value "Player 1 - Hero Name", and not the actual value from the bank, but when the game restarts and you try to actually do the load from the Bank you hit the error.

    EDIT - About the item question, I haven't played around with items yet so my answer to that was just pure theory, but if theres no ITEM data type, then it must be a form of a unit, so unit type arrays should work.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger] Return Region in custom Function

    From the code I see pasted above, you're getting a return value expected error because the function must ALWAYS return something, and the way you have it set up, it only has a return value if the if clause is true, so you also need to add a return outside of the if, or inside the else, to make sure the function always returns something.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Banking Hero Inventory-Items and upgrades.

    Keep Items Stored into a Item Array, Save the numbers of the items your character has as integer references to positions in that array, and then refer to the array with that integer to get the actual item. Banks store primitive data, not objects, so you need to be creative in how you use primitive types to get object data like items.

    Example ->

    exampleItemArray[0] = item1;
    exampleItemArray[1] = item2;
    exampleItemArray[2] = item3;
    exampleItemArray[3] = item4;

    Then if your character has item 4, you store the integer 3 however you wish to do so, then when you load it, you can convert that back into the array to recieve item4;

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Data] How to create an "invisible" behavior.

    @DieHardz: Go

    Dark Templars specifically have a flag checked that says Permanently Invisible, go into the unit and uncheck that flag.

    Posted in: Tutorials
  • 0

    posted a message on [Data] How to create an "invisible" behavior.

    This brief tutorial will teach you how to create a behavior that implements true invisibility, that is to say, you can see your character, your enemies can't. It's a simple behavior modification based off of the Permanently Cloaked Behavior.

    • Go into the Data Editor and go to the Behaviors Tab.
    • Search for Permanently Cloaked.
    • Make a duplicate of this behavior and call it whatever you like.
    • Select your new behavior and go down to the field: Modification +, double click on it.
    • Go to the second list from the top that is labelled State Flags.
    • You should see that the flag Cloak is already checked, select Bury and enable it by checking the enabled box.
    • You can now give this behavior to any unit and you will be able to see it just fine, and enemy players will not!
    Posted in: Tutorials
  • 0

    posted a message on FREE Max, Maya, Mudbox, for students of accredited Universities

    This is awesome :D

    Posted in: Artist Tavern
  • 0

    posted a message on [Trigger] Utilizing the Power of Functions with GUI
    Quote from Ttn114: Go

    Took me ages before I realized the editor had functions haha
    There's actually a way to call functions from the GUI; have the function return boolean true after completing successfully and use a "SetVariable blnOk = myFunction(params)" to call the function.

    Genius, thank you for that bit of information.

    Posted in: Tutorials
  • 0

    posted a message on World of Starcraft - Public Engine Released

    @s3rius: Go Because of the way you have your trigger set up, open bank is the first action in your trigger, if you try to throw it into a pick each player, if/else, or any kind of loop the map either doesnt compile or gets a runtime error if the banks arent preloaded.

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on [Contest] Clock

    Heres my Entry, I call it Clock. I tried to create the appearance of gears using the race selection circles :D

    Posted in: Project Workplace
  • 0

    posted a message on World of Starcraft - Public Engine Released

    I don't know the details, but opening an existing bank doesn't work unless you preload it at Map Initialization, Open Bank either finds an existing bank, or creates a new one, so are you sure that yours is finding an existing one without it being preloaded?

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on [Contest] Clock

    Do we post the map here or PM it to you?

    Posted in: Project Workplace
  • 0

    posted a message on [Trigger] Utilizing the Power of Functions with GUI

    FAIR WARNING, LOTS OF READING, A FEW PICTURES

    This is a tutorial/example map I will serve up to to enlighten the community on how to use functions with the trigger GUI.

    First, heres a very simple (Fellow programmers will want to bash their heads in with disgust if you continue reading) explanation of a function, this will be using generic code to get a point across before delving into the Trigger GUI:

    A function is a special block of code with a name. It can receive information, process it, and then return information. The reason it is a powerful tool in creating YOUR map is because it can be told to do some actions with a value you give it, then it will do those actions using that value, and return a value to you based on those actions. First I will go over the format of a function in generic code, then I while explain how it is translatable in GUI.

    int functionName(int functionParamater) {
    
    int functionVariable;
    
    functionActions;
    
    return functionReturnValue;
    }
    

    Things to note on the above structure:

    • You see the word int a lot of times in the above definition, it is a value that is interchanged based on the Object type, or Variable type. For example, the first int is considered the functions return type, that is to say, the type of variable this function returns to you when called. The second int is inside the parenthesis, which means its a paramater type, or the variable type of a kind of variable you are GIVING to the function to play with, and the int inside the body of the function is just a variable type, it is the type of a variable you declare, in this case, a local variable. Common types of variable/Object types are int, char, String, boolean or bool, double, float, and many more.
    • The top line of this function definition is called the method. A function method is the line that gives the function return type, name, and parameter(s). A method helps defines how a function can be called in code or in this case your Triggers.
    • The inside of the two brackets { } is considered the function body, and is what the function executes, very much like the ACTIONS in a TRIGGER.
    • All variables in a function are local variables, functions can refer to global variables, or variables outside of themselves, but can only create local variables inside of their bodies.
    • A functions parameters are just the framework variables you declare for a function, for example, if I made some of my function's parameters:
      int numberOfPencils, bool doIHavePencils, String whyIDontHavePencils
      
      Then the function would know to expect an int variable, a boolean variable, and a String variable to be given to IT, by the USER, whenever it is CALLED. Once a function is called and it has it's parameters, the parameters can be thought of as local variables, you can use them much like variables in triggers except that you shouldn't be altering the value of a parameter, which is why programmer's usually create local variables inside a function and then SET it to a parameter, so they can always modify that new local variable without messing with the parameter.
      [/list]
    • Inside the body you can see a variable declaration for a local variable called functionVariable
    • Where the function has functionActions, that is just a placeholder for all of the stuff you want the function to do.
    • The return value of the function, or what the function returns to the user and then exits, is denoted by
      return functionReturnValue;
      
      This return value can be a variable, or a simple 1,2,3,4,5,6,true,false,"I Like Sandwhiches", whatever. Examples:
      return 1;
      return "Sandwhiches YUM!";
      return true;
      return myAwesomeVariable;
      

      Now the important stuff about returns, ALL FUNCTIONS NEED THEM, they do not function without a return value, and once you return a value within a function, that function stops executing, no matter where in that function you returned a value, this can be used as an exit from the function in things like if/elses, and loops.

    Now that you have functional knowledge of a function, hahaha........, It's time to show you how this relates to the GUI functions in the Trigger Editor.

    Here is a picture of a new function in the trigger editor, and circled is the button that creates it.
    http://dl.dropbox.com/u/6541938/tutorials/functions/img/001.jpg

    Now lets take a look at the actual inner-workings of a GUI Function and relate back to the code function we talked about.
    http://dl.dropbox.com/u/6541938/tutorials/functions/img/002.jpg

    Options: Function Ignore this, I know I have and with wonderful results! (Note: Might be useful, might not be, either way, of no concern for newbie function enthusiasts.

    Return Type: Boolean This sets what type of value the function returns, this is the functions Return type as seen in the method of the code example.

    Parameters Right click on this and go to new > new paramater, you create this very much like you create a variable, and the way you order them matters for whenever you call your function

    Grammar Text: HERPDERPFUNCTION() This is how you would type the function call were you to call a function, you will see that as you change the name of the function, and add or remove parameters, this value changes.

    Hint Text I haven't needed this yet, so I will take the liberty of saying you don't either.

    Custom Script Code Same as Above

    Local Variables Any local variables you want to declare for this function, it is damn good programming etiquette to create and set a local variable for every parameter variable you have.

    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $
    5 Minute Nap Time #1
    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $

    Ok Now that you took a break I know you couldn't help but notice that the Break was labelled with a numerical symbol of counting, yes this tutorial is gonna be that long. Lets get back into it.

    Now that you know what a function works, what a GUI function looks like, and how to create one, it's time to USE one. I am going to create just some Trigger, it can be about anything but mine is going to be a trigger that executes a function every time a player presses the spacebar.

    I am not gonna post a picture of my Trigger, because I assume you know how to make one, but here is the text for it >

    Untitled Trigger 001
    Events
    UI - Player Any Player presses Space key Down with shift Allow, control Allow, alt Allow
    Local Variables
    Conditions
    Actions
    Placeholdercommentforcallingthetrigger

    Yes that's right, my actions is just a comment so far, thats because we will come back to this trigger once we finish creating our function!

    Alright, so lets think about what I would want my function to do every time I run it, I would want it to take the triggering player, such as player 1, and then display a game message saying that player is the greatest player of all time, then I would like it to return a boolean that equals true, if it did so without any problems.

    Lets convert what I want into function terms

    Return type : boolean
    Parameters: int thePlayer
    Local Variables: int player = thePlayer ( You can select a parameter much like you select a variable, it has its own tab)

    Aaaaand Now lets see what that looks like inside the GUI Function:
    http://dl.dropbox.com/u/6541938/tutorials/functions/img/003.jpg

    Ok, so we have the skeleton of the function set up, notice that I created an action that returns true, this is how the function exits itself, and how it tells you whatever you want to know, which in this case is: Did it do it's stuff properly? = TRUE

    Now lets just add some actions in there to make it do its thing and go back to the Trigger to see how to use the function:
    http://dl.dropbox.com/u/6541938/tutorials/functions/img/004.jpg

    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $
    5 Minute Nap Time #2
    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $
    $ $ $ $ $ $ $ $ $ $ $

    Alright you were probably less tired with reading on that last one, we were actually learning to create the thing this tutorial is about! Now, lets go back to the Trigger to learn the most important part, how to call the function in the current Galaxy Editor using GUI and absolutely ZERO Code!
    ...
    ...
    ...
    ...
    Theres no way to do that at the moment. Yep, seriously, we can create functions in GUI but we can't call them, I mean hell, we can call other triggers and they are just glorified functions themselves! WAIT WAIT don't close the window, I didn't lie to you, I just omitted an ugly truth. You will need to do a little typing to run a function. To call a function using GUI you need to create a new action, go to general, and click on custom script.

    Now that you have custom script going, type in the following to run this specific function

    gf_improvePlayerEgo(EventPlayer());
    http://dl.dropbox.com/u/6541938/tutorials/functions/img/005.jpg

    That will execute the function everytime the Trigger is executed. Now to explain some things you are now asking your computer screen:

    technically your function call should be improvePlayerEgo(EventPlayer()); but Galaxy requires a prefix to tell it where to look, let me go over some prefixes with you.

    gf = global function
    gv = global variable
    lv = local variable
    sc = Starcraft, you now understand my name if you didn't before. Please don't use that in your function calls... :)

    So, using the prefix we need to make our function call gf_improvePlayerEgo(EventPlayer());

    BUT WAIT, whats event player? Thats the script for TriggeringPlayer, which is a Galaxy Function that returns the integer of whatever player triggered the event. So if you just want to do player 1, your function call would be, gf_improvePlayerEgo(1);
    Now, even more tricky is if you wanted to do Picked Player, the function for determining that is PlayerGroupLoopCurrent(); , so your function call would be gf_improvePlayerEgo(PlayerGroupLoopCurrent());
    The semicolon at the end of all of my statements is used in code to denote the end of a line, and is what tells the compiler to treat that line as a statement.

    If you didn't understand any of that, don't worry, some playing around with it will get you on track. Now, run the map and keep pressing Space to see that functions really do work!

    Some final conclusion statements and answers to questions:

    Why didn't I do anything with the return of the function? Because for my specific example, I don't need to store the boolean of true to know that my function worked out, the Game Message does that for me! But, If I really wanted to store into a variable whatever my function returned, I would use some more Custom script, assume that myVariable, is the variable you want to store in, remember from above lv = local variable, and gv = global variable

    lv_myVariable = gf_improvePlayerEgo(EventPlayer());
    gv_myOtherVariable = gf_improvePlayerEgo(EventPlayer());

    Now if you were to query those variables, you would find that they held the values of TRUE, and the function ran!

    Biggest Question of All time: But SCMapper, why did I make a function, I could have just done triggering player inside of the Trigger! Well yes, this implementation of a function isn't very efficient. But what if you wanted to display a different message every-time of your own choice? You could add another parameter of type string, and then along with giving the function a player value, send it that string as well, and you could modify it to display the player's name and a different string with each run. BUT SCMAPPER..... I could still do that in in the trigger. You're right you can, but what if you did this 1000 times through 100 different triggers, and you realized you wanted to change something about it? Oops. There goes your month. BUT WAIT! Functions to save the day! Go into your function, modify what you want to modify, and those triggers will still all operate without a hitch.

    Ask any questions you want, I am very tired and probably left something out :) ENJOY

    MAP DOWNLOAD: http://dl.dropbox.com/u/6541938/tutorials/functions/001.SC2Map

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