 Thank You
#2281 posted by Bloodshot [96.250.1.8] on 2017/03/01 04:01:56
How do i put a negative number in there? Like say i want a range from -250 to 250
#2282 posted by Kinn [81.131.206.64] on 2017/03/01 04:06:04
It's no different, "min" is -250, "max" is 250, so that would be
(random() * 500) - 250
 Thanks
#2283 posted by Bloodshot [96.250.1.8] on 2017/03/01 04:12:48
First time i did it with negatives i must've entered something wrong, now it's working thank you
 Any Way To Set Model Flags Through QC?
#2284 posted by Bloodshot [96.250.1.8] on 2017/03/01 06:14:58
Hexen 2 has some extra model flags for trails that I can't set unless I merge models with QME, but I still can't get exactly what I want
 @bloodshot
#2285 posted by Spike [86.176.35.117] on 2017/03/01 10:20:20
random:
random(-250, 400) will give you a random number between -250 and 400.
this will work with any HexenC compiler, as well as fteqcc even when not targetting hexen2.
model flags:
fte and dp both have some .float modelflags; field.
unfortunately the networking only supports the first 8 bits, and isn't supported by any (non-fte) hexen2 engines, so it won't get you anyhwere.
you may need to resort to a hex editor. you want the 32bit int at offset 0x4c.
although I'd like to think that later versions of qme allowed setting arbitrary flags...
 Good Point About QME
#2286 posted by Bloodshot [96.250.1.8] on 2017/03/01 23:03:18
I've been using 30 because I couldn't find the download again for 31, but I think I might be able to grab it from my laptop and check
#2287 posted by R00k [136.63.99.153] on 2017/03/02 04:48:50
i seem to have 3.1 ill look for a zip or i can make one i guess. I know i have it somewhere
#2288 posted by mukor [66.41.56.60] on 2017/03/02 04:52:45
#2289 posted by Pritchard [121.214.149.10] on 2017/03/02 11:24:59
It's been about 5 months since the last time this was asked, that's a pretty good run I guess. Maybe six next time? :p
 Can You Make Anonymous Functions In Qc?
#2290 posted by [172.98.67.111] on 2017/03/04 15:12:07
 Fteqcc
#2291 posted by Spike [86.176.35.117] on 2017/03/04 15:37:08
void() foo =
{
entity e = spawn();
e.think = (void()){
dprint("I THOUGHT!\n");
remove(self);
};
e.nextthink = time + 1;
};
such functions may still have undefined behaviour when it comes to saved games, especially when the progs itself is changed. so while you should probably still avoid it, the above works in most cases.
note that there's no enclosures - so you can't access the locals of the parent (static locals should work though).
 +1 Sticky This Thread
#2292 posted by Qmaster [70.195.70.196] on 2017/03/06 18:28:51
#2293 posted by Pritchard [121.214.149.10] on 2017/03/06 22:27:06
Make the thread sticky on its 10 year anniversary.
 Blood Splat Question
#2294 posted by Ruin [174.134.209.128] on 2017/03/08 06:11:31
Ok, I was in the wrong thread last time...
Do you know how to make a blood splat on the walls in quake that will align with the wall? I've seen it done before, but I cannot cite my sources, unfortunately. I'd be happy to pay someone to make a .qc file for this.
Thanks.
 Blood Splat Question
#2295 posted by Ruin [174.134.209.128] on 2017/03/08 06:11:37
Ok, I was in the wrong thread last time...
Do you know how to make a blood splat on the walls in quake that will align with the wall? I've seen it done before, but I cannot cite my sources, unfortunately. I'd be happy to pay someone to make a .qc file for this.
Thanks.
 Untested Suggestion
#2296 posted by Preach [82.46.16.57] on 2017/03/08 08:40:37
 Preach
#2297 posted by Ruin [174.134.209.128] on 2017/03/09 06:17:51
Preach, you brilliant bastard!
Can I compensate you for your help?
Thank you so much!
 Nah, Cheers
#2298 posted by Preach [82.46.16.57] on 2017/03/09 19:53:01
I'd risk getting a bit mercantile if I accepted that!
 Bit Subtraction
#2299 posted by R00k [107.188.184.100] on 2017/03/24 00:13:23
okay, I'm not a novice to QuakeC but, i have a question.
float FOO 64
float foo2 128
float foo3 256
so
is it incorrect to use:
value = value - FOO
vs
value = value - (value & FOO)
logically the first just subtracts 64.
I'm looking at OLD code and finding stuff like this.
I have always done it
value = value - (value & FOO);
to just turn off a value.
#2300 posted by Kinn [31.48.139.88] on 2017/03/24 00:22:36
is it incorrect to use:
value = value - FOO
I imagine you'll find instances of this in the old code only in places where they knew 100% that the bit was set, so just needed to subtract it.
Even so, it's still always better to use
value = value - (value & FOO)
because it shows the coder intent.
#2301 posted by Spike [86.176.70.105] on 2017/03/24 00:32:01
if you know that its already set then just subtracting it is fine...
 How Do I Get...
