#2785 posted by misc_ftl on 2020/03/16 18:41:35
#2779 Found It.
#2786 posted by madfox on 2020/03/17 02:47:56
I gave it a Grunt_Check_Attack in Fight.qc.
For most other monsters it is an oppertunity to devide their attacks on long and short range. In this case it won't work for Grunt.
Deleting the files in fight.qc makes it infight again.
Not really clear to me why but it works.
Sniper Code
#2787 posted by Inky on 2020/03/29 19:22:45
Hello all :-)
I am desperately trying to find what piece of code decides whether a monster is too far away to see the player or not.
Indeed I'd like to implement a flag to enhance some lesser baddies and make them excellent snipers never mind the distance.
Any idea please?
Thanks a lot in advance! :-)
Fight.qc
#2788 posted by madfox on 2020/03/29 20:15:24
Attitudes of monsters go to the fight.qc where they are specified to attack on range, distance or default.
So I think your monster should have an anouncement in the fight.qc.
The SoldierCheckAttack has the code to make the knight decide to make a RANGE_FAR, RANGE_MID or RANGE_NEAR attack.
Would I Get Away With This?
#2789 posted by madfox on 2020/04/01 06:35:30
combat.qc line 189:
// get mad unless of the same class (except for soldiers)
if (self != attacker && attacker != self.enemy)
{
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_army" ) )
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_grunt" ) ) //
{
if (self.enemy.classname == "player")
self.oldenemy = self.enemy;
self.enemy = attacker;
FoundTarget ();
}
For Clearance
#2790 posted by madfox on 2020/04/01 06:43:41
As I compile the progs I don't see any difference in the behaviour of the grunt, so maybe I overviewed a statement. It keeps acting for black sheep and ignores infight.
Monster_grunt
#2791 posted by Preach on 2020/04/01 23:24:02
Hi madfox,
That's the correct piece of code to change, did you keep it all exactly the same apart from changing monster_army to monster_grunt?
If so, you might need to add some dprint lines in there to try and work out whether the code is running or not when the grunts shoot each other, what classname they have when they enter this section of code, etc...
Never Try To Beat A Twin
#2792 posted by madfox on 2020/04/02 07:08:08
Thanks for your attention, Preach. Before I turn into one.
I wondered if I could place the statement under the other one, expecting it would work. I guess not, as army will fight a grunt, but grunt won't fight army, nor eachother.
I can hardly believe this error is so consistent. All other monsters I converted have no porblem with infight. For this one I even made all frames and macro the same, but it still excists.
In this file is a try out, don't mind the strange stand / walk scene. It is a rare coinscidence with the same frame group, but altered runout.
jackpotgrunt
Dprint
#2793 posted by madfox on 2020/04/04 02:34:35
How do I place these dprint lines?
Is there a console argument or do I set these statements in the qc?
In Qc
#2794 posted by wakey on 2020/04/04 08:53:53
it's void dprint (string text).
Plus you need to set the cvar developer to 1.
Uh..,
#2795 posted by madfox on 2020/04/04 09:11:12
ai.qc defs or elsewhere?
To Be Honest
#2796 posted by wakey on 2020/04/04 10:30:55
i am guessing myself, looked it up once for someone who was new to qc.
In ai.qc there should be an commented out example in t_movetarget, line 147.
It reads dprint //("t_movetarget\n");.
Hope that helps somewhat.
Right
#2797 posted by madfox on 2020/04/04 10:33:49
Thanks for the hint!
Seeing Double
#2798 posted by Preach on 2020/04/05 23:42:54
Had a look at your zip madfox. The way you formatted your original post, I thought you had deleted the old code and put your new code. But in fact you've left both bits of code in, so it's doing both checks, one after the other. If I add some brackets to make it clearer what's happening:
if (self != attacker && attacker != self.enemy)
{
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_army" ) )
{
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_grunt" ) ) // I hope it madfoxed
{
if (self.enemy.classname == "player")
self.oldenemy = self.enemy;
self.enemy = attacker;
FoundTarget ();
}
}
}
The outside check only allows monster_army to fight with monster_army, and the inner check only allows monster_grunt to fight with monster_grunt. No monster can be both things at once, so it always fails.
Either go back to the original code and replace monster_army with monster_grunt, or create a proper three way check:
if ( (self.classname != attacker.classname)
|| (self.classname == "monster_army" )
|| (self.classname == "monster_grunt" ) )
Black Sheep
#2799 posted by madfox on 2020/04/06 06:26:35
I changed the code for the two monsters, but I fear there is something else going on. The Quake soldier is used as monster_army but there is also a soldier.qc and a grunt.qc.
For sake of a double classname grunt somewhere I changed the montgrunt to mong. Although all parms are thay direction there is a behaviour of a army monster with infight and a mong soldier that gives one counter attack.
I deketed the army in combat for just a mong fighter but it will hardly reackt. Could it be that its painframes are too long, as every time it is attack it looks as if ther is a freeze moment before it just start goosing the player.
[Hexen II] AC Calculation
#2800 posted by Inky on 2020/04/10 09:25:02
Hello,
Not sure this is the right place for such a question, I beg you pardon in advance if not.
I am currently mapping for Hexen II and my question is extremely specific to that game. H2 has different kinds of "armor" items the player can grab, each absorbing a specific percentage of damage (actually depending on the player class, the hc code is pretty clear about how it works).
What I don't understand is the "AC" counter displayed in the HUD. This counter is incremented by a certain number of points when an armor item is picked up, but that number doesn't seem to be related to the actual percentage of damage the item can take. It is very puzzling and I have not been able this far to figure out how the HUD counter works.
Is there any chance one of you might have an idea about that???
Thank you so much in advance! :-)
[Hexen II] AC Calculation: Answer
#2801 posted by Inky on 2020/04/10 18:26:21
Just in case anyone would care, I got my answer here:
https://heretic.fandom.com/wiki/Thread:4326
Trenchbroom Commandline
#2802 posted by Inky on 2020/04/18 19:52:13
Hello,
Like some of you start to know, I map for Hexen II whose entities are sometimes tricky and not as well documented and known as Quake's ones.
That's why I learn a lot from Raven's original maps. The recurring type of question I have been asked to myself is "What is this spawnflag value for? How do they use it in vanilla H2?"
And basically I was launching a textual search on the entire set of .map files by Raven for all the occurrences of the given classname and inspected them one by one until I found one whose spawnflags value contained the desired power of 2 (which is not an easy calculation to work out in one's head). Sounds stupid and monstrously time consuming? It was!
I'm pretty sure you will laugh at me and explain that a far easier solution was available already but well, today I developed my own advanced multi-criteria search tool. It supports regexes and can filter entities by classname, property name and property value (which is searched among powers of 2 if needed). Each matching entity is returned with also its targetname and x y z position within the map.
The cherry on top of the cake would now be that by clicking on a result, Trenchbroom opens the map and moves the camera directly on the entity. Do you know of any command line parameter in Trenchbroom allowing such a thing?
(Sorry my posts are always more verbose than strictly necessary)
Thank you very much in advance!
#2803 posted by Inky on 2020/04/18 21:51:17
A cherry on top of the cherry on top of the cake would even be a command line parameter to open a map with TB and automatically load a pts file in the same action: usual shortcuts to follow the "pts line" would allow to go from one search result to the next instead...
Hmmm
#2804 posted by ijed on 2020/04/18 22:56:29
Worldcraft had a very nice feature called... entity report, I think.
Essentially it listed all entities and allowed you to filter the list by value. It also had basic error checking.
Ideally this would be a per-game thing, allowing the users to edit a .txt file or something to make new error checking parameters.
It's tempting to go into TB dev and help...
Ressurect/respawn Player In Singleplayer
#2805 posted by 3t0 on 2020/04/20 13:08:11
Hello again, I guess, this is proper forum to ask (I hope).
In doom forks there is often /budha mode (never have player health go below 1) and /resurrect command (that revives dead player in the spot they died).
During my years of dooming I started using those when quickly analyzing mod maps or doing my own tampering.
For me, they are much better suited for testing than /god.
I am curious about these things:
1. both of these (budha, resurrect) should be attainable with custom modded progs.dat, I believe. Am I right? Is there anything specific in C parts of engines to prevent that (given COOP this should work even with monsters)?
2. can I somehow resurrect with vanilla SP progs.dat? Using `/give h 100` will make my dead player "stand-up", but they cannot move and jump will immediately end level. Am I missing something or this is un-doable in vanilla?
I'm fairly sure that's un-doable in vanilla.
you can absolutely mod progs.dat to do this though
here is a quick and dirty proof of concept, no options just respawn in situ with 100 life
https://www.dropbox.com/s/b8sztids7x3xcyi/resurrect.zip?dl=0
#2808 posted by metlslime on 2020/04/20 16:52:46
Rubicon 2 has a resurrection cheat — impulse 666. You could look at that code.
Really Helpful
#2809 posted by 3t0 on 2020/04/20 23:54:42
Thank you guys this is awesome!
|