November 27, 2021, 08:44:35 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1] 2 3 ... 120

Author Topic: >>Rules<<, FAQ, and ==Help== [GML General]  (Read 180897 times)

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12416
>>Rules<<, FAQ, and ==Help== [GML General]
« 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
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
>>Rules<<, FAQ, and ==Help==
« Reply #1 on: February 07, 2010, 10: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: [Select]
___________________________________________
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".
(click to show/hide)

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.
(click to show/hide)

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.
(click to show/hide)

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) [Select]
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: [Select]
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: [Select]
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: [Select]
//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, 03:44:20 pm by Rainy »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
This is the kind of topic you don't post.
« Reply #2 on: February 07, 2010, 10: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

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Hydra

  • Full Member
  • ***
  • Karma: 19
  • Offline Offline
  • Posts: 270
  • Google-Fu Black Belt
    • My Steam
Re: Rules, FAQ, and Help
« Reply #3 on: February 08, 2010, 04: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, 04:43:46 pm by Hydra »
Logged
I have the attention span of a retarded magpie in a metal refinery.

a/d

  • pro donglosaur
  • *****
  • Karma: 371
  • Offline Offline
  • Posts: 4989
Re: Rules, FAQ, and Help
« Reply #4 on: February 08, 2010, 05: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
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: Rules, FAQ, and Help
« Reply #5 on: February 08, 2010, 05: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

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Hydra

  • Full Member
  • ***
  • Karma: 19
  • Offline Offline
  • Posts: 270
  • Google-Fu Black Belt
    • My Steam
Re: Rules, FAQ, and Help
« Reply #6 on: February 08, 2010, 05: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

  • Full Member
  • ***
  • Karma: 19
  • Offline Offline
  • Posts: 270
  • Google-Fu Black Belt
    • My Steam
Re: Rules, FAQ, and Help
« Reply #7 on: February 08, 2010, 11:04:29 pm »

'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
Re: Rules, FAQ, and Help
« Reply #8 on: February 08, 2010, 11:14:12 pm »

Simple

First make a Keyboard event on R and execute this
Code: [Select]
    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

  • Full Member
  • ***
  • Karma: 19
  • Offline Offline
  • Posts: 270
  • Google-Fu Black Belt
    • My Steam
Re: Rules, FAQ, and Help
« Reply #9 on: February 08, 2010, 11:17:53 pm »

Simple

First make a Keyboard event on R and execute this
Code: [Select]
    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
Re: Rules, FAQ, and Help
« Reply #10 on: February 08, 2010, 11:24:39 pm »

Simple

First make a Keyboard event on R and execute this
Code: [Select]
    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: [Select]
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

  • Full Member
  • ***
  • Karma: 19
  • Offline Offline
  • Posts: 270
  • Google-Fu Black Belt
    • My Steam
Re: Rules, FAQ, and Help
« Reply #11 on: February 08, 2010, 11:26:21 pm »

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

L

  • Guest
Re: Rules, FAQ, and Help
« Reply #12 on: February 09, 2010, 09: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
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16769
  • Yeah so now I have an idea
Re: Rules, FAQ, and Help
« Reply #13 on: February 09, 2010, 09: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, 09:05:14 pm by NAGN »
Logged

Psychopath

  • Developer In Training
  • ******
  • Karma: 167
  • Offline Offline
  • Posts: 6696
  • Stop telling me to do things
Re: Rules, FAQ, and Help
« Reply #14 on: February 09, 2010, 10:13:05 pm »

What unfair advantages? :hehe:
(click to show/hide)
lopl, draw_line(), draw_text(), and draw_circle()
Logged
Quote from: IRC
(8:01:46 PM) Psychopath: I'm just wondering what the next hot thing to fall on my lap will be
(8:01:57 PM) Lynn1: a girl maybe?
(8:02:01 PM) Psychopath: :o
Pages: [1] 2 3 ... 120
 

Page created in 0.043 seconds with 36 queries.