#2302 posted by ijazz2 [125.17.68.26] on 2017/03/26 09:12:12
After killing something,it drops a weapon,out of which some can be picked-up.Just like AD but with vanilla QC code.How do I get this?
I tried adding rubicon2's code for g_axe and g_shotgun in my mod but it didn't work.So now I am starting with a clean source in a few days,how do I make this code from scratch?
Is there a shortcut way to add frames for a monster in qc? I heard it was there in some tutorial online but I can't find it.
#2303 posted by khreathor [178.235.147.213] on 2017/03/26 10:00:24
Maybe start from checking out DropBackpack in items.qc
#2304 posted by R00k [136.63.99.153] on 2017/03/29 04:33:21
Like khreathor says,
when the mod drops a backpack, it spawns an entity, (with a timer to remove it).
To drop a gun seperate from the pack, like the gun in hand with *some* ammo, you need to spawn a new entity, with a PRECACHED model. and give that entity a .ammo amount, and create a touch function for that gun-entity.
I had done this once long ago. I will dig up some code and try to point you to your goal.
It only helps you to become a better coder with hints and not code cut/paste. But I can give you a detail list of what you need to get this working.
 Ijazz2
#2305 posted by Mike Woodham [109.148.167.181] on 2017/03/29 09:49:22
Not exactly what you want but you may find some of the coding useful to get what you are after:-
http://www.insideqc.com/qctut/qctut-60.shtml
http://www.insideqc.com/qctut/lesson-10.shtml
 Lightningdamage
#2306 posted by R00k [107.188.184.100] on 2017/03/30 20:12:43
does anyone know why IDsoftware made the trace for the lg start at the feet not +16?
```
org = self.origin + '0 0 16';
traceline (org, org + v_forward*600, TRUE, self);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
WriteEntity (MSG_BROADCAST, self);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
WriteCoord (MSG_BROADCAST, trace_endpos_x);
WriteCoord (MSG_BROADCAST, trace_endpos_y);
WriteCoord (MSG_BROADCAST, trace_endpos_z);
LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30);
```
 Lightning Position
#2307 posted by Preach [82.46.16.57] on 2017/03/31 08:45:59
First thing to note is that the player's self.origin is at crotch level, not feet level. However, you are correct that the visual beam projects from a height of 16 units above the damage beam.
The sad truth is that the lightning bolt code is kinda buggy, and that's not even the worst bug. If you look through LightningDamage you'll notice it performs 3 traces in a row. The intent seems to be making the beam wider and allowing it to hit multiple enemies in the path. In fact, the vector calculations for the 2nd and 3rd are completely wrong, and the beams just fire into parts of the level that can't be seen by the player.
The buggy extra beams do fire in a way that is predictable based on the player's origin and facing angle. The following video shows a speedrun which exploits this! At about 50 seconds in, the player rides a lift down, faces in a very specific direction, and starts shooting the Thunderbolt. The specific location and direction of the shot causes a second beam to hit the Shalrath at the end of the level, which kills it before the doors open. This lets you grab the rune early, speeding up the run...
https://www.youtube.com/watch?v=D_P35WtpAwY
#2308 posted by onetruepurple [85.232.250.182] on 2017/03/31 09:42:05
origin is at crotch level
So that's realistic then.
 Lightning Buggy
#2309 posted by Qmaster [70.195.68.93] on 2017/04/01 00:33:46
Sounds like a fast 4 wheeler.
Anyhow, is there a fixed version of the code somewhere?
#2310 posted by ijazz2 [125.17.68.26] on 2017/04/05 14:55:30
I need to keep this thread at the top of the forum!
Someone please make this a permanent thread!
 @qmaster
#2311 posted by R00k [136.63.99.153] on 2017/04/08 06:27:20
org not origin
 Gpl License Rant
#2312 posted by komagama [151.16.48.217] on 2017/05/12 04:32:42
help guys:
I'm trying a Q1 total conversion(a true one! as Carmack stated in gpl readme) and I created my monsters totally re-skinning the standard knight model in qme.
So,in a supposed commercial release, may I use them also with the knight animations left untouched in qme ?
-my monsters don't resemble id original in any way and after all animations frames are only numeric values in qme not copyrighted assets I guess-
 Gpl
