PDA

View Full Version : emotes and other thing for OJP


Red_Rain
09-11-2005, 10:50 AM
Hi guys!

I have checked the dueler's JA 1.1 source code and extracted some stuff, for example emots, macro scans and some bug fixes.
I would like to know what you think about it. Since I have no writhing acces to the OJP source I would need somebody, who would do it for me.
The emots are the following: sit, sit2, sit3, sit4, sit5, sit 6, sit7, surrender, await, cower, grovel, aloraspin, alorataunt, beg, looks, flip, coding, throw1, throw2, spintaunt, super, draw, dance1, dance2, dance3, nod, shake, comeon, hug, sleep, bounce, breakdance, bequiet, pain, kneel, think, crouch.
Macro scans prevent clients from using script to execute moves with a single button.
The bug fix I have found in the dueler's code prevents the red DFA from being executed if you running up a stair and pressing attack. I haven't seen it, but it happened to me while in the yellow style. I have fixed this, too. The last fix is about a bug in saber style cycling. You were able to change your style, e.g. from red to blue, and you would do the same attacks of your previous style in an other.

Wudan
09-11-2005, 12:50 PM
Eeeewwww, emotes.

TK-8252
09-11-2005, 02:26 PM
Eeeewwww, emotes.

Quoted for emphasis.

Red_Rain
09-12-2005, 02:39 PM
I will start with the bug fixes, since they are the smallest. I use the -tag to show them:

1. prevent saberattackcycle bug:

g_cmds.c:

