Jump to content

NPCs not using Alt-Fire


Recommended Posts

I hope someone has the answer to this:

 

 So, the thing is, I want to create a npc that can use alt-fire. And I'm not talking about some compiled boolean script to use in GTK Radiant, I'm talking about opening the console in-game and write "npc spawn [NPC NAME]" and then have said npc use alt-fire.

 

 I've already tried but i couldn't obtain any results so far. :(

 

 I already tried to add "altFire 1" to the .npc file (That worked in JK2 but in JKA it doesn't work anymore).

 

 So if anyone knows how to do this please say something I'd be appreciated.

Link to comment

I've already tried many combinations of ranks and classes. It doesn't do anything...

 

the only class that uses altfire is BOBAFETT but then the npc would become invincible, have a jetpack, change weapons at will etc.

Link to comment

Doesn't matter, doesn't work with any weapon except the Disruptor and that's meant for snipers, which are already in-game (rodians, saboteurs...)I'm currently trying to make a npc with the Blaster Rifle (to shoot in bursts) and another  with the repeater (to shoot concussion charges)

Link to comment

yeah but I'm trying to make it work in-game when i use a npc spawn command. I understand that I could probably be able to achieve this by coding but i don't have the slightest idea as to what do if I resort to this method :\

Link to comment

Scripts? But those are for a specific targeted NPC in a specific map, right? or does it enable npc alt-fire permanently?

 

There is some other external way of scripting the engine that can be executed by autoconfig file on startup of game. I think that maybe @eezstreeet  was mine that way.  but sure he can tells you more.  i am okay with icarus, and i know a lot of coding, but i am not much familiar with external script system of JKA. :( also, i never see on the coding how exactly works the altfire and why the NPC command of this not works, and the icarus command instead yes.

Link to comment

Welp, if that's the only way...Still, asking for one modder to make me a tutorial on how to code this seems like too much to ask. Although you mentioned an autoconfig file? That definately sounds like an easier route, but I'm still clueless as to what do I have to do though.

Link to comment

Welp, if that's the only way...Still, asking for one modder to make me a tutorial on how to code this seems like too much to ask. Although you mentioned an autoconfig file? That definately sounds like an easier route, but I'm still clueless as to what do I have to do though.

 

Pity in this period i am very busy with a bad work of MD3 buildings prefab for my mod. >.< when i end, i can check the SP code for see where is the lack of Altfire on NPC files. this bug interesse me too. i will see if there is some way to fix it, maybe using the code part of icarus SET_ALT_FIRE, True.

Vade Parvis likes this
Link to comment

Pity in this period i am very busy with a bad work of MD3 buildings prefab for my mod. >.< when i end, i can check the SP code for see where is the lack of Altfire on NPC files. this bug interesse me too. i will see if there is some way to fix it, maybe using the code part of icarus SET_ALT_FIRE, True.

Thanks, if you ever get on it say something :)

 

 

If I recall, certain NPC's will follow scripts for things like alt fire if you give them certain names.

 

Here is the link to the tutorial.

Hm, I already saw that. Some of those descriptions are wrong though, and there's no reference of the npc use of alt-fire freely; But thanks anyways.

Asgarath83 likes this
Link to comment

no problem.

mmm i partially discover the thing.

 

 

static void Q3_SetAltFire( int entID, qboolean add)
{
    gentity_t    *ent  = &g_entities[entID];

    if ( !ent )
    {
        Q3_DebugPrint( WL_WARNING, "Q3_SetAltFire: invalid entID %d\n", entID);
        return;
    }

    if ( !ent->NPC )
    {
        Q3_DebugPrint( WL_ERROR, "Q3_SetAltFire: '%s' is not an NPC!\n", ent->targetname );
        return;
    }

    if(add)
    {
        ent->NPC->scriptFlags |= SCF_ALT_FIRE;
    }
    else
    {
        ent->NPC->scriptFlags &= ~SCF_ALT_FIRE;
    }

    ChangeWeapon( ent,     ent->client->ps.weapon );

}

icarus SET_ALT_FIRE boolean add or remove the SCF_ALT_FIRE flag to an NPC. that is the working function that need to be called for making the altfire working. now i need to check the NPC altfire command and see what call it. maybe are two different function... in that case, the npc code is bugged. if is the same function, there is sure some reason because NPC code ignore it. 

Vade Parvis likes this
Link to comment

checked all Npc_stats.cpp files, where are allocated and setted the command of NPC files.

...

there is NOT any setting for altfire 1 or 0. That's mean that this function on game is not programmed. so... altfire command into NPC file is an empty function. for engine, that not means nothing. o_o

i think for fix the problem is necessary to manually wrote on NPC_stats a function realted to altfire command.

i wanna try to do that when i end my stuff. >.< this require again some weeks. sorry for waiting.

Link to comment

That's kinda weird. You'd think that there would be some kind of remains from the JO code about npc alt fire.

 

I appreciate that you're taking a look into this, and no need to apologize for waiting, I'd really just like to get this made ;)

 

When i have more spare time, i see if there is some way to fix this issue of NPC files :)

