News | Forum | People | FAQ | Links | Search | Register | Log in
Mapping Help
This is the place to ask about mapping problems, techniques, and bug fixing, and pretty much anything else you want to do in the level editor.

For questions about coding, check out the Coding Help thread: https://www.celephais.net/board/view_thread.php?id=60097
First | Previous | Next | Last
One Advantage To Backtracking 
is that the player has already learnt from his previous experiences, what are the best ways to fight in a certain spot (or should at least have an idea anyway).
to this end, you can increase difficulty to what would normally be a little excessive. the player's knowledge of the areas he'll be fighting in, should give him a bit of an edge, and make that excessive situation just about normal. 
Backtracking Ideas 
- fighting your way down a pit and then fighting back up

- shift platforms or walls, reveal traps

- open up the ceiling to reveal the skybox or other inconsequential coolness

- block directions the player shouldn't take

- and of course spawn more monsters 
Quake C Question 
I have two progs.dat files. One is much bigger than the other and I am looking at the differences. I am looking at ogre.qc and see these two differences-

void () ogre_die3 = [ 114, ogre_die4 ]
{
self.solid = SOLID_NOT;
self.ammo_rockets = SPAWNFLAG_LASER;
DropBackpack ();
};

and the other-

void () ogre_die3 = [ 114, ogre_die4 ]
{
self.solid = SOLID_NOT;
self.ammo_rockets = MOVETYPE_FLY;
DropBackpack ();
};

Why should there be differences and what does it do in the game? 
Code And Decompiling 
MOVETYPE_FLY and SPAWNFLAG_LASER are both just constant floats within the QC, defined in defs.qc and in misc.qc. SPAWNFLAG_LASER takes the value 2, so that the ogre drops 2 rockets in that mod. MOVETYPE_FLY normally has the value 5 assigned to it, so in that mod the ogres will drop 5 rockets instead. However, the fact that either of those constants appear in the code you're quoting suggests that you got the code by decompiling. Are you sure that's the only difference between the two sets of code?

If it is the only difference, then the size of the compiled progs files could just be due to the compiler originally used on each one. More recent compilers perform lots of optimisations that reduce the size of the progs(the size reduction is a side effect of the intended aim, which is to make the file hit fewer limits in the quake engine and so on). If there are more changes in the code, then they are much more likely to account for the difference in size.

In short, the only gameplay difference will be the number of rockets dropped by the ogre, and I'd guess that shouldn't affect the progs size at all. 
Preach 
Thank you for explaining. What is the benefits by using constants instead of entering the value you want?

Yes, I did get the codes from de-compiling and one of the versions was (I think) yours - spawning monsters by the use of the 'style' flag in the map?

I have since found some more differences which is to do with setting monsters health from the map file. And also to do with ogres shooting missiles instead of grenades but I can not yet work it out. 
Constants And Decompiling 
The advantage of of using constants is to make the code clearer, and the ogre code above is a really bad example of this, as it's made things more confusing not less. The quake engine and the QC code both remember a lot of properties, such as the way an object moves (it's movetype) as numbers. But if you want to code something with the flight movetype, it's annoying to have to look up a number, and when you read the code back:
self.movetype = 5;
isn't very clear; you'd have to look up what movetype corresponds with 5 to figure out what the code means.
self.movetype = MOVETYPE_FLY;
is much easier to understand, although once it's compiled, both lines are equivalent.

The equivalence causes a problem when you come to decompile the code. The decompiler can't see which constants to use where(to the best of my knowledge) and so it takes a guess as to which ones belong where. In the case of the ogre, it's guessed incorrectly that the number of rockets should be a constant. In the case of the ogre, there is no advantage in using a constant instead of just entering the value, and in the original code it is just a number:

void() ogre_die3 =[ $death3, ogre_die4 ]
{self.solid = SOLID_NOT;
self.ammo_rockets = 2;DropBackpack();};


As a recommendation, I'd try to not work with decompiled code where you can, I hope that the source to the mod I wrote is included with the mod, otherwise let me know and I'll send you it. If you're trying to merge multiple mods together, and there's no way to get the source code for the other mods, start with the clean source/source to my mod, then add just the bits of decompiled code that you need to that base.

Decompiled code also lacks comments, which are sometimes quite helpful. For the teleport mod, all the changes I made were commented, so if you wanted to add teleporting to another mod, you could simply find all the comments in the code, and follow the instructions to copy them into another mod.

Phew, that ended up long... 
Preach 
Words of wisdom thank you.

I started looking at code back about front as I wanted to see how to compile before I had written anything to compile. So I decompiled some progs.dat to play with which is why I ended up with code without comments. So now I try to do it right.

I now have the source code and it is yours. What is the extension .$$$ used for? The code in these files includes shalrath_tele. Does the $$$ files get compiled just the same?

How does the game know that the code for monster_shalrath_tele as entered in the map file is in the shalrath qc file, is this defined somewhere else? I am not clear because you say in the readme file that if the shalrath is not to teleport away than use the ordinary shalrath so I think that both will be compiled.

I am really interested in learning about this code so I am sorry if all of this is too simple for you but will be pleased if you will help. 
Make $$$ Quick!!!!! 
Arrrgh, I shouldn't have left the $$$ files in there. They are backup files that get automatically generated by the program I use to edit qc files, you can safely ignore them or delete them.

The idea behind the monster_shalrath_tele is this: When a map is loaded, the engine looks at the name of every entity that is included in the map. It then tries to find a function in the QC with the same name as the entity, and runs that function(or produces an error message if it can't find the function). The function is usually designed to set up the entity in question, set it's model, it's behaviour and so on. The engine sets the entity called self to be the entity in the map, so by setting self.health in the function you affect the health of the thing in the map.

When you run this mod along with a map that has a monster_shalrath_tele entity, it runs the function
monster_shalrath_tele();, which basically makes a vore in the right place in the map, with a special death animation that looks like a teleport.

Because there's a new function for this kind of shalrath, the old one is still present, and unchanged. So any monster_shalrath in the map will be just like the ones in the original quake. I could have programmed it differently, so that you just set a flag on a normal monster_shalrath in the map, that makes it teleport out on death, but I did it this way because that's what the original recipient requested.

If you wanted to make, say, a new monster, so that the entity you added to a map was called monster_troll, then you'd call all the animation functions and so on whatever you like(although it's usual to stick to the conventions in the existing code). Then just ensure the spawn function was called monster_troll().

Hope that clears up how the game knows what code to use for which entites. 
Preach 
Great, I understand now. Thank you. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Preach 
Well, I am quite pleased because I managed to find your error tutorial hidden in the shambler.qc file ;-)

monster_shambler_tele_set
and
monster_shambler_set_tele

I stared at it for a long time before I could see it!

I didnot try the progs.dat supplied as I was adding some code so I cannot say if is OK or not. But it compiles good now and works fine. Thanks again. 
Lol 
 
Holy Fuck, 
a new record!


blaGGer, please don't hit submit a bunch of times, or refresh or whatever the hell you did. 
Hahahahahahaha 
A dectuple-post!!
Hell yeah. If you're going to do something, then by golly, just go all out with your bad self.

I'm home sick today and feel kind of shitty, and that made me feel better. 
 
I am not in the trunc dreath?
I am not in the grunt breath?
I am not in the drunk thread? 
Blagger Is Just Simply Quite Pleased! 
;-) 
Sorry, Sorrry, Sooorrrry 
So sorry times many times! 
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.