1 (edited by JB4 2008-02-23 11:39:49)

Topic: JB's Questions

Alright I decided that anytime I have a question about the coding I would just post it in here, that way I didn't have like 20 topics of different questions...


QUESTION 1
---------------------------------------------------------------------------------------------------------------
to start it off, could someone please explain to me what this coding is? like break it down for me? I am Really fascinated with programming and this is the perfect opportunity to learn (hopefully). As a 15 year old kid in a high school, with no programming classes at all, I'm hoping to learn every little bit I can from other places.

(from gs_server.cpp)

case WEAPON_GUN:
{
    new projectile(WEAPON_GUN,
        client_id,
        pos+vec2(0,0),
        direction*30.0f,
        100,
        this,
        1, 0, 0, -1, WEAPON_GUN);
    create_sound(pos, SOUND_GUN_FIRE);
    break;
}

I know (hopefully) that this is telling it whats going on with the shot from a gun (the original gun).

what I THINK I know:
it's going for 30f's (?feet?) forward.


what does the rest of it mean? like "pos+vec2(0,0)," and "1, 0, 0, -1, WEAPON_GUN);"


---------------------------------------------------------------------------------------------------------------




QUESTION 2

---------------------------------------------------------------------------------------------------------------
after reading peoro's post about modding a server,  he talked about 3 files,
src/game/server/gs_game.cpp
src/game/g_protocol.h
src/game/server/gs_server.cpp

what are these 3 files used for?



---------------------------------------------------------------------------------------------------------------

thanks for any help anyone provides.

also if I am doing anything illegal or something let me know and I will immediately stop.

<JB4> hehe <3 matricks (not in a gay way though) <matricks> awww sad <JB4> thats wrong I'm friggen 15... <matricks> thats legal here in sweden big_smile

2

Re: JB's Questions

Don't take me wrong but I think you're approaching it from the very wrong side. If you want to learn programming, then learn programming. Your questions basically tell me that you have no idea whatsoever. Teewars is NOT the perfect way to learn programming. Game programming is an artistry itself. Start with the basics. Only because Teewars is 2D doesn't mean it necessarily easier than Quake3 when it comes to game mechanics.

3 (edited by kan³ix 2008-02-23 18:03:33)

Re: JB's Questions

this is creating a new instance of the projectile class
The constructor has following parameters:
projectile(int type, int owner, vec2 position, vec2 velocity, int span, entity* powner,
        int damage, int flags, float force, int sound_impact, int weapon);

Though 15a old is not the right age to learn game coding really ...

kann nix kann alles
irc: fedeago_UTzone
teelove

4

Re: JB's Questions

kan³ix wrote:

this is creating a new instance of the projectile class
The constructor has following parameters:
projectile(int type, int owner, vec2 position, vec2 velocity, int span, entity* powner,
        int damage, int flags, float force, int sound_impact, int weapon);

thank you! thats exactly what I wanted. And I don't really care if you think this is how I should learn programming, this is how I'm going to do it.

and 15 is the perfect age! I have all the time in the world, and it's just a few years before heading into college.

<JB4> hehe <3 matricks (not in a gay way though) <matricks> awww sad <JB4> thats wrong I'm friggen 15... <matricks> thats legal here in sweden big_smile

5

Re: JB's Questions

JB4 wrote:

thank you! thats exactly what I wanted. And I don't really care if you think this is how I should learn programming, this is how I'm going to do it.

and 15 is the perfect age! I have all the time in the world, and it's just a few years before heading into college.

You know, if you had any clue what you were doing you would understand by basic coding knowledge that  new projectile(...) calls the ctor of the class and then you would head over to the ctor definition because paramters usually have a meaningful name and by then you would've known what you asked. The thing is that you lack the proper thinking so start with learning coding and then game programming is a natural thing.

Plus, I don't care what your age is. I started programming very early as well. If you smart enough, fine.