Generic Engines
#2587 posted by Spike on 2018/07/14 15:39:49
In theory, if you set the player's movetype to movetype_none in PlayerPostThink, and back to movetype_walk in PlayerPreThink, then you can insert a call to your (renamed) SV_PlayerPhysics at the start of PlayerPreThink and get a similar result.
In practice, doing so would leave you with no way to determine the user's intents (read: the .movement extension). You can work around this by using movetype_noclip instead of the movetype_none above, and to then try to guess the intents according to how the player's velocity accelerated between postthink->prethink (hint: dotproducts, see my earlier post). You'll also need to unwind those noclip-based velocity changes which will require some kind of shadow field, and clearing the velocity field in playerpostthink will make your .movement guessing logic more reliable.
Either way, it'll screw over prediction and get confused by knockbacks.
.gravity exists in all quake engines since hipnotic. You should be able to knock up a min/max function easily enough. I don't think there's anything else in there that's a problem.
Engine Neutral
#2588 posted by Preach on 2018/07/15 21:26:41
My code runs fine in standard quake engines (once you define the .gravity field to enable that feature). You just run it in playerprethink, it uses standard player physics but then just rewrites the velocity each frame.
To slow it down, I guess you could do a number of things. One thing would be to reduce gravity further, even while facing down, so that you can't build up speed so well. Another would be to add a cap to fly_velocity after you calculate it:
if(fly_velocity > MAX_FLY_VELOCITY)
fly_velocity = MAX_FLY_VELOCITY;
Without this, the player can achieve speeds up to the global maximum speed an entity can reach, which defaults to 2000!
Quake1_test
#2589 posted by madfox on 2018/07/17 22:50:04
On Quake Wiki I read the Trivial of the HellKnight.
The intention was to let Rangers spawn when the Hellknight is hit.
The same applies to the Axe_Ogre, which I managed to give some extra postures.
In this case, the Ogre should laugh when someone dies.
A more peculiar fact was pissing on the player's body.
If I were to start coding ... where should I start?
Something like pissing on the player would mean something to the player.qc and ai.qc.
Laughing when someone dies is a more general topic.
Take A Leak
#2590 posted by Qmaster on 2018/07/18 03:23:38
PlayerDeathThink in client.qc, add a while loop that use
spot = find (world,classname,"monster_ogreaxe");
if ( spot ) {
spot.think = ai_leak1;
spot.leakentity = self;
}
Then set goalentity to the leakentity in ai_leak1 and self.enemy to self.leakentity. Do some ai_run()s inside your ai_leak1, 2, 3, etc. check for distance using vlen and start ai_leaking1 when close to player. In ai_leaking1, 2, 3 do your leak anim frames and play a sound effect maybe.
Of Course
#2591 posted by Qmaster on 2018/07/18 03:26:04
You may need to add a .float to act as a bool so that you only check for axeogres in PlayerDeathThink once, something like
if(!foundleakers) {
foundkeakers = 1;
//while loop in here
}
And then in respawn() maybe add a foundleakers = 0; call. You might need to get fancy with coop though.
I...
#2592 posted by Kinn on 2018/07/18 09:13:59
...assumed the idea was that if the ogre killed the player then just that particular ogre would piss on the player, however...
Qmaster is making me think that if the player dies then all the ogres in the map would start making their way over to the player's corpse for a great big ogre gang-corpse-piss-party, and if I'm being totally honest with myself, that idea is too compelling to just pass up.
Laughing Is A More General Topic.
#2593 posted by madfox on 2018/07/18 15:22:38
Let's assume the idea that if the ogre killed the player then all ogres would laugh.
The same a strange way when they're fighting between themselves and all start laughing when the player dies..
So these extra poses would concern the player only.
If I take PlayerDeathThink, and start adding code exact above respawn();
and under the self.button2 = 0;
the new code looks like:
self.button2 = 0;
}
spot = find (world,classname,"monster_ogreaxe");
if ( spot ) {
spot.think = ai_leak1;
spot.leakentity = self;
}
respawn();
};
client.qc:805: error: unknown value "spot".
I know I'm a geek what coding concerns,
no idea how to make a spot statement.
laughing Axe_Ogre
lapaz Axe_Ogre
Christ On A Bike.
Playing The Fiddle Onehanded
#2595 posted by mfx on 2018/07/18 16:00:59
#2596 posted by Kinn on 2018/07/18 16:25:22
Make some minor changes to the micturating ogre model to give it a more ejaculatory flavour, and boom - cool new projectile attack.
#2597 posted by Qmaster on 2018/07/18 18:48:28
local .entity spot;
That Was A Bit Disturbing Actually
#2598 posted by Qmaster on 2018/07/18 18:48:56
#2599 posted by Kinn on 2018/07/18 20:38:41
The way the ogre's balls rhythmically scrunch up on each cycle suggests we're getting something a little bit extra, not just urine.
Make It Happen Madfox
#2600 posted by mfx on 2018/07/18 20:54:33
I Regret Having Been A Part Of This.
#2601 posted by Qmaster on 2018/07/19 01:35:04
Don't forget to do a particle(self.leakentity.origin,'0 0 0',60,18); for added effect
I Screwed Myself Almost Geek On Those Fucking Flies!
#2602 posted by madfox on 2018/07/19 03:22:13
I could have suspect these intimate subroutines would lead to hillaric reactions, but..,
my bike had a leak last christ, and I wonder who'll pay the fiddler off.
I suggest kinn giving it a good smile sound.
Thanks Qmaster, I didn't warn you before I asked your help with my q1test. But you're welcome. I tried your email, but it didn't work.
Right, so I'll start with
local .entity spot;
The extra effects, it's like knowing the name of the statement, but not where to paist it in.
I Changed
#2603 posted by madfox on 2018/07/19 04:12:56
in PlayerDeathThink after the buttons:
self.button2 = 0;
respawn();
//===new code===
local float entity spot;
local .entity spot;
spot = find (world,classname,"monster_ogreaxe");
if ( spot ) {find (world,classname,"monster_ogreaxe");
spot.think = ai_leak1;
spot.leakentity = self;
}
};
//===end code===
error: no spot value.
then I added to defs qc line 139 :
.float skin;
.float effects;
//===new code==
.float spot;
//===end code==
Client.qc:812: error: type mismatch = (FIELDTYPE and entity)
#2604 posted by Spike on 2018/07/19 04:59:41
local entity spot;
no extra dot
(you want an entity, and not a field reference[of sub-type entity])
#2605 posted by Kinn on 2018/07/19 12:40:59
my bike had a leak last christ, and I wonder who'll pay the fiddler off.
I suggest kinn giving it a good smile sound.
I...just...I...but...nothing.
Stumbling Is A Kind Of Laugh
#2606 posted by madfox on 2018/07/20 14:59:55
Appoligize my passionated reaktion, as I'm stupid enough to write down my nonsense before my smart conclusion starts reasoning.:P
Thanks Spike. Now I'm back at start with:
//=========new code===========
local float entity spot;
local entity spot;
spot = find (world,classname,"monster_xogre");
if ( spot ) {find (world,classname,"monster_xogre");
spot.think = ai_leak1;
spot.leakentity = self;
}
};
//====================end code==
client.qc:808: error: local not a type
client.qc:808: error: spot not a type
client.qc:808: error: if not a type
client.qc:808: error: self not a type
#2607 posted by Spike on 2018/07/20 16:13:14
local entity spot;
just that.
not 'local float entity spot;' - that's meaningless conflicting keywords.
#2608 posted by madfox on 2018/07/20 18:54:30
yes, but as soon as I add a line in client.qc before ClientObituary I receive the error "local" and "spot not a type".
How do I make them to a right statement?
Ah
#2609 posted by madfox on 2018/07/20 19:20:50
I changed some parms
void() ai_leak =
{
local entity spot;
spot = find (world,classname,"monster_xogre");
if ( spot ) {find (world,classname,"monster_xogre");
{
spot.think = xogre_leak1;
// spot.leakentity = self;
return;
}
}
};
if I exclude spot.leakentity it compiles well,
warning that "Local "spot" not defined with a name of a global"
Wow, I've got an ai_leak!
What should be the next step?
#2610 posted by anonymous user on 2018/07/20 21:48:54
if ( spot ) {find (world,classname,"monster_xogre");
{
local entity pissee;
spot.think = xogre_leak1;
if ( pissee ) {find (world,classname,"monster_donaldjtrump")
spot.enemy = pissee;
QuakeC Locals And Globals
#2611 posted by Qmaster on 2018/07/20 22:19:08
local makes that variable only work within the function--inside {} and ONLY after it has been declared (pretty sure about this second part).
Globals are any variable defined outside, e.g. in defs.qc (at the bottom of defs.qc anyways)
You need to define a .entity leakentity; somewhere outside a function and before you use it in client.qc.
E.g.
.entity leakentity; // entity to remember for later so the monster knows where to go take a leak
void ClientObituary() {
local entity spot; // entity to hold our axe ogre
//your find down here
...
};
I'll let you figure out how to make the monster hunt down the player location and then begin the actual taking a leak.
|