News | Forum | People | FAQ | Links | Search | Register | Log in
Coding Help
This is a counterpart to the "Mapping Help" thread. If you need help with QuakeC coding, or questions about how to do some engine modification, this is the place for you! We've got a few coders here on the forum and hopefully someone knows the answer.
First | Previous | Next | Last
Something To Do With Map Testing? 
I'm no expert, but as I understand, Quake has some tools for map testing. For example, if you place one of your entities like health/ammo boxes etc. too close to the floor when creating the map, there's a chance the entity falls of the level when you run it and get a message in your console for every entity that had fallen off the level. Maybe the line of code is referring to that? 
Malice Source Tweaks 
Thanks for the tips. Spent a few hours getting most pertinent messages translated back into English correctly. The last one I posted still escapes me. As well as one I find that translates into "Splitter" But no idea what it actually does.

Other than the translations, I have managed to add reverse weapon cycling and reverse item cycling. Is there anywhere I can post it when I'm finished so that an English source is available for all?

Also, any ideas on a fix for the probe not moving when selected? Is there a quakec fix for this or only an engine side fix within quakespasm?

Thanks. 
Legend Is Everywhere 
Hello again my friend,

I noticed that you posted about your Malice issues in the Quakespasm thread as well. I would like to stay here in the coding help section to better keep topics together. Also because it is not an Quakespasm-only bug.

First of all I am glad that the russian-english tip brought you further in your project.

You brought up some other related questions which I would like to try to answer.

- Chrome is outdated:
You would be suprised who else is still using XP. Why not try and install firefox if chrome doesnt work. You can install and use multiple browsers.

- "the subject fell from the level on":
Like Esrael already wrote, this is a developer message. Please look at the vanilla function inside items.qc: void() PlaceItem
It is exactly the same. You can even use the original english text from there. Which is: "Item fell out of level at "

- minigun texture misalignment:
Please find a fix for it here:
http://quakeone.com/forum/quake-help/general-help/278376-malice-for-quake-minigun-goes-all-odd-in-quakespasm

- spy probe not flying in Quakespasm:
Never use setmodel() without setsize()
That is the main culprit here.
So, what you want to do is, open probe.qc and add after: setmodel(self, "progs/probe.mdl");
this line: setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);
That will fix the basic issue and the probe works again.
But there is another issue with the code: Malice spawns it in relation to the players view and angle. That needs another fix to make the probe also work when it is spawned while the player is looking upwards:
Change this line: self.origin = self.origin + v_forward * 40;
To this: self.origin = self.origin + v_forward * 40 + v_up * 10;
That should do the trick for most angles and situations. The ceiling is normally always 10 units higher than the player. So that is no problem.

Best of luck with your version of Malice. 
 
Cool. Thanks again for the probe and message help. I was hoping the probe could be fixed with qc. :)

As for the browser, I do have firefox installed as well. Unfortunately it doesn't wanna work either as far as quakeone goes. :(

I came across that minigun skin you pointed out and it does indeed fix the issue. Though, I suspected it could have been an engine thing since messing about with graphic settings does temporarily fix it without the need of the new skin. Though I'm happy to just go with the skin for simplicity sake.

I posted in Quakespasm thread cause I believed the probe to be an engine issue.

Thanks again. 
 
Thanks I got the probe working now with your code. One odd thing is that it won't start moving until the player looks up first. As in, you can't activate the probe and immediately start moving forward. Is this how it originally was supposed to work? 
That Dang Probe! 
Something is eluding me here. I can make it it function, but only after the player looks straight up. I've even tried using code from spawning rockets to try and make it begin further out. I'm missing something. Any other ideas? 
 
No problems here, Legend.
I push the use button and right after that the fire button and it starts flying without even moving the mouse. It doesnt matter if I look straight, a little down or upwards.
Sorry, you must have done some wrong copy/paste.
I used the exact same lines I gave you.

Just in case, be sure to not use a previously saved game with your new progs.dat as the gamecode has been changed. Always start a new game/map and test.

Even in that tiny place at the start of map d2 it works as it should. I am using QS 0.93.
Try harder Legend :) 
Malice Probe Code 
Thanks. I'm using the same version of QS. Could you possibly look at my code and let me know where I went wrong?

https://docs.google.com/document/d/1TKd9WRx6-rxw-tqALcaaAm81w5_OnUsOLCE09z4reuA/edit?usp=sharing

Thanks. 
 

self.probe_sound = time + random() * SVC_SETVIEWPORT;


Gotta love decompilers. :)
All those assignments to unrelated constants from defs.qc makes it really hard to read. Consider changing them because that'll be way more appealing for anyone willing to help. 
C´mon Legend ... :) 
I wrote:
"
So, what you want to do is, open probe.qc and add after: setmodel(self, "progs/probe.mdl");
this line: setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);
"

Unfortunately you added the new line at the wrong place. You must read more carefully.

You added the line after:
setmodel(probe, "progs/probe.mdl");
That is NOT:
setmodel(self, "progs/probe.mdl");
You set the model to the wrong entity.
probe is not self and self is not probe. ;)

You should not change model or size to different entities in one code block. That awakes evil things and the shamblers will hunt you for that :P

I am sure you can fix it by yourself now. Just reread post #2448.

Also, you still have the russian text inside your code...

