|
Post by abel1389 on Jan 20, 2015 11:32:34 GMT -5
so this will be my first mod if i can pull it off, and i have no clue what i'm doing. i crafted a flashlight mod for the first Quake, but QuakeC was a little easier to work with. so where i'm at so far: I have a compiler and the 3.21 source code, and i've got my solution file up and running. i recognize some of the same concepts in the source that i saw in Q1, but i don't know how to go about creating the file for the torch itself, or what i would need to tweak in the other files to go along with that. yes, i'm a total noob to the coding thing, so i'm gonna get it out there before anyone else can that i'm ignorant of all this and in over my head. but i want to figure out how to pull this off. i just need some guidance for where to start. i have the cubemaps and sfx i used for Q1, which i would think would be usable in this instance as well. i've also plumbed Berserker's files, but i can't find where in his mod the flashlight is implemented, so if anyone else might have an idea, that could be a good place to start, and provide some good resources. and if there's something else out there like this that i just haven't found, please show it to me.
|
|
Null
Gladiator
Posts: 555
|
Post by Null on Jan 20, 2015 14:51:49 GMT -5
Although I'm not familiar with QuakeC, I've made a mod in Quake 2 that uses a flashlight. If you go with Quake 2 it's pretty straight forward adding it to the base mod if you know basic C programming, here's a short tutorial: www.quakewiki.net/archives/qdevels/quake2/23_8_98c.html
|
|
|
Post by knightmare on Jan 21, 2015 18:07:24 GMT -5
The Lazarus mod has a flashlight that's properly implemented as a usable item instead of a command. It also uses the TE_FLASHLIGHT temp event instead of an invisible sprite with a hyperblaster glow. You can download everything related to it here: www.markshan.com/knightmare/downloads/lazarus_total_09_2001.zipAlso note that tutorial code Null linked will probably cause a crash on loading a saved game if that flashlight pointer isn't added to the save fields in g_save.c.
|
|
|
Post by abel1389 on Jan 21, 2015 22:30:32 GMT -5
thanks, knightmare. i'll plumb the code and see what i can do with it. i'll keep you guys updated.
|
|
Null
Gladiator
Posts: 555
|
Post by Null on Jan 21, 2015 23:05:48 GMT -5
abel1389 As a beginner you probably want something simple, short, providing results that will not get you bogged down or discouraged early on, so I doubt you want to dig through tons of lazarus code to be honest just to extract a simple flashlight. The code I provided is straight to the point and minimum of what you need to get you started. I've used it before and I didn't run into any crashes, so I doubt you'll either. If you're really worried about it though, you can always add the pointer to g_save.c later once you get a feel for things. I'd go through a bunch of tutorials found on this page, before getting buried in lazarus though: www.quakewiki.net/archives/qdevels/index.shtmlThis page is really helpful. It's full of nifty bite size snippets for beginners. They're all pretty easy to follow and add to your base code, and it's how I got started.
|
|
jaydolan
Quake 2 Mapping Club
Posts: 161
|
Post by jaydolan on May 14, 2015 8:45:10 GMT -5
Hm, while I have faith in the Lazarus authors, I'm not sure a TE_FLASHLIGHT temp entity makes the most sense, either. That means the flashlight will be transmitted at every frame for which it is active. I guess, if it only contains a 48 bit packed origin, that's not awful. But might it be more efficient to just spawn an actual entity that can be delta-compressed (like the tutorial Null posted)? I guess the temp entity allows you to define a custom payload (color, radius, etc) as well, which is nice, but again, lacking in network efficiency. If a regular entity were used, you'd have to overload other entity state fields for radius and color.. meh, maybe I'm overly concerned with bandwidth.
|
|