Chemist Posted May 15, 2016 Share Posted May 15, 2016 Hey there jkhub!So recently I've taken on a project to make an entity mod for t2_trip and I've been told all of my changes would require nothing else but entity modding. Now, I'm only familiar with GTKRadiant mapping, so I went on and looked through some entity modding tutorials, which are not very widely spread on the internet.My plans for the mod:Reposition the info_player_start. Place some vehicle spawners around the map. (optional) Retexture some of the caulked areas as they will be accessible in MP, but were inaccessible in SP. Remove all of the SP entities, such as NPC_spawner's and triggers for them, scripts, trigger_hurt's and so on. Now, the first point doesn't look really hard, it's all about calculating the right origin for the place. The fourth point is probably the easiest one. However, the second one is a lot harder. I imagine that I can place some kind of model at a specific origin so it would look like a switch and place 2 triggers, 1 around it and 1 at a desired spawn location, but then the switch itself would not be solid. So I wanted to ask you guys if there's a way to make it solid (well, afaik, it would require a solid brush to be built around the model) or an another way to make a spawner. Finally, I have absolutely no idea on how to get the 3rd point done. A completely another way of making such a mod is doing all of this stuff in GTK, which would make it a lot easier, but, on the other hand, I'd have to refit all the textures and place all of the light entities again by trial and error. Plus all of the players would have to DL the plugin. So I'm really not up to this path. All in all, a helping from your side will be much appreciated P.S. Additional info can be found here. Link to comment
Cerez Posted May 16, 2016 Share Posted May 16, 2016 If you're looking to add solid map objects, GTKRadiant is the way to go without question. You can tell your current position (co-ordinates) in-game with the command "viewpos" in the console. That, in combination with "noclip", should help you with placing objects accurately on a map in ENT modding without having to look at the map in GTKRadiant. Link to comment
Chemist Posted May 16, 2016 Author Share Posted May 16, 2016 If you're looking to add solid map objects, GTKRadiant is the way to go without question.Are you sure Radiant is the only way? I'm 100% sure that there are entity mods with solid switches for the spawners, I've even got a video, have a look: Link to comment
Cerez Posted May 16, 2016 Share Posted May 16, 2016 Are you sure Radiant is the only way? I'm 100% sure that there are entity mods with solid switches for the spawners, I've even got a video, have a look: https://youtu.be/LGe_IfXQGXo You can add any object you like (or most, anyway), but, as far as I know, you can't change their appearance to something that isn't already in the map, and I think -- though I may be wrong on this -- the only way to make them solid is to make them an active object, which is not easy on the memory. For already active objects (like vehicles and NPCs) this is not an issue, but when it comes to building on a map, GTKRadiant is the better way to go. Link to comment
Solution Tx606 Posted May 16, 2016 Solution Share Posted May 16, 2016 About entity modding and GTKRadiant:Generally you don't want to do this. There's a way to add solid objects (brushes) or resize them with GTK for entity modding. But it often doesn't work ideally. You can even remove collision, but it will give you a somewhat laggy effect when moving through said brushes because the client thinks it's still solid, prediction yada yada. There is a way to add or stretch brushes, but I only have found it to be good for walls and ceilings, not for floors/things to stand on. Your client will think it is still falling. Generally I suggest you forget all about GTK if you wish to do entity modding, as it generally is a somewhat messy method. To me it seems like you're new to this thing. Did you read any tutorials? There should be a few on JKHub. So anyway, you need to know how to:- Extract the entities- Modify the entities- Compile and put .bsp in a PK3- Or if you're using an OpenJK server just upload the .ent fileThere are plenty of guides which explain how to do the above.https://jkhub.org/tutorials/article/81-another-entity-modding-tutorial/https://jkhub.org/tutorials/article/50-adding-entities-to-maps-after-compiling-editing-base-maps/ To your questions, OP:1. This should be very easy. In the t2_trip entities, find the existing info_player_start and simply move it to whatever origin you want. Yes, you can use /viewpos to get your origin, but it uses the camera, I believe. In JA+ you could use /amorigin or in Lugormod you could use /where as a command to see your clients origin. These commands should also show you the angle which you're looking at.So you could also add an angle key to whatever direction you want people to be facing such as "angle" "180" I recommend adding multiple spawnpoints to avoid people telefragging each other all the time.NOTE: I believe in MP, info_player_start is exactly the same as info_player_deathmatch. 2. Depends on what exactly you want. The NPC_spawner entity can have an option that automatically respawns said vehicle when it gets destroyed.You could also add something like a trigger with a use-flag targetting an NPC_spawner to spawn the vehicle. About the video you linked: they're using health power converters. This is generally used for models because we don't have a convenient misc_model_breakable entity like lugormod does. Note how their crosshair turns yellow with the dead tauntaun on the floor at 1:26 or so. It's likely the same deal at other moments. They could also be using func_statics with model2 to show the models, and then put other bmodels (func_statics) inside the model to make it appear as solid. Or they could be using the blockwall feature from JA+. So, on how to make a button and make it solid: you need to use the misc_model_health_power_converter entity. This is used for most if not all of the models people add in entity modding. It's normally used for those healing consoles that you press USE on and it gives you back health. Obviously you don't want this, so you make a very simple icarus script that sets set_player_usable to false. Save and compile that script, and include it on that entity as the spawnscript. It'd end up looking something like this:{"classname" "misc_model_health_power_converter""model" "models/map_objects/factory/f_con2.md3""spawnscript" "no-use""origin" "123 123 123"} The hitbox for that is generally not perfect however. Place it flat on the floor and you might be able to step on the button and it'd look somewhat odd. Generally I make it float a bit over the ground so noone notices it, or use a button on a wall or something. Alternatively you could move some bmodels inside the model so it would appears as solid, but that all depends on having a small bmodel available in the map you're using. [EDIT] To clarify - that only gives you a button (model) obviously. You will need to get a trigger that spawns an npc/vehicle. Most guides out there explain how to move bmodels, which is what you'll need to do to get a trigger to whatever place you want to get it.[/EDIT] More complex designs are also possible, but would require icarus scripting and can be very complex if you're new to it. For example on my vjun map here's something I came up with: video.However I'd refrain from attempting something so complex for the moment 3. Unsure what you mean. There is no magic command to magically texture something which has no texture.Yes, you could technically cover things up with models (health converters or func_statics with model2 key), but the process would be difficult and use up many entities. Not saying it can't be done, but T2_Trip is too large to cover all of those areas up. 4. This should be easy enough. Simply dig through the entities and remove what you need to remove. I can't access the JAWA page you linked, by the way. My explainations might be a little vague, but I feel like you should try and inform yourself a bit more OP, you could probably get most of the things you want to do easily. Let me know if you need more help. Chemist likes this Link to comment
Chemist Posted May 16, 2016 Author Share Posted May 16, 2016 Thanks for your answer @@Tx606! I've spent whole day reading entity modding tutorials and Moondog's Icarus scripting tutorial and I feel like I understand that quite good right now.Now, I've managed to place the model buttons and scripts for them just fine, but another problem has shown up: According to another Moondog's tutorial, to place a trigger you'd need to clone one of the existing brushes, move it to coordinates needed (using Boba Fett's UU for calculating them !brushmoveorigin *x, but not using /viewpos to get them) and, well, set its keys up like a trigger. Now, I've thought I've handled this just fine. To test, I've selected a small breakable model, determined its bmodel number and moved it to desired calculated coordinates. When I compiled everything and got to the map, the cloned brush was never to be found! Trust me, I've triple-checked this, so I have to ask you - is there anything else I need to know about cloning brushes for setting up triggers?You've been of great help so far, and I hate to ask, but I'd appreciate a little more of it Link to comment
Tx606 Posted May 16, 2016 Share Posted May 16, 2016 When I mod maps, I usually host a local lugormod server. I don't use any of the lugormod entities/features at all, except for the commands to reload the entities. In other words, I can conveniently edit the entity file, and reload all of them (/mapents load default) to see 'live' changes without needing to re-compile or restart maps. This can usually speed things up. It's just something I recommend to most people. Just keep in mind that some features are present on LMD that aren't on other mods, and some things may work there that can be absolutely broken on Base/JA+/JA++. It's just a tip, so use whatever method you prefer obviously. As for you not seeing the change you made, that could be harder to narrow down. Can you show the entity that you added?Without seeing anything from your end, all I can do is guess. A few quick thoughts:- Compiling went wrong or didn't include the (updated) .ent file. Check your .bsp and search if your added entities are there.- Did you include the model of the bmodel in your entity?- If you rotate a bmodel, you need a different origin (!brushmrorigin in UU) but that doesn't apply for triggers, only func_* entities.- You didn't pack the PK3 correctly or didn't set the folder structure correctly. .bsp should be located in the maps folder.- Doesn't overwrite the assets (or other PK3s). Has to at least be alphabetically after assets0.pk3 (z_YourPK3Name.pk3 should be fine). This is very unlikely. Link to comment
Chemist Posted May 17, 2016 Author Share Posted May 17, 2016 - Compiling went wrong or didn't include the (updated) .ent file. Check your .bsp and search if your added entities are there. checked.- Did you include the model of the bmodel in your entity? checked. Below is the full code of my test entity.- If you rotate a bmodel, you need a different origin (!brushmrorigin in UU) but that doesn't apply for triggers, only func_* entities. - Not sure what do you mean. My test entity originally was a func_breakable, so I need to use !brushmrorigin instead? I think you meant the final entity, which is, of course, trigger_multiple.- You didn't pack the PK3 correctly or didn't set the folder structure correctly. .bsp should be located in the maps folder. checked.- Doesn't overwrite the assets (or other PK3s). Has to at least be alphabetically after assets0.pk3 (z_YourPK3Name.pk3 should be fine). checked. Below is the code for my entity. { "origin" "20770 29637 188" "wait" "1" "spawnflags" "262" "classname" "trigger_multiple" "target" "test" "model" "*53" "angle" "90" } Link to comment
Tx606 Posted May 17, 2016 Share Posted May 17, 2016 What I meant with the rotating part was, that if you have a func_ entity that you end up rotating to another angle, you'll need different coordinates from the usual !brushmoveorigin, which is where !brushmrorigin comes in. However you're still using a trigger so again, ignore all of that. Triggers don't get rotated obviously, and the angle key is used for the facing flag that is part of the entity itself. Again, never mind, this should be all good then. Based on what I can see from your entity, it looks good. Note that the multiple spawnflag has always been broken from what I believe, but it shouldn't matter.I'm also assuming you've tried to press the actual button in a 360 radius, right? Perhaps you were facing the wrong direction. I took a quick look ingame and this is where your entity ends up ingame for me: https://jkhub.org/images/yvOWmgF.jpgThis is right outside of the large arena in the center of the map, so I'm kind of guessing this is where you intend it to be.Are you absolutely sure your PK3 is set up correctly? Is your server set up correctly and the PK3 included in the base (or mod) folder? Perhaps you should post your file so I can have a look. Chemist likes this Link to comment
Chemist Posted May 17, 2016 Author Share Posted May 17, 2016 Thanks again, I think I didn't find it b/c it is around 2 metres away from my desired location, so I guess you've already helped me out with this issue Here's a link to my file anyway: clickNow, there's one more question till everything is settled. When I pressed that switch, it gave me out a bunch of errors about how it couldn't spawn the desired NPC. I've fixed it and now it doesn't give me any error messages, but rather just doesn't spawn anything. I've checked it with GTKRadiant and it turns out the spawner entity itself is located just where it is intended to be. Perhaps the spawner entity needs bmodel to be specifies as well? Link to comment
Tx606 Posted May 17, 2016 Share Posted May 17, 2016 If you're trying to spawn a vehicle like a swoop, use NPC_Vehicle. I believe all you need is classname, origin, targetname, and NPC_type for this to work. EDIT: took a quick look at your file, whats the purpose of set ( "SET_PARM1", $get( STRING, "SET_PARM1" )$ ); and the parm1 you're using on your button model?For me the changes seem to work ingame on Lugormod, by the way. Your button model is just a bit in the wrong place and not angled the right way, but the trigger+spawning ent worked there.Try clearing out your base folder of other .pk3s to ensure that whatever issue you have isn't caused by extra vehicles and such. EDIT2:Your BSP is called t2_mod.bsp - why is this? EDIT3:Okay, took another look. Try renaming NPC_vehicle to NPC_Vehicle. I believe it's case sensitive. Lugormod may have fixed this with their mod, but base/JA+/JA++ might still have problems with it. Chemist likes this Link to comment
Chemist Posted May 17, 2016 Author Share Posted May 17, 2016 Thanks a lot! It really was case sensitive! Wow, I'd never though, thanks a million! In fact, thanks for all your time you've spent to help me out with this The whole thing is working just fine and now all I have to do is to slightly reposition the trigger and do the same thing in all the places. My BSP is called t2_mod b/c it was originally named t2_trip and I'm making a mod to it It's just a temp name, I'll give it a better one when I finish the work.This line in the scripts is used to rescale the whole model so it wouldn't be partially unsolid. In fact, it sets the rescale key to "parm1" and if you look at my .bsp file, there is a line in my switch-looking model entry: "parm1" "1.75", which sets it's size to 175% of the original. The script is badly written though. Should have been either ( "SET_SCALE", $get( STRING, "SET_PARM1" )$ ); or ( "SET_PARM1", $get( STRING, "SET_SCALE" )$ ); not sure atm. Link to comment
Raz0r Posted May 17, 2016 Share Posted May 17, 2016 Better approach to recompiling and distributing a BSP (with the same name or renamed): Just provide your t2_trip.ent file to the server. Only works with OpenJK Cerez likes this Link to comment
Chemist Posted May 17, 2016 Author Share Posted May 17, 2016 Well, it's going to be used on (JAWA) server (well, I hope so xD), and, as it runs JA+, I'd have to compile it. Besides, it doesn't really make any additional problems. Compiling takes me around 5-10 seconds Link to comment
Tx606 Posted May 17, 2016 Share Posted May 17, 2016 In fact, it sets the rescale key to "parm1" and if you look at my .bsp file, there is a line in my switch-looking model entry: "parm1" "1.75", which sets it's size to 175% of the original. The script is badly written though. Should have been either ( "SET_SCALE", $get( STRING, "SET_PARM1" )$ ); or ( "SET_PARM1", $get( STRING, "SET_SCALE" )$ ); not sure atm. Yeah, I know of the method and use it myself. However it should look like:set ( /*@SET_TYPES*/ "SET_SCALE", $get( FLOAT, "SET_PARM1")$ ); edit: ignore the set types part obviously, its just a BehavEd thing, but you should use float and get the value from parm1, is what I'm trying to point out. Link to comment
Chemist Posted May 17, 2016 Author Share Posted May 17, 2016 Hmm, thanks for another hint there. I've selected SET_PARM1 in the drop box and clicked Get! and it gave me out STRING, although I've wondered myself why's that, judging by how SET_SCALE is located in floats. Link to comment
Omicron Posted May 17, 2016 Share Posted May 17, 2016 Well, it's going to be used on (JAWA) server (well, I hope so xD), and, as it runs JA+, I'd have to compile it. Besides, it doesn't really make any additional problems. Compiling takes me around 5-10 seconds Doesn't matter that the server runs JA+; it's using OpenJK. Cerez likes this Link to comment
Chemist Posted May 18, 2016 Author Share Posted May 18, 2016 Ah, I've somehow mistaken OJK for OJP Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now