void Cmd_SaberAttackCycle_f(gentity_t *ent)
{
int selectLevel = 0;
qboolean usingSiegeStyle = qfalse;
// MJN - Saber Cycle Fix - Thanks Wudan!!
if ( ent->client->ps.weapon != WP_SABER )
{
return;
}
//[fix] prevent saberAttackCycle while attaking
if( ent->client->ps.weaponstate == WEAPON_FIRING )
{
return;
}
//

if (ent->client->saber[0].model[0] && ent->client->saber[1].model[0])
{ //no cycling for akimbo
...

2. yellow and red DFA fix:
bg_saber.c:

in PM_SaberAttackForMovement:
...
else if (!noSpecials&&
pm->ps->fd.saberAnimLevel == SS_MEDIUM &&
//
(pm->cmd.upmove > 0 || pm->ps->pm_flags & PMF_JUMP_HELD) &&
//
pm->ps->velocity[2] > 100 &&
PM_GroundDistance() < 32 &&
!BG_InSpecialJump(pm->ps->legsAnim) &&
!BG_SaberInSpecialAttack(pm->ps->torsoAnim)&&
BG_EnoughForcePowerForMove(SABER_ALT_ATTACK_POWER_ FB))
{ //FLIP AND DOWNWARD ATTACK
//trace_t tr;

//if (PM_SomeoneInFront(&tr))
{
newmove = PM_SaberFlipOverAttackMove();
if ( newmove != LS_A_T2B
&& newmove != LS_NONE )
{
BG_ForcePowerDrain(pm->ps, FP_GRIP, SABER_ALT_ATTACK_POWER_FB);
}
}
}
else if (!noSpecials&&
pm->ps->fd.saberAnimLevel == SS_STRONG &&
//
(pm->cmd.upmove > 0 || pm->ps->pm_flags & PMF_JUMP_HELD) &&
//
pm->ps->velocity[2] > 100 &&
PM_GroundDistance() < 32 &&
!BG_InSpecialJump(pm->ps->legsAnim) &&
!BG_SaberInSpecialAttack(pm->ps->torsoAnim)&&
BG_EnoughForcePowerForMove( SABER_ALT_ATTACK_POWER_FB ))
{ //DFA
//trace_t tr;

//if (PM_SomeoneInFront(&tr))
{
newmove = PM_SaberJumpAttackMove();
if ( newmove != LS_A_T2B
&& newmove != LS_NONE )
{
BG_ForcePowerDrain(pm->ps, FP_GRIP, SABER_ALT_ATTACK_POWER_FB);
}

}
}
else if ((pm->ps->fd.saberAnimLevel == SS_FAST || pm->ps->fd.saberAnimLevel == SS_DUAL || pm->ps->fd.saberAnimLevel == SS_STAFF) &&
...

Could somebody added this fixes to the OJP source?

Kurgan
09-13-2005, 11:19 AM
The trouble with emotes is that they are JK2 style, not JA style.

JA "emotes" (actually called "taunts" officially) can be cancelled by hitting the jump or attack keys, and you must be standing still to activate them. They offer NO protection from any kind of attacks or force powers.

The JK2 style emotes are hacked from the single player cutscenes into MP by various mods and then recycled from one mod to the next and then ported over to JA to the present day. They typically lock you in place and let you "rotate" with the mouse in that pose until you've hit the controls again to get out of it. They offer you protection from certain kinds of attacks.

These commands were tossed in to facilitate "honorz" role playing and other crap, do we honestly want them in OJP? And if we did, do we have to keep the exact same names? It's not as if these JK2 mod makers created them, they just took animations that Raven created and assigned them to commands.

If they were introduced, I'd say there should be a cvar to enable or disable them in the game mode you're in, and they should be modified so they all conform to the JA standard (ie: no protection, cancel with an attack or jump instantly, require you to be standing still to activate to prevent spammage, etc).

The JA team originally put the extra taunts into Duel and Power Duel only. Razor decided to enable them in all game modes. But if we throw these into the mix too, I would think it would be chaos in the overall game. People would try to use these to turn the game into a role playing environment or virtual chatroom, and then get angry when they got killed.

So I'm for lessening the evil of such an addon if it's used. ;)

The "scripts scanner" should be powerful enough that it recognizes and ignores macros that do very simple things like change your clothing color or skin or name or binds a chat to a key or a voice command to a key. Similarly binding a force power or two to a key should be allowed. If the scanner stops those kinds of basic things that everyone uses, it would get very annoying fast. Binding things to keys isn't a problem.

Also, the admins need to use vstr's for their map/game mode cycles. Would a script scanner prevent those from working?

Any such scanner should also include the ability to turn it OFF if it's causing too many problems. Not all scripts are "evil."

The bug fix I have found in the dueler's code prevents the red DFA from being executed if you running up a stair and pressing attack. I haven't seen it, but it happened to me while in the yellow style. I have fixed this, too. The last fix is about a bug in saber style cycling. You were able to change your style, e.g. from red to blue, and you would do the same attacks of your previous style in an other.

This might be helpful. I have often accidentally (in Siege for example) been chasing somebody up a ramp and tried to slash at them (while in Medium stance) and I ended up doing the useless "Yellow DFA" and thus lost the chase. The other stuff sounds good!


PS: You say you got these from the "Duelers Code." I hope that means you have permission to use this code in another mod, such as OJP?

Red_Rain
09-19-2005, 11:23 AM
the source of the duelers JA 1.1 Mod is open source, I suppose that I am allowed to use it. Check out http://duelers.jk2files.com if you want to be sure.
Has somebody already integrated the bug fixes?

To the macro scans:
-they can be turned of by cvar
-they tell you if they block something
-they allow simple stuff like: bind a "+attack"
-they will prevent stuff like: set "kata" "+attack; +altattack" bind k "vstr kata" when you press k

Do you think they are okay Kurgan?

Lathain Valtiel
09-19-2005, 04:25 PM
JA "emotes" (actually called "taunts" officially) can be cancelled by hitting the jump or attack keys, and you must be standing still to activate them. They offer NO protection from any kind of attacks or force powers.

This is not true... On old duel servers I've noticed the taunts beiing done while moving. They offered no protection though.

Kurgan
09-19-2005, 06:20 PM
Lath:
I'm almost positive the taunts can't be done while moving. Actually you can hit the taunt button (for the plain generic taunt) while standing still and then start running as soon as the animation starts. This is different than in JK2 where I believe you could hit it while running and it would just play.

The only other time I can think of where you can taunt while moving is when you're inside a vehicle (since the animations don't play, you just hear the voice samples if any).

the source of the duelers JA 1.1 Mod is open source, I suppose that I am allowed to use it. Check out http://duelers.jk2files.com if you want to be sure.
Has somebody already integrated the bug fixes?

To the macro scans:
-they can be turned of by cvar
-they tell you if they block something
-they allow simple stuff like: bind a "+attack"
-they will prevent stuff like: set "kata" "+attack; +altattack" bind k "vstr kata" when you press k

Do you think they are okay Kurgan?

It's really up to Razor, since he's the head of the project. I just wanted to be sure.

Though I'm skeptical about the tolerance level of the scanner. It allows you to bind a single action to a key but not two buttons? So binding a voice command+a chat string would be illegal, as would binding a screenshot+"silent"? Just seems arbitrary to me.

Are Vstr's illegal or binding the vstr to a key? Because many Vstr's are necessary for server hosts, and have nothing at all to do with binding moves to buttons (assuming here that people complain about "Scripters" and consider such tactics "unfair").

tarafudge
09-24-2005, 01:10 AM
Why must there be protection??

I can't stand it when people go out in the middle of a FFA square and just meditate or something. Besides it doesn't really protect them, cause you can kick them to death.

razorace
09-24-2005, 05:18 AM
I think the idea was supposed to be that there ISN'T any special protections for emotes.

Red_Rain
09-24-2005, 03:14 PM
Though I'm skeptical about the tolerance level of the scanner. It allows you to bind a single action to a key but not two buttons? So binding a voice command+a chat string would be illegal, as would binding a screenshot+"silent"? Just seems arbitrary to me.

Are Vstr's illegal or binding the vstr to a key? Because many Vstr's are necessary for server hosts, and have nothing at all to do with binding moves to buttons (assuming here that people complain about "Scripters" and consider such tactics "unfair").

I checked the code. Only vstrs that contain "+attack", "+altattack", "+moveup" or "+movedown" will be blocked, when the client tries to execute them.

And for the emotes: I have change the code a little. You leave emotes if you press attack, alt attack or do dark force stuff (drain, grip, lightning) or got hit by a lightsaber. You take damage as you normaly would.
I haven't integrated a cvar, but it should be quite easy.
By the way can you tell how to check if the client has pressed jump (upward) in serverside code e.g. g_active? Since you can't leave emotes with jump for now, I wanted to fix this but don't know how.

razorace
09-25-2005, 12:59 AM
it's the moveup vector in the cmd package I think. Just check to see if it's > 0.

Anyway, I wouldn't have a problem with additional emotes as long as they are as well scripted as the gamejka taunts.

Kurgan
09-25-2005, 12:48 PM
I checked the code. Only vstrs that contain "+attack", "+altattack", "+moveup" or "+movedown" will be blocked, when the client tries to execute them.

And for the emotes: change the code a little. You leave emotes if you press attack, alt attack or do dark force stuff (drain, grip, lightning) or got hit by a lightsaber. You take damage as you normaly would.

That doesn't sound so bad.

razorace
09-25-2005, 03:45 PM
Do we really want a script blocker? I personally don't think it's cheating.

tarafudge
09-25-2005, 09:47 PM
As long as it doesn't take advantage of a glitch...

razorace
09-25-2005, 11:41 PM
Well, wouldn't it be better to fix the glitchs than block scripts?

Red_Rain
10-02-2005, 06:42 AM
it's the moveup vector in the cmd package I think. Just check to see if it's > 0.

Anyway, I wouldn't have a problem with additional emotes as long as they are as well scripted as the gamejka taunts.

I can't acces the moveup vector. In bg files this isn't a problem because I can acces the pm struct. But in g_active is only the ent struct (e.g. self->client->ps.weapon). With ent struct I can only acces buttons and not moveup.

For emotes:

I have done the cvar. You can disable/enable 3 types of emotes:
-short: mostly taunts and emotes like nod or shake that won't last long
-toggle: emotes like sit, that you enter and then only leave if you press a key or use the cmd again
-interactiv: emotes that affect other players. The only one for now is hug.

I will post the code for the script blocker (macro scans) and emotes later, since i have problems with my modem.

razorace
10-02-2005, 05:15 PM
Ok dokie.

Well, the moveup command is in the ucmd struct. Just search thru the game files to see how it's accessed from that component. I think you gotta pull it using a simple syscall.