#2313 posted by Qmaster [67.45.40.52] on 2017/05/12 05:40:32
Lets you sell the stuff too.
 The Content Is No GPL
#2314 posted by No [204.17.56.42] on 2017/05/12 08:29:51
Engine and game code are GPL, the content is not. Even with a new skin, it's still the original model. You'd have to create a new one from scratch.
 ..thank But Think Of
#2315 posted by komagama [151.16.138.192] on 2017/05/12 13:33:13
..qc code:
qc code is free to use and from what I saw animation frames are also listed in it so what ?
 Semantics, Semantics
#2316 posted by Kinn [81.131.159.223] on 2017/05/12 14:12:41
When you say "skin" do you mean the texture or the model? At some point the word "skin" transitioned from originally meaning just texture to meaning the whole thing - texture AND model.
If your model is a completely new model built from scratch then I imagine it's fine in a commercial release.
 I Am Not A Lawyer! This Is Not Legal Advice!
#2317 posted by Spike [86.140.27.141] on 2017/05/12 21:01:52
'may I use them also with the knight animations left untouched in qme'
if you started with the knight model in qme, then the result is still a derivative work in some small way, and still subject to id's copyright.
strictly speaking such derivative works (note that this includes maps that just contain id's textures) should not be distributed at all, but we usually do so anyway on the understanding that the recipient has the full version of quake. I believe we follow that interpretation thanks to someone at id saying it'd be okay despite not being stated in the license, but I can't prove that sadly.
you may also be able to get by on fair-use laws, depending on legal jurisdictions... so you can probably get away with loading up the model and deleting the skins+verticies+triangles. names and sizes of frames+skins is probably okay under fair use, but sticking to those frame numbers means that your resulting model is probably going to play back at the wrong speed or something stupid/ugly like that, so its not something that's really worth much anyway.
the sources for the maps was also released (under the gpl) a while back, but combining that with the vanilla textures is arguably a violation of the gpl!
if you want a _total_ conversion, then delete pak0.pak and pak1.pak from your harddrive...
(and use a different palette... if only because quake's sucks...)
#2318 posted by khreathor [178.235.147.3] on 2017/05/12 23:57:12
I wonder what is minimum PAK content to run engine?
I guess palette, sprites to run MENU, start map, what else?
 Minimum
#2319 posted by Qmaster [67.45.40.52] on 2017/05/14 00:50:16
gfx.wad
Should be it I think.
#2320 posted by Spike [86.140.27.141] on 2017/05/14 07:31:49
dp+fte will both start up with absolutely nothing, depending on your definition of 'start'.
FTE:
for instance, if fte can't find id1/pak0.pak (or equivalent) then it'll not know what sort of game its meant to be running nor which gamedirs it should use. you can get it to behave with -basedir . -quake -nohome and it'll get the idea then. alternatively put fteqw.exe+default.fmf in the same dir and you can get the same effect without commandline args (possibly with other gamedirs instead, no id1).
if there's no [qw]progs.dat then fte will fail to spawn any entities. however, it will still load the world, the PutClientInServer function will fall back to spawning the player with noclip, and the various other missing functions will be ignored. The result is that you can at least view maps with nothing but the engine and a bsp... (and one of those 3 ways to get the filesystem code to be happy).
DP:
dp tends to have extra dll dependancies. I don't know if it'll cope without a progs.dat, but it should be fine if you give it a progs with just entity self;.float movetype;void()PutClientInServer={self.movetype=8;};
or you can just compile some gpled progs. obviously this isn't needed if you're just running it as a client.
QuakeSpasm/Other:
ignoring dll dependancies, other engines will definitely need some gfx.wad, for the palette lump, the colourmap(in sw renderers) lump, conchars lump, the various sbar image lumps (apparently quakespasm doesn't need those any more). They'll also need a gfx/conback.lmp, in most cases a gfx/pop.lmp (so they actually allow loading files without the demo's pak0.pak - this file can be generated correctly from the engine source which defeats the point of the check for it). annoyingly they'll also need a player.mdl (player baselines expect it, use a renamed spr or bsp if you want). any menus that are displayed (most noticeably the main menu) will need their images to load in order to avoid sys_errors.
you'll need a progs.dat if you're running it as a server. You'll need to provide everything up to end_sys_fields without reordering etc. this will also include a few functions which will need bodies, though they can be empty (you'll probably want at least the noclip thing though).
you'll also need a map, presumably.
those are the files/lumps that I can think of.
 I Confirm That Pak0 And Pak1 Are Needed..
#2321 posted by komagama [151.16.55.38] on 2017/05/14 13:40:59
..to run Quake, so better leave them there.
As for my TotalConversion project, do ya think a single person could bear all the load of work needed ?
I'm relatively good at creating textures, levels, models.. even weapons(aarrrgh!), but I fall short on fx sounds and AI code for example :(
AI is an intangible thing so how could people be aware if I use IDsoftware one ?
 Thanks Spike
#2322 posted by khreathor [178.235.147.3] on 2017/05/14 16:38:56
I found this thread about minimum code in QuakeC too: http://quakeone.com/forums/quake-talk/quake-central/11506-quakec-developer-tools.html
...but I think writing everything from scratch is kinda tedious task.
 AI Code In QuakeC
#2323 posted by Qmaster [70.195.86.190] on 2017/05/16 16:31:40
Quake's AI uses a set of think functions for various behaviours: th_run, th_stand, th_die,etc.
These functions start a chain of frame functions: void run1 [0] () { ai_run (<somedistance>)}, void run2, run3 etc.
Each function in the chain references a frame number in []'s.
The ai_run, ai_walk, ai_slide, etc. within each chain function moves the enemy by the set distance so that the monster can move realistically with its steps. For instance, at a frame where a foot touches the floor, you might not have an ai_run function or the ai_run will have a small value so the monster stops or slows with its steps.
Other functions do other actions timed with that frame in the animation.
Study the qc source for reference.
#2324 posted by [66.229.17.0] on 2017/06/01 01:38:45
Is there a documentation for the QuakeC opcodes? I'm planning to write a small compiler for something less crappy than QuakeC.
#2325 posted by Baker [65.60.237.219] on 2017/06/01 03:10:40
pr_comp.h in the Quake engine source code
 General Purpose Question
#2326 posted by dumptruck_ds [168.161.192.15] on 2017/06/01 19:22:48
I have a couple of Quake related utilities that were made for Win95 era. They won't run in compatibility mode in Windows 7. I know I have the source for at least one of them. They are very unique programs I was going to hand off to Quaddicted as they don't have them in the archives. One is a fractal terrain generator (FraQuake) and the other is a map editor that creates maps from simple text files (Phase II).
So the question is:
Is there a way to have these simply recompiled to work on modern OSes? Does something "automagic" like this exist? Or are their services that I could use to port these to run on modern OSes? I obviously know next to nothing about coding. I've never run a virtual machine either. I would assume there's a way to scratch the itch but love to hear options. VBRUN300.dll is required for both of them So I assume written in Visual Basic... errr maybe?
#2327 posted by Pritchard [124.180.138.22] on 2017/06/01 22:43:36
Generally speaking I find virtualization is the best way to keep using those tools. I use a win95 VM on my win10 machine for things like that (specifically, I set it up to run the QME installer).
Converting an app to run on modern windows otherwise would provably be a LOT of effort by comparison, unless perhaps the source code was already readily available...
 @pritchard
#2328 posted by dumptruck_ds [168.161.192.15] on 2017/06/01 23:44:32
Thanks, I am looking into installing Windows 7 32bit as I have a disk and license for that (note that it has 16 bit support whereas 64 bit versions don't). I have WinXP somewhere as well but lost my license. I know there are other options but I try to not "borrow" licences. ;)
I do have the source code for one of the the two proggies but in researching this it looks like VB3 is *really* freaking old and tough to find info on this stuff when you don't know what you are doing.
 You Could Include The Source
#2329 posted by Qmaster [70.195.65.145] on 2017/06/02 00:13:15
In your quaddicted upload. (Always and forever :) )
 @Qmaster
#2330 posted by dumptruck_ds [168.161.192.15] on 2017/06/02 00:54:16
Of course! I thought I had to email the files to Spirit. I can upload them? Will be happy to.
#2331 posted by Baker [65.60.237.219] on 2017/06/02 01:03:30
 Well
#2332 posted by Qmaster [70.195.65.145] on 2017/06/02 03:17:40
Ya you have to email them to spirit, but I mean please package them in the same zip beforehand and sounds cool. FraQuake? Whoa. Text mapping...hmmmm
 @Qmaster
#2333 posted by dumptruck_ds [68.119.139.87] on 2017/06/02 06:01:34
PhaseII is an oddity to be sure but both of these apps have a really interesting UI and are (to me) a pretty interesting part of our collective Quake lore. They were coded by a women who was injured in a car accident and kind of fell out of the Quake scene as a result. I've never been able to track down what happened to her after her hospitalization. I will email these to Spirit but here they are for the curious. No source for PhaseII unfortunately. Well worth a look IMO. That's why I wanted to get them running again.
https://www.dropbox.com/s/plh6rsopnx3c863/fraquake.zip?dl=0
https://www.dropbox.com/s/4hgvr5ojab38xnl/phase2.zip?dl=0
|