1 (edited by CarmineZ 2010-09-03 21:33:08)

Topic: HOW show simple gun pickup?....smoke particles/game effect

new:
i add in this post another question:
i read some part of code about gun like ITEM_WEAPON_GUN 0x00010001
i want in my server mod to show gun and hammer and hook possible pickup it!

new pickup (type, subtype)
game.world.insert_entities(this* ENTYTIES)

this code ^^ is only for example, no look sintax error please




OLD POST:
I didn't found in the game.png & particles.png nothing like smoke
example: when you run (go with hi speed) fast to left and fast change to right, appear smok under foot
someone know from where smoke come? (where in code source?)

2

Re: HOW show simple gun pickup?....smoke particles/game effect

In game/server/gamecontext.h

void CreateSmoke(vec2 Pos);

And in game/server/gamecontext.cpp

/*
void create_smoke(vec2 p)
{
    // create the event
    EV_EXPLOSION *ev = (EV_EXPLOSION *)events.create(EVENT_SMOKE, sizeof(EV_EXPLOSION));
    if(ev)
    {
        ev->x = (int)p.x;
        ev->y = (int)p.y;
    }
}*/

3

Re: HOW show simple gun pickup?....smoke particles/game effect

i already know that ^ you show me, but if i want use the function "create_smoke",
---> error build

4

Re: HOW show simple gun pickup?....smoke particles/game effect

You can find it on game/client/components/effects.cpp :

void EFFECTS::skidtrail(vec2 pos, vec2 vel)

5 (edited by CarmineZ 2010-09-04 09:53:17)

Re: HOW show simple gun pickup?....smoke particles/game effect

topic updated, another question:
HOW to disable self kill?
i found WEAPON_SUICIDE = -2;
i try to put in                     character:on_die(......
at first line:                       if (weapon == -2) return;
and when i use kill command, no make score -1, but i respawn/reborn the same.
help please!

6

Re: HOW show simple gun pickup?....smoke particles/game effect

Look at game/server/hooks.cpp, line 400 :

    else if (msgtype == NETMSGTYPE_CL_KILL && !game.world.paused)
    {
        if(p->last_kill+time_freq()*3 > time_get())
            return;
        
        p->last_kill = time_get();
        p->kill_character(WEAPON_SELF);
        p->respawn_tick = server_tick()+server_tickspeed()*3;
    }

7

Re: HOW show simple gun pickup?....smoke particles/game effect

thanks very much, can you  help me to show hammer and gun pickup in the map?