Dusty Posted August 22, 2014 Posted August 22, 2014 Talking about JA mostly even though I wouldn't be surprised if this were the case in JK2 as well... Why doesn't the alt-fire stat in .npc files work? All the proper code seems to be in place... Asgarath83 likes this
Asgarath83 Posted August 22, 2014 Posted August 22, 2014 Works only for saberist. it's really strange. for that motivation i asked to @@eezstreet to improve the sniper code AI also for other classes. :\
eezstreet Posted August 22, 2014 Posted August 22, 2014 That field isn't even used to my knowledge, so..
dark soul Posted August 22, 2014 Posted August 22, 2014 Talking about JA mostly even though I wouldn't be surprised if this were the case in JK2 as well... Why doesn't the alt-fire stat in .npc files work? All the proper code seems to be in place... In JK2 there was a npc in cairn_bay i think, which uses alt-fire. Stcommander, two of them are place on the top of the elevators and using alt fire mode. Dunno if they are scripted or using npc files. Asgarath83 likes this I am hosting Jedi Outcast and Jedi Academy servers for free up to 8 servers. Contact me if you are in need of a server for your community.
IrocJeff Posted August 22, 2014 Posted August 22, 2014 It's scripted in Behaved. Most of my Stormtroopers use alt fire throughout my project. set ( /*@SET_TYPES*/ "SET_ALT_FIRE", /*@BOOL_TYPES*/ "true" ); eezstreet, therfiles and Asgarath83 like this
Barricade24 Posted August 22, 2014 Posted August 22, 2014 I believe in Outcast, there was a specific NPC called stofficeralt that shot with the alt effect.
Dusty Posted August 23, 2014 Author Posted August 23, 2014 ^In JA (and JK2 I bet) alt-fire can't be given to NPCs in their files but must be scripted to them through the map. I don't understand why it doesn't work though. In NPC_stats.cpp the stat correctly refers back to a hardcoded define called SCF_ALT_FIRE or something.
Dusty Posted August 23, 2014 Author Posted August 23, 2014 After staring at the code for a while, I'm not able to understand it, but my hunch is that the if statement starting at line 3532 in NPC_stats.cpp doesn't apply the SCF_ALT_FIRE script flag correctly to the NPCs.
Dusty Posted August 24, 2014 Author Posted August 24, 2014 So SET_ALT_FIRE, which comes from icarus scripts, activates the SCF_ALT_FIRE script flags, and so does altFire in an NPC file, or at least it's supposed to. Perhaps therein lies the problem. My expertise ends right there though. I'm unskilled enough to analyze the code further.
eezstreet Posted August 24, 2014 Posted August 24, 2014 Almost all of the NPCs are hardcoded to act a certain way with the weapons. CLASS_IMPERIAL with the right rank will always use alt fire, regardless of the altFire flag. Snipers always use alt fire except with the player being really really close (and even then, their firing routine is really broken). Like I said, it's quite hardcoded and I'm pretty sure it doesn't work as intended.
Dusty Posted August 25, 2014 Author Posted August 25, 2014 ^Icarus doesn't have any issues with hardcode conflicts though... Reason I'm making this topic, is that for JA, I would like to have this feature work. Not a huge deal, but it would save me some ent-modding trouble
Asgarath83 Posted August 25, 2014 Posted August 25, 2014 ^Icarus doesn't have any issues with hardcode conflicts though... Reason I'm making this topic, is that for JA, I would like to have this feature work. Not a huge deal, but it would save me some ent-modding trouble without code hacking, you need just to add the spawnscript to the NPC and set in the spawnscript SET_ALT_FIRE, true.also, you can check code part about the set_alt_fire of icarus for see how is working the declaration and the "altfire" parametrer of NPC files for see what's is of wrong.altfire NPC however work well for saberist. if you use on saberist with saberthrow, they ever fight throwing the saber. if the saber is not throwable, they execute the Special kata and take kicks, if they rank is upper of lt.but , yes, not work on shooters class, i not know why. :S
Dusty Posted September 6, 2014 Author Posted September 6, 2014 So, any chance of getting this working or naah? I can't figure it out, mainly seeing as I don't understand the operators used to set spawn flags in the code so I have no idea how it even works honestly.
Asgarath83 Posted September 6, 2014 Posted September 6, 2014 i not know too, but in icarus, if you use aspawnscript with SET_ALTFIRE, true. the enemy shoot with alt fire if you are far and with normnal fire if you are close. O.osearch in the code the SET_ALTFIRE icarus definition and see how is programmed.
Asgarath83 Posted September 6, 2014 Posted September 6, 2014 In JK2 there was a npc in cairn_bay i think, which uses alt-fire. Stcommander, two of them are place on the top of the elevators and using alt fire mode. Dunno if they are scripted or using npc files.Yes, i remember the two foes. are scripted by icarus with set_altfire. in the mod escape from yavin 4 the lost map there is a level in a lava caves full of tusken raiders, velociraptors and imperials and reborn into a facility. the reborn soldier use every kind of altfire shoots. O.o
Dusty Posted November 8, 2014 Author Posted November 8, 2014 Okay, sooo, I really want this to work, but I cannot for the life of me figure it out. Yeah yeah the icarus system is great and all for specific npcs in maps, but if I want one kind of NPC to always use alt-fire then it would be nice to be able to just set it in one spot in their .npc file instead of ent-modding it into every map :/
Asgarath83 Posted November 9, 2014 Posted November 9, 2014 I think that the best way for make this is to create a new fighter AI class that use only altfire atk. o.omaybe you can use AI_imperial.cpp how base for work following the lines of altfire shoots ratio at high rank.
Dusty Posted November 9, 2014 Author Posted November 9, 2014 ^That's a good idea. While I would like this sort of thing externalized outside the code, as a temporary (assuming one day this may be fixable) fix I could just use specific classes. Like the Rodian gunner for example, I want him to use alt-fire, so maybe NPCs with class_rodian and an E11 will be coded to use alt-fire. EDIT:Maybe what happens in the code is something overrides the alt-fire script flag canceling it out. Icarus scripting and the alt-fire npc field seem to work in the same way, so the only difference that I imagine could happen is the "when" of when the game applies each to an NPC. Maybe there is some AI code that says "if this, use primary fire", and that's why I can't find anything, because it's not alt-fire that's being applied incorrectly but rather primary fire, so I should really be looking for wherever "primary fire" is coded in. Just a theory.
Asgarath83 Posted November 9, 2014 Posted November 9, 2014 mmmm, have you found in the code the code part of SET_ALT_FIRE boolean of Icarus functions? should exist. some time ago, Kenoi has fouind the line codes of the facial animation that interact with icarus. so should exist code line command of every icarus script function. incluse the set_alt_fire command. can you watch how that work, what the icarus "SET_ALT_FIRE, true" activate into the code.search in the entire solution SET_ALT_FIRE
Dusty Posted November 10, 2014 Author Posted November 10, 2014 So I tried to find where class_imperial gets it's alt-fire thing, but no direct references. Another indirect code thing? Ugh. @@eezstreet: I call on your superior programming knowledge.
eezstreet Posted November 10, 2014 Posted November 10, 2014 It's bound by rank. RANK_COMMANDER (or whatever) and above always use alt fire.
Asgarath83 Posted November 10, 2014 Posted November 10, 2014 in my modding work i noticed that the saberist with ltcomm , commander or captain rank using also the altfire attack: they make the kata atk many time twist and swing the saber with A1 \ A2 \ A3_SPECIAL attack.also, if NPC have FP_SABERTHROW 1-2-3 level they throw the saber For the shooting weapons, instead, that works only for CLASS_IMPERIAL, i think. you need to check the rank code, as told @@eezstreet, and maybe you can find some reference about the altfires.
Dusty Posted November 11, 2014 Author Posted November 11, 2014 @@eezstreet: Are you saying commander ranks pretty much regardless of class will use alt-fire? Gonna test that I guess...
Dusty Posted November 13, 2014 Author Posted November 13, 2014 It's crud like this that confuses me: if ( ent->NPC->rank >= RANK_COMMANDER ) {//commanders use alt-fire //ent->NPC->scriptFlags |= SCF_ALT_FIRE; } That's in NPC_spawn.cpp, and the only reference I can find related to commander ranks using alt-fire, but it's commented out, so I'm kind of baffled as to what makes Class_imperial NPCs at commander rank use alt-fire at all...
Dusty Posted November 14, 2014 Author Posted November 14, 2014 Silly me. Never assume because it makes an *** out of you and me. In JA imp commanders don't use alt-fire by default, precisely because that part of the code is commented out for JA. Still doesn't explain why alt-fire in .npc files doesn't work... but that's for another day.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now