#2775 posted by Inky on 2020/03/01 12:53:05
Dear Preach,
At reading your last paragraph, demos don't seem to be easy stuff and my guess is that anyway I would probably not be able to trigger one mid-game and go back to the action afterwards, like with camera stuff exemplified in the map by Darin Mcneil mentioned above. So learning how to make demos would probably be putting things too far away from actual mapping which I still keep on learning and which already takes me days and days (and days...)
Yet I feel extremely honored by your personalized attention. My project will anyway owe a lot to your map hacks and advice, for sure! Thank you so much for that and for all what you bring to the community, that's so precious for newbies like me! Sorry I didn't notice your kind message sooner (is there a way to be automatically notified when someone posts after you on a thread?)
Demo
#2776 posted by Preach on 2020/03/02 00:05:09
I was thinking of pre- or post-level demo cutscenes when I mentioned it (zerstörer is another good example of doing that). In principle though, you could try the following to get a mid-game cutscene from a demo:
1) Save the game to a fixed filename like 'save interdemo.sav' using stuffcmd
2) Follow that with a command to load the demo 'playdemo cutsc001.dem'
3) insert a stuffcmd into the last frame of the demo which runs 'load interdemo.sav' to resume.
Wouldn't work in co-op, and it wouldn't be seamless because the engine would reload the map, but it's an interesting approach. Certainly would shift the burden from perfectly scripting the cutscene in QC to editing a demo. I suspect you can get good results with less effort through the latter...
#2777 posted by Inky on 2020/03/02 10:54:30
Wow, that's tricky! :-)
The cutscenes I have in mind are mainly dialogs with non playing characters (that is non agressive monsters who give pieces of information to the hero thanks to a dialog, show him a passage, etc.) Could a demo do that? That would save a lot of scripting for sure.
Custents
#2778 posted by Preach on 2020/03/03 00:51:59
I'd say that's probably simple enough that you could avoid the demo route. Have you looked at the in-map cutscenes you can do with the custents mod? They might be enough for your purposes. If you had 5-6 entities interacting in a scene, each with two or three things to do, and a need for some kind of camera movement, a demo is going to be more manageable. But there's overhead to setting up demos as well, and that's not worth incurring if the action is short and simple.
What Makes A Monster Go Infight?
#2779 posted by madfox on 2020/03/14 02:43:57
I'm converting some models and have come to strange point one of them resists to go infight.
It keeps on tracing the player untill it is killed.
Strange enough a hit by another monster just makes it to one counter attack, but then it continues the player.
If another monster gets hurt, it starts infight untill the lame one gets killed.
All the others kill eachother infight, so I can't find a trace to where this infight command is to be found.
Madfox
#2780 posted by metlslime on 2020/03/14 06:25:01
in T_Damage, look for self.enemy = attacker;
If your enemies only do one counter attack and then return to attacking the player, something in your code must be setting self.enemy back to the player.
#2781 posted by madfox on 2020/03/14 09:43:55
I can't find self.enemy = attacker; anywhere.
The macro of a grunt is identical to the enforcer.
What happens is that the enforcer will have infight with the grunt.
Grunt with the same qc code won't infight, and leaves after one attack.
Only thing I can make of is that two enforcers won't attack eachother.
Ie
#2782 posted by madfox on 2020/03/14 09:44:57
the qc of a grunt is the enforcer.qc.
#2783 posted by metlslime on 2020/03/15 06:54:12
I can't find self.enemy = attacker; anywhere.
That would explain why there's no infighting then. Monsters attack their current enemy. So if the enemy is never changed to be their most recent attacker, they won't attack back.
Note that in T_Damage, in standard quake, there is an exception for "soldiers" (e.g. grunts) to allow them to fight each other. Every other class will not fight monsters of the same class.
Grm...
#2784 posted by madfox on 2020/03/15 23:28:08
That explains a bit of the cause.
I have this T_Damage (self.enemy, self, self, ldmg);
The perticular monster is called monster_grunt, while quake uses monster_army.
Could it miss the statement soldier, not seeing a monster_ grunt for a monster_army?
#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.
|