The Gang Garrison 2 Forum
May 25, 2013, 04:25:37 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Chat with us on IRC: http://ganggarrison.com/irc.html
Server: irc.esper.net, Channel: #gg2
 
   Home   Help Search Login Register  
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 »
  Print  
Author Topic: >>Rules<<, FAQ, and ==Help== [GML General]  (Read 72318 times)
♫Sani Sani Disco♫
Moderator
*****
Offline Offline

Posts: 10508


yo let's suck face and listen to rap music


WWW
« on: April 18, 2009, 05:48:37 pm »

Hello everyone, Sani here. Time to lay down the law of the land:

Rules for the Members:

1) No Request threads. We have a thread for that.
2) Threads to plan mods will be closed if no progress is made within a week. There are loopholes through this that I don't feel I should go into.
3) If you have something to contribute to an old mod, post in it's topic, rather than making a new one for it.
    -addendum: Don't do this if the maker of the mod doesn't come here anymore or if they discontinue it.
4) Don't make too many threads in a short period of time. Keep it within reason.
5) No hacks. AI is allowed.
6) You can post mods of other games, but they have to be labeled in a clear way.

Rules for the Moderators:

1) Discuss new rules with the other moderators
2) Use your brain when locking threads
3) Don't delete posts unless you have to
4) Don't participate in drama
    -addendum: Don't make the drama too much worse than it already is if you really want to jump in
      -(This addendum is mostly because Sani is a meanybutt bully)

If something's wrong, Try PMing me or Wareya. If you need help, post here or ask in IRC. If you don't like the rules then bring them up with one of us. Be sure to have something to back up your arguments beforehand.
« Last Edit: July 02, 2011, 11:40:51 pm by ‭‎‭Wareya‮ N-A ‭ » Logged

Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  Nah
Oh, well, you might as well pack up and stop now, because he doesn't like it
Asdf64: "ultros turned me on" - sani 2013
Phantom Brave
All Hail Classicwell
Moderator
*****
Offline Offline

Posts: 9068


Another one --


WWW
« Reply #1 on: February 07, 2010, 11:54:06 pm »

FAQ

Character Event Basics:
Create event creates all the variables the weapon uses, like max ammo count, reload speed, refire rate, xoffset and yoffset (these are so the weapon aligns with the sprite properly), and anything else you need for the weapon to function correctly.
Alarms are usually for reloading ammo, and determining when you can fire again. Alarm[0], which is part of the 'Weapon' parent object, determines when the weapon is ready to fire (arbitrarily chosen in gg2).
Step events are run through every step (frame). Usually for regenerating ammo, or charging up meter.
Destroy event is activated when the weapon is destroyed. Use it to resolve and destroy any projectiles that belong to the weapon.
User Defined Event 1 is M1 press (arbitrarily chosen in gg2).
User Defined Event 2 is M2 press (arbitrarily chosen in gg2).
User Defined Event 3 is M1 release (arbitrarily chosen in gg2).
User Defined Event 12 is the serialize event. Whenever this is called in the serializeState script (which serializes each player and their character objects), it sends data to the server. Put important weapon variable stuff here that you don't want to get desynced. Just copy the format of the other weapon's code (arbitrarily chosen in gg2).
User Defined Event 13 is the deserialize event. This is when you set all the variables to the data received by the server (arbitrarily chosen in gg2).

Just go explore around in the code and make small changes and see what that does. When you feel like it, you can start to create new classes with new weapons (duplicating existing objects is the easiest route).


Font Issues:


If you do this your mod will automaticcaly use the gg2 font.

Installing Extensions:
Extensions are compiled dlls made in other languages you can add to Game Maker.
You need to install a few extensions to be able to compile gg2, not doing so will follow errors, like this one:
Code:
___________________________________________
COMPILATION ERROR in Script: CustomMapInit
Error in code at line 9:
     leveldata = GG2DLL_extract_PNG_leveldata(argument0, tempfile);
                 ^
at position 16: Unknown function or script: GG2DLL_extract_PNG_leveldata

To install them, open Game Maker, and select "Resources", then "Select Extension Packages".

Then, keep clicking "Install" until a small window appears, asking you for a file. Navigate to your "Gang Garrison 2/Source" folder, and click on everything that ends with ".gex". These are all extensions.