Best wishes my friend.
And many greetings to osjclatchford. 
Doh! 
Ugghh. Of course it was just a simple silly oversight by me.

I cannot find any more russian in the probe.qc. I'm sure I may still be missing some in the rest of the files. Though. Which is my blind ass missing in the probe.qc though?

And btw, who is you is? Seven? Dutch? And how do you know I've been talking with osjclatchford? Are you psychic? A sorcerer? :O

Anyways, thanks again for all your help and explanations. 
 
What's up Legend!

Nope, it's not me. But I happened to see my name pop up, thought I'd say hi. I haven't been on the quake scene much anymore since Quakeone took a nose dive. I might jump back in after a while. Good to see you're still honing your code skills. 
A Newbie Here 
As some of you may know (including otp),this is ijazz2,except it's been a long time,with me having school and also getting selected for some NASA competition which means I go to LA from India in 2 months.Did I mention I forgot the password for ijazz2?

I have a small question.

How do I get weapons to replace other weapons?
(examples:Warhammer from Quoth,Axe<->Sword->Mjolnir from Drake)

I understand that this may take me a very long time to learn,but I am willing to do this.

Also,OTP?
I'm sorry for trolling. 
 
are you asking how would you put a different weapon in game? or are you asking how do you have multiple weapons bound to the same key on the keyboard? 
Shamblernaut 
I am asking this:
If Ranger has an axe and he finds a sweet chainsaw,he picks it up,right?
But he has to drop the axe to have the saw.

In straightforward language:
How do I make the player replace the axe with another weapon on pickup?

As I mentioned,examples:
In Quoth,when you pick the Warhammer up,you lose the axe.

In Arcane Dimensions,you lose the regular axe when you pick the shadow axe up.Same goes for the SSG to Widowmaker and Thunderbolt to Plasma Gun.

In (whatever has been released) Drake, the chainsaw replaces the axe.
The sword and the axe replace each other on pickup(both have the same stats;only model differs)

Nailgun is replaced by Super Nailgun

Blaster is replaced by Laser Cannon

Weapons bound to the same key are there in an InsideQC tutorial,so I don't need to worry abotu that.Anyway I'm not gonna have multiple weapons on one key. 
 
self.items is where an entities items are stored.

What you'll want to do is remove the existing (to be upgraded) weapon from the players inventory, and then add the new weapon.

items.qc is where this is handled and item names are defined in defs.qc.

it should be fairly simple to do. 
Well 
It is a bit more involved than that.

For a custom warhammer/axe/whatever you will need the following... (using JazzAxe for example)

defs.qc::
•Add a line float IT_JAZZAXE = 128; (assuming ID1, otherwise use next available value)

weapons.qc::
•Add a W_FireJazzAxe function that is a duplicate of W_FireAxe with damage you want instead of 20 and any other special effects you might want
•Above W_Attack add a line "void player_jazzaxe1 ();" without quotes
•Inside W_Attack add an if statement that checks to see if (self.weapon == IT_JAZZAXE) that then goes to player_jazzaxe1 ();

player.qc::
•Copy and paste all 4 functions of player_axe1, player_axe2, player_axe3, player_axe4
•Add "jazz" (without quotes ofc) in front of axe1, axe2, axe3, and axe4 in the function names
•Change W_FireAxe inside player_jazzaxe3 function to be W_FireJazzAxe();

item.qc::
•Copy weapon_nailgun function (or any other weapon), paste, and rename to weapon_jazzaxe
•Change inside weapon_jazzaxe self.weapon to be IT_JAZZAXE, self.netname = "ijazz2's bane";
•Inside weapons_touch add an if (self.classname == "weapon_jazzaxe") new =IT_JAZZAXE;

I probably missed something. 
QMaster 
You forgot W_SetCurrentAmmo?

Anyway,thanks for helping.You probably should changed your username to QCMaster. 
An Unnecessary WIP 
 
you shouldnt need to do any ammo checks with melee weapons, unless you're building a melee weapon that uses ammo, which would be pretty cool too. 
Sorry For Multi-post 
QMaster,I have a problem.
I'm using the AD Shadaxe model for jazzaxe.
FTEQCCGUI compiled without error,but when I try to select the weapon (after picking up) it just switches to the shotgun.The model appears for a split-second then the shotgun appears.I cant use it.

Then I tried (using an InsideQC tut) to make the weapon switchable by selecting axe twice.
Problem is still there.

Help? 
Hrm... 
I've ran into that before...might be a conflict with whichever bitflag value you used for IT_JAZZAXE. Can you upload a zip of your qc files? I might be able to take a look at it. 
QMaster 
http://www.quaketastic.com/files/QC%20Mistakes/ijazz3_qc_jazzaxe_screwed.zip

This one has a few changes from standard id1,including the code which seems to be wrong for the Jazz Axe and some AD-inspired health model changes (.bsp to .mdl) 
Weapons.qc 
W_BestWeapon
Add if at the bottom
if (self.items & IT_JAZZAXE) return IT_JAZZAXE; else return IT_AXE;

And just below that in W_CheckNoAmmo:
inside the if (self.weapon == IT_AXE add "|| self.weapon == IT_JAZZAXE") 
W_CheckNoAmmo 
Something is not right.

CheckNoAmmo does not have if (self.weapon == IT_AXE) part! 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.