Week 14 Day 2 - Quake Modding III
Today we played more Quake and learned four things:
1) How to spawn an entity (an "actor" in UE4) with spawn(), and the different things we can set on this blank entity: origin, velocity, avelocity, movetype (what physics to use), touch, think, model, size, solid
2) dremove to delete an entity. If you make entities and don't delete them, the idTech engine will crash when its entity limit is hit.
3) findradius(origin,radius) returns a list of all entities with a location within 'radius' units of 'origin'. Very useful if you're going to be doing explosions and things like that. It returns a linked list, so if you don't know what that is, just copy/paste some code that uses findradius and change the inside of the loop.
4) .nextthink set on an entity will cause its .think function to be called at whatever time you put into nextthink. So for example, if you have a function called say_hi(), that will have the entity say hi, and you want it to activate 4.5 seconds from now, you could do this:
entity tmp = spawn();
tmp.nextthink = time + 4.5;
tmp.think = say_hi;
4.5 seconds after the current time, it calls say_hi, and then say_hi should probably finish with a dremove(self) to remove the timer. If you want it to repeat saying hi every 4.5 seconds, then have the function end with self.nextthink = time + 4.5; and it will say hi endlessly every 4.5 seconds.A lot of delayed action (like pulling the pin on a grenade) takes place in this way.
Other Videos By Bill Kerney
2021-04-22 | Week 14 Day 2 |
2021-04-21 | Week 15 Day 2 - Advanced Topics, Histogramming |
2021-04-21 | Week 15 Day 1 - QuakeC Part III - Traceline, Hitscan Weapons, and Find |
2021-04-21 | Week 15 Day 1 - Shell Scripting, Github |
2021-04-20 | Week 14 Day 1 - Set Theory |
2021-04-19 | Week 15 Day 1 - Multiple Inheritance, Virtual Inheritance, and Smart Pointers |
2021-04-18 | Week 14 - Projecting from World Space to View Space |
2021-04-17 | Week 14 Day 3 - Inheritance |
2021-04-16 | Week 12 Day 3 - Midterm Review |
2021-04-16 | Irish Trad Music Workshop |
2021-04-15 | Week 14 Day 2 - Quake Modding III |
2021-04-15 | Week 14 Day 2 - UNIX Utilities |
2021-04-15 | Week 12 Day 2 - Midterm Review |
2021-04-14 | Week 14 Day 2 - Bitfields |
2021-04-14 | Week 14 Day 1 - Quake Modding |
2021-04-14 | Week 14 Day 1 - Static vs Dynamic Linking |
2021-04-13 | Week 14 Day 1 - Hash Tables and Heaps |
2021-04-13 | Week 12 Day 1 - Cryptography |
2021-04-10 | Week 13 Day 2 - Intro to Modding Quake |
2021-04-10 | Week 13 Day 2 - Enums and Smart Pointers, MMap Part 2 |
2021-04-10 | Week 11 Day 3 - Reproducibility Crisis |