thanks for waiting. if there is some remains of JO code... i not see that. but should not be too many complex to fix or bypass.

is just a missing thing, not a bug. the code of altfire works fine on the shooting weapons, however. it's just a glitch of Npc AI. .

i see that on JKA NPC are less smart then on JO. :\

Username likes this
Link to comment

When i have more spare time, i see if there is some way to fix this issue of NPC files :)

thanks for waiting. if there is some remains of JO code... i not see that. but should not be too many complex to fix or bypass.

is just a missing thing, not a bug. the code of altfire works fine on the shooting weapons, however. it's just a glitch of Npc AI. .

i see that on JKA NPC are less smart then on JO. :\

Hmm i dont know antything about coding but maybe it is something with npc classes. Boba Fett for example use alt fire - rocket troopers i believe use many times alt fire as well.

 

Jedi Outcast was much harder game and made many variations with enemies.. In JK3 all stormies , aliens thugs feels the same. Harder enemies = more health.. which is stupid as hell. Human mercenaries are stupidiest enemies to fight with weapons.. Srsly??? 4 shots with blaster and TWO shots with bowcaster in the head to kill? This is stupid  (many times i made i challange for myself - no lighstaber whole game only guns. Jk3 was easy.. even on jedi master. But JO ... was impossible.. IM..F@*!ng possible. Specially nar shadda... These rodians snipers ... This level is one of my favourites but it is one of the hardest levels with weapons ONLY).

Vade Parvis and Asgarath83 like this
Link to comment

LOL the rodian snipers of nar shaddaa... really this level make me crazy too. but more of rodian i got troubles with a little "lot" of avalanche of thermal detonator XDDD ... really programmer of JO was mad! XD nar shaddaa is a very difficult level for a neo jedi with low powers.


And however...

 

"never trust of a chiss bartender with a bad grammar!" ROTFL!

Fuse294 and Langerd like this
Link to comment

Well, JO's maps had some very tactical waypoints and enemy scripting, but it can't be all atributed to that...Someone who can create good Artificial Intelligence could probably make npcs that could manage fairly and freely on their own and in that aspect JKA's npcs felt 'dumbed down' a level from the JO ones. 

 

While being on-topic, I still remember getting mowed down in the opening of artus_detention by the alt-firing stormtroopers to the point of frustration  smiley-laughing002.gif , the variation in firing modes added to the difficulty.

Link to comment

Well, JO's maps had some very tactical waypoints and enemy scripting, but it can't be all atributed to that...Someone who can create good Artificial Intelligence could probably make npcs that could manage fairly and freely on their own and in that aspect JKA's npcs felt 'dumbed down' a level from the JO ones. 

 

While being on-topic, I still remember getting mowed down in the opening of artus_detention by the alt-firing stormtroopers to the point of frustration  <script pagespeed_no_defer="">//=d.offsetWidth&&0>=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+("pageYOffset"in window? window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+("pageXOffset"in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+","+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a<=b.e.height&&c<=b.e.width)}a&&(b.a.push(e),b.d[e]=!0)};p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)}); h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)}); var r=function(b){b.b={};for(var d=["IMG","INPUT"],a=[],c=0;c=a.length+e.length&&(a+=e)}b.g&&(e="&rd="+encodeURIComponent(JSON.stringify(s())),131072>=a.length+e.length&&(a+=e),d=!0);t=a;if(d){c=b.f;b=b.h;var f; if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(k){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(u){}}f&&(f.open("POST",c+(-1==c.indexOf("?")?"?":"&")+"url="+encodeURIComponent(b)),f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(a))}}},s=function(){var b={},d=document.getElementsByTagName("IMG");if(0==d.length)return{};var a=d[0];if(!("naturalWidth"in a&&"naturalHeight"in a))return{};for(var c= 0;a=d[c];++c){var e=a.getAttribute("pagespeed_url_hash");e&&(!(e in b)&&0=b[e].k&&a.height>=b[e].j)&&(b[e]={rw:a.width,rh:a.height,ow:a.naturalWidth,oh:a.naturalHeight})}return b},t="";h("pagespeed.CriticalImages.getBeaconData",function(){return t});h("pagespeed.CriticalImages.Run",function(b,d,a,c,e,f){var k=new p(b,d,a,e,f);n=k;c&&m(function(){window.setTimeout(function(){r(k)},0)})});})(); pagespeed.CriticalImages.Run('/mod_pagespeed_beacon','https://jkhub.org/index.php?s=b46244546efc345d7b38f630b0c68767&app=forums&module=ajax§ion=topics&do=quote&t=7238&p=104598&md5check=d87983f0d9f6ad54436287f405ba0e28&isRte=1,XJjZaj8buz,true,false,zHHKdR4EzLE'); //]]></script>smiley-laughing002.gif , the variation in firing modes added to the difficulty.&&0

 

 

Into the time, you can try the mod for JKA escape from yavin 4 the lost maps. this mod have a large amount of sabers, NPCs and there is a òlevel at the start of the mod when you get a lava level full of tusken raider alt firing troopers. also if JA EY4 is without coding stuff, is however one of the best SP mod i ever played. the levels are huge, complex and very hards!

have funny ^^

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...