I had changed my defs.qc into .void(entity attacker, float damage) th.pain!
It needs to be that way, so it's the other way around.
I think fte looks for more loose ends than I thought, while it still passes the progs.dat.
Strange that doors.qc with its self_pain error.
if you just want to silence the warning, you can do:
self.th_pain = (void(entity,float)) foo_notquitepain;
Such casts are generally not recommended as they'll not catch any future changes to your 'foo_notquitepain' function, and you should only ever ADD arguments to the rhs when casting functions (removing/changing args results in the function getting gibberish for the args that were not passed, or passed as the wrong type).
Such explicit casts should always be seen as a claim by the programmer that they know that the result will be safe despite its inconsistencies.
The vanilla qcc just saw function types, and didn't bother to validate the return types nor parameters. whereas fteqcc is somewhat annoying and warns about any inconsistent code that it sees.
Its worth noting that the vanilla qc code is inconsistent but not otherwise buggy. You could fix it purely using casts if you wanted to, but its cleaner to just add the extra args.
And yes, there is some door or trigger or something entity that mixes up touch functions and pain. You can fix that occurrence with a wrapper, but a cast will perform better - not that its significant enough to matter at all.
Thanks for the info, that keeps me going!
New Monster Qc
I'm trying to make a new monster, that shots nails and launches rockets. When I run the qc the monster shoot nails and launches rockets at a low angle, half from bottom.
Also the two actions bump at the same time and I have no idea where to look
Where is the statement that give more time between the actions?
As long as the player is running the relation between missiles and nails is almost even, but when it is tricked into a corner the thing blasts missiles every 0.5 second.
That's no way of surviving, I know it is called Terminator, but unlimited charge is no fight.
...half from bottom... try changing the offset amount from '0 0 10' in TermMissile to higher amount such as missile.origin = self.origin + '0 0 24'; or try copying the value you used for org in LaunchZhaser if you want the missiles to fore from the same place as zhasers do.
missiles every 0.5 seconds you have melee set to fire missiles. If you stay back away then he will only shoot zhasers.
Maybe if you want more delay add more frames or add an attack_finished check.
self.th_missile = sknt_atk1;
self.th_melee = sknt_atka1;
To switch it.
The Enforcer.qc has a code for setting the laser
org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';
and as far as I can see the v_foreward sets the space that messures the armlength foreward, and v_right is the distance from the entity to the right sideways.
I'm looking for the space upward, as a terminator that launches from under the belt is a bit odd. In game it is not so pronounced as with testing.
I will try your statements in the hope they lead to a better result. For sofar here is the map as far as I have finished it. The scr file is included. I've played the map myself only, and I think the gamepath isn't realy clear.
Hi madfox, have you tried using v_up? That's the "upward" vector I think you're after.
@-Qmaster Changing the self.th_melee = atka1; worked for splitting the attack in two different shapes. Although I don't see the reason why self.th_melee = sknt_melee won't work.
It is defined as sknt_melee = sknt_atka1; (?!)
@-Preach : sure, but I can't find the place
for the statement.
Whatever I add or change it seems 7up for the compiler.
missile.origin = self.origin + '0 0 10';
is the place to look I think?
That's The Correct Line
That's the right line to modify, keep playing with it until you get an effect you like.
the only way I can make the missile launch higher is when I exclude
//missile.origin = self.origin - normalize(self.velocity);
missile.nextthink = flytime + time;.
Then the changes seem to have effect, although I get an eyeheight missile launching and ending on
missile.origin = self.origin + v_forward * 8 + v_right * 1 + v_up * 10;
Changing The Order
Yeah, that would be the problem. Notice how both lines are setting the value of the same thing - missile.origin. The second line completely overrides the first one, like changing your order in a restaurant - you don't get two meals, you just get the second one.
Right, Uhm Wrong
missile.origin = self.origin + v_forward * 8 + v_right * -16 + '0 0 24';
returns a launcher that shoots from the launching point left above the player.
missile.origin = self.origin + v_forward * 8 + v_right * -16 + v_up * 16;
returns a missile that explodes left of the player.
I'm thinking I'm changing the end point of the missile hitting the player. It launches from the right point, but it ends up blind. Also the negative parm comes out strange. It's not left handed?
dir = normalize(vtemp - self.origin);
I used the enforcer_laser methode to launch the missile.
This way it is the simpelest way to compile for the wanted use.
The code was from the Orb, and I had a hard job on coding the weapon.
Thanks for the hints!
They were helpfull.
Rubicon 2 question:
You have IT_NO_WEAPON replacing IT_EXTRA_WEAPON in the code. However, I'm not sure how to implement this in a map. Not seeing a spawnflag or other way to enable it.
Is there a way to trace a volume similar to traceline? I need to find a volume that is not occupied by players or monsters of any size. maybe something like traceline?
any decent engine will have a tracebox builtin for things like that.
failing that, you can also exploit quirks of droptofloor or walkmove(typically with FL_FLY?), but these are much more limited and may have additional engine-specific quirks that break your mod (at least in DP).
Something I wrote before on how you might write a tracebox function using the method Spike suggests. His caveats stand
Spawning with no weapons works but was never used in any of the maps so I didn't finish the part where an info player start can opt in to it. Right now it's just hard coded so to only happen if mapmame == test.bsp
So you would have to make some quakec change to complete the feature, or just change the hard coded string it's looking for -- or name your map test.bsp :)
Is there any way to attach colored lights to projectiles or explosions via QC?
I would like to make the vore's ball glow with a purple light, make the tarbaby's explosion blue, this sort of thing...
I'm using quakespasm-spiked btw.
a trail particle effect with 'lightrgb' and 'lightradius' set should be able to provide coloured dynamic lights, but it might only be with flashblends. I don't think I actually got around to testing it properly.
point effects will additionally need lighttime, and probably want at least one of lightrgbfade+lightradiusfade.
there are additional light properties, but those are specific to rtlights, which are definitely not supported in qss.
Thanks! I'll try that =D
What's the most reliable way to detect if the player is on a slippery slope (mostly vertical angle)? I'm using QuakeSpasm-Spiked.
tracebox(self.origin, self.mins, self.maxs, self.origin-'0 0 1', TRUE, self);
if (trace_fraction < 1 && trace_plane_normal_z < 0.7)
you could instead use traceline, but it would not match the player's physics so well.
Thanks, but the most difficult thing about it is detecting the exact moment when the player touches/lands on the slope. AFAIK the engine doesn't set FL_ONGROUND for it, and assigning .touch functions to players doesn't work properly.
Is there a way to achieve something similar to DP's (and Makaqu's) .glow_size in QSS, through QC?
More specifically, negative dynamic lighting with custom radius and intensity, tied to an entity.
I've seen some ways to customize lighting effects in qsextensions.qc, but there's no way to change their properties and make them move around dynamically.
Also, I would like such negative lights to affect only BSP models, without affecting MDL, SPR and particles.
Out Of The Blue
moving lights hack, maybe?
Can't Jump When On Top Of Monsters/explo Boxes
There was some QuakeC fix posted here, but I can't find it. Can someone repost the fix?
... that the source code of Quake has a 256*5 char static array whose contents, literally, are:
Do you guys know if this particular array (localmodels) has survived in any of the modern engines, somehow?
Cl.viewent - Where Is It Loaded?
Awfully sorry to bring this up, but I have had no luck doing it myself. Where exactly is cl.viewent assigned a specific value? Where in the code do you tell the client which gun model to use? I can´t find any direct assignments to the field, and (unless I´m doing something wrong) I can´t also find a place where the whole cl struct is being copied off somewhere else.
Do you guys know where in the source is cl.viewent being (directly or indirectly) assigned to?
Someone help Izhido out here.
Also I still request this thread be stickied to make it more useful.
Quick search indicates that it's happening in V_CalcRefdef() and V_CalcIntermissionRefdef(), both in view.c.
It may or may not be obvious but this represents weapon from the POV of the player and is set based on the client state structure (cl.stats).
The reason "find references" (which you probably used) didn't show you any results is that a pointer to cl.viewent is taken in the V_CalcRefdef() body (view = &cl.viewent;) and later assignments are done on the temporary pointer (e.g. view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
Hope this is the answer you were looking for. Non-vanilla engines perform some additional operations on cl.viewent but I haven't seen any other model assignment logic in QS so I assume these are the only two places where it happens.
@Thulsa - Thank You!
It *did* help. Looks like I need to be way more careful about variable assignments in there for future changes.
I made a monster.A copy of RMQ's flayn monster code,but edited heavily to fit in with regular quake.
I removed the reanimation code,torso splitting code and some functions that weren't in the file.
Now the thing is,I precached the models and I even have them in my progs folder for the mod.
In the requiem engine, "create monster_flayn" works,but and invisible monster spawns.
QSS and MarkV don't even start the e1m1 ENT file with the monster_flayn that replaced all monster_army.
Should I rewrite the code?
Am using progs_dump_devkit_v110, vanilla dump works fine but my mod doesn't load e1m1.ent with the new monster