Lastly, go back to the first "Extension Packages" window. Add every option in the right column into the left one by clicking on them and on the blue arrow.

Also, keep in mind that this needs the full version of Game Maker, so lite won't suffice. If you really want to mod, but can't/don't want to get Pro, you can probably post the source and ask for someone to compile it for you.


Using the Mod Lobby:
You might have seen once that mods have their own tag in the lobby, as well as a download link if they are not compatible.
Here is the code that sends all your information to the lobby:

Code: (Scripts-->GameServer-->sendLobbyRegistration)
var noOfPlayers;
noOfPlayers = ds_list_size(global.players);
if(global.dedicatedMode)
    noOfPlayers -= 1;

var lobbyBuffer;
lobbyBuffer = buffer_create();
set_little_endian(lobbyBuffer, false);

parseUuid("b5dae2e8-424f-9ed0-0fcb-8c21c7ca1352", lobbyBuffer); // Message Type "register"
write_buffer(lobbyBuffer, GameServer.serverId);
write_buffer(lobbyBuffer, global.gg2lobbyId);
write_ubyte(lobbyBuffer, 0); // TCP
write_ushort(lobbyBuffer, global.hostingPort);
write_ushort(lobbyBuffer, global.playerLimit);
write_ushort(lobbyBuffer, noOfPlayers);
write_ushort(lobbyBuffer, 0); // Number of bots
if(global.serverPassword != "")
    write_ushort(lobbyBuffer, 1);
else
    write_ushort(lobbyBuffer, 0);

write_ushort(lobbyBuffer, 7); // Number of Key/Value pairs that follow
writeKeyValue(lobbyBuffer, "name", global.serverName);
writeKeyValue(lobbyBuffer, "game", "Gang Garrison 2");
writeKeyValue(lobbyBuffer, "game_short", "gg2");
writeKeyValue(lobbyBuffer, "game_ver", GAME_VERSION_STRING);
writeKeyValue(lobbyBuffer, "game_url", "http://www.ganggarrison.com/");
writeKeyValue(lobbyBuffer, "map", global.currentMap);
write_ubyte(lobbyBuffer, string_length("protocol_id"));
write_string(lobbyBuffer, "protocol_id");
write_ushort(lobbyBuffer, 16);
write_buffer(lobbyBuffer, global.protocolUuid);

udp_send(lobbyBuffer, LOBBY_SERVER_HOST, LOBBY_SERVER_PORT);
buffer_destroy(lobbyBuffer);

This may look daunting, but don't worry. It's actually pretty simple.

The only code that interests you is this:
Code:
writeKeyValue(lobbyBuffer, "game", "Gang Garrison 2");
writeKeyValue(lobbyBuffer, "game_short", "gg2");
writeKeyValue(lobbyBuffer, "game_ver", GAME_VERSION_STRING);
writeKeyValue(lobbyBuffer, "game_url", "http://www.ganggarrison.com/");
In there you can write any string you wish.
Code:
writeKeyValue(lobbyBuffer, "game", "My Awesome Mod");
writeKeyValue(lobbyBuffer, "game_short", "MAM");
writeKeyValue(lobbyBuffer, "game_ver", GAME_VERSION_STRING);
writeKeyValue(lobbyBuffer, "game_url", "http://www.ganggarrison.com/forums/index.php?topic=18089.msg41529#msg41529");
Notice the link for "game_url". This is only used if the mod is incompatible with Vanilla, so people who click on the server will get redirected to that link.
So put your mod thread link there.

Next, open the "Resources" menu, and select "Define Constants". Constants are names for strings or numbers you can't change in the code, and are global.
For example, there you will find the "GAME_VERSION_STRING" constant. You might want to change that to the version of your mod.

Finally, if your mod is incompatible, you have to get another UUID. For this go into the Source folder, and click on the "UUIDgenerator.html" file. Copy-paste the resulting UUID string into the constant PROTOCOL_UUID, not the GG2_LOBBY_UUID.
This will make your server greyed out in the lobby, and if anyone clicks on it, it'll direct the user to whatever link you specified.


How to Add New Classes:
First you have to add another variable in the constants for the new class [Look that up yourself. I'm lazy, piss off]
Then, you have to open the getCharacterObject script and add another string for the new class
Example:
Code:
//this goes under the blue team's half of the code
        case (TEAM_BLUE*16 + CLASS_QUOTE):
            return QuoteBlue;
//That will bring up Curly in the current client
//So, all you have to do is change CLASS_QUOTE to whatever you named the constant
//For example, if the constant was named CLASS_NEW
        case (TEAM_BLUE*16 + CLASS_NEW):
            return NewBlue;
//Rinse and repeat for the Red team
"return NewBlue", or whatever you name it, it doesn't really matter, calls upon an object. That controls what color it comes up as, like a red scout, or Quote and Curly. Remember to make that object.

After you've done that, make a Parent object for them. In the source, they're the ones that are just named after the classes. "Scout", "Spy", "Sniper" etc.
That's where you add all the variables to the class, which controls their speed and whatnot. Set this object as the parent for the NewRed, NewBlue, or whatever you decide to name it. Look up how to do that, too. I'm really fucking lazy.

Now stop asking. ~Sani



Contributors and previous versions of this post: mrfredman, cspotcode, BassieEnAdriaan, BassMakesPaste, Wareya, Sani, Orpheon
ps sprite mods tend to make the game worse, BUT NOT ALWAYS SO LOOK OUT
« Last Edit: January 06, 2012, 04:44:20 pm by Rainy » Logged

Phantom Brave
All Hail Classicwell
Moderator
*****
Offline Offline

Posts: 9068


Another one --


WWW
« Reply #2 on: February 07, 2010, 11:55:57 pm »

Don't post things like this:
This is the third and final time I'm going to do this.

Quote
every class will have party hats
blood will be replaced with confetti
gibs will be replaced with miscellaneous objects
death with be replaced with cheering children
and a few other things that I forgot

download is coming when ever.
« Last Edit: June 29, 2010, 07:15:41 pm by Wareya » Logged

Hydra
Sr. Member
****
Offline Offline

Posts: 270


Google-Fu Black Belt


WWW
« Reply #3 on: February 08, 2010, 05:35:38 pm »

Quick Question.  Where are the lines of code that have to do with the player's name?  I'm having issues with something I'm doing, and I think I have to check in there.

EDIT: Mainly I need to know which pieces of code have to do with the characters name appearing when the mouse hovers over it.
« Last Edit: February 08, 2010, 05:43:46 pm by Hydra » Logged

I have the attention span of a retarded magpie in a metal refinery.

a/d
pro donglosaur
*****
Offline Offline

Posts: 4922



« Reply #4 on: February 08, 2010, 06:21:12 pm »

Experimental AI is allowed?

Cool.
Logged

go canada or whatever, maybe your country is cool too
Phantom Brave
All Hail Classicwell
Moderator
*****
Offline Offline

Posts: 9068


Another one --


WWW
« Reply #5 on: February 08, 2010, 06:26:07 pm »

Quick Question.  Where are the lines of code that have to do with the player's name?  I'm having issues with something I'm doing, and I think I have to check in there.

EDIT: Mainly I need to know which pieces of code have to do with the characters name appearing when the mouse hovers over it.

    if(distance_to_point(mouse_x, mouse_y)<25) {
        if cloak && team!=global.myself.team exit;
        draw_set_alpha(1);
        draw_set_halign(fa_center);
        draw_set_valign(fa_bottom);
        if(team==TEAM_RED) {
            draw_set_color(c_red);
        } else {
            draw_set_color(c_blue);
        }
        draw_text(xr, yr-35, player.name);
    }

character object draw event
Logged

Hydra
Sr. Member
****
Offline Offline

Posts: 270


Google-Fu Black Belt


WWW
« Reply #6 on: February 08, 2010, 06:44:58 pm »

Quick Question.  Where are the lines of code that have to do with the player's name?  I'm having issues with something I'm doing, and I think I have to check in there.

EDIT: Mainly I need to know which pieces of code have to do with the characters name appearing when the mouse hovers over it.

    if(distance_to_point(mouse_x, mouse_y)<25) {
        if cloak && team!=global.myself.team exit;
        draw_set_alpha(1);
        draw_set_halign(fa_center);
        draw_set_valign(fa_bottom);
        if(team==TEAM_RED) {
            draw_set_color(c_red);
        } else {
            draw_set_color(c_blue);
        }
        draw_text(xr, yr-35, player.name);
    }

character object draw event

Thanks a bunch Wareya.
Logged

I have the attention span of a retarded magpie in a metal refinery.

Hydra
Sr. Member
****
Offline Offline

Posts: 270


Google-Fu Black Belt


WWW
« Reply #7 on: February 09, 2010, 12:04:29 am »

'Nother question.  How exactly would I make it so that pressing r would show the uber bubble?  I've been messing around in the Player Control object, but with no success.
Logged

I have the attention span of a retarded magpie in a metal refinery.

L
Guest
« Reply #8 on: February 09, 2010, 12:14:12 am »

Simple

First make a Keyboard event on R and execute this
Code:
    clearbuffer(global.sendBuffer);
    writebyte(CHAT_BUBBLE,global.sendBuffer);
    writebyte(46,global.sendBuffer);
    sendmessage(global.serverSocket, 0, 0, global.sendBuffer);
Basically send the message to the server of the said bubble on keyboard event, in this case bubble 46
Logged
Hydra
Sr. Member
****
Offline Offline

Posts: 270


Google-Fu Black Belt


WWW
« Reply #9 on: February 09, 2010, 12:17:53 am »

Simple

First make a Keyboard event on R and execute this
Code:
    clearbuffer(global.sendBuffer);
    writebyte(CHAT_BUBBLE,global.sendBuffer);
    writebyte(46,global.sendBuffer);
    sendmessage(global.serverSocket, 0, 0, global.sendBuffer);
Basically send the message to the server of the said bubble on keyboard event, in this case bubble 46


Gah, are you stalking me?   xD  Anyways, is there a way to make it so it won't send if the in-game menu (esc) is open?  This is startlingly close to something I tried that worked, but it would send even if the menu was open (i.e. me changing my name).
Logged

I have the attention span of a retarded magpie in a metal refinery.

L
Guest
« Reply #10 on: February 09, 2010, 12:24:39 am »

Simple

First make a Keyboard event on R and execute this
Code:
    clearbuffer(global.sendBuffer);
    writebyte(CHAT_BUBBLE,global.sendBuffer);
    writebyte(46,global.sendBuffer);
    sendmessage(global.serverSocket, 0, 0, global.sendBuffer);
Basically send the message to the server of the said bubble on keyboard event, in this case bubble 46


Gah, are you stalking me?   xD  Anyways, is there a way to make it so it won't send if the in-game menu (esc) is open?  This is startlingly close to something I tried that worked, but it would send even if the menu was open (i.e. me changing my name).
Panic


Yea make it like this
Code:
if menuOpen=false{
    clearbuffer(global.sendBuffer);
    writebyte(CHAT_BUBBLE,global.sendBuffer);
    writebyte(46,global.sendBuffer);
    sendmessage(global.serverSocket, 0, 0, global.sendBuffer);
}
else{
exit;
}
The menuOpen variable is found under the step event, and is used to determine when the menu is open.
Logged
Hydra
Sr. Member
****
Offline Offline

Posts: 270


Google-Fu Black Belt


WWW
« Reply #11 on: February 09, 2010, 12:26:21 am »

Thanks!
Logged

I have the attention span of a retarded magpie in a metal refinery.

L
Guest
« Reply #12 on: February 09, 2010, 10:04:11 pm »

What is considered a hack mod?

I have a mod here that draws alot of circles and lines and such, but no spy revealing or anything...
Lopl

I CAN SEE SNIPER LINE AND SENTRY TARGET AREA WITH TRAJECTORY
Logged
NAGN
Developer
******
Offline Offline

Posts: 16895


Yeah so now I have an idea


« Reply #13 on: February 09, 2010, 10:05:00 pm »

What is considered a hack mod?

I have a mod here that draws alot of circles and lines and such, but no spy revealing or anything...
And shows sentry bounderies?

That's considered "Hacking" because it gives you an unfair advantage (like lazer sites ect.)

FHAIWEGPAWEGNAWEPJGIWEPBJARWB Ninja
« Last Edit: February 09, 2010, 10:05:14 pm by NAGN » Logged



[im
ubd
2011 Haxxy Award Winner
*
Offline Offline

Posts: 4074


« Reply #14 on: February 09, 2010, 10:25:03 pm »

I have a quick question:
How can I set up a color filter over certain objects?
I.E, to make everything darker ingame except for character sprites, weapons, projectiles and HUD sprites.
Logged
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.307 seconds with 19 queries.