RancorSNP Posted October 23, 2012 Posted October 23, 2012 Hi, lets just treat this as a modding question. I spend ages playing with JKA, JKA mods , JKA coding (this is actually fun to read even if you don't know C language) but some things i have never figured out ad they always bugged me. This was to be my best achievement ever, but I just can't make this out! Its forth, maybe fiftht time when I try and try and I fail. Does any of you know how to add spawn flags in game? (Don't know what I mean? Here's an explanation)there are a lot of spawns defined, they all have flags that use their full (or partial if you want) potentialFor eg. we will use a camera : /*QUAKED misc_camera (0 0 1) (-8 -8 -12) (8 8 16) VULNERABLEA model in the world that can be used by the player to look through it's viewpoint There will be a video overlay instead of the regular HUD and the FOV will be wider VULNERABLE - allow camera to be destroyed "target" - camera will remain pointed at this entity (if it's a train or some other moving object, it will keep following it)"target2" - when player is in this camera and hits the use button, it will cycle to this next camera (if no target2, returns to normal view )"target3" - thing to use when player enters this camera view"target4" - thing to use when player leaves this camera view"closetarget" - (sigh...) yet another target, fired this when it's destroyed"wait" - how long to wait between being used (default 0.5)*/ As you can see there is only one Vulnerable flag. and only 6 minor options, all of them you can (probably) easily add using GTK radiant. But how to add flags, of specified options using spawn command?I tried many many way but I always get no such spawn function or just default set entity. PLEASE HELP!
mrwonko Posted October 23, 2012 Posted October 23, 2012 I'm not entirely sure what you're trying to accomplish and what you've tried to accomplish it/how it does not work. You're trying to add new Spawnflags to an entity - like, say, an invincible flag that turns npcs invincible on spawn? And you've done it by editing the part you've quoted there? Are you working in the sourcecode or the mp_entities.def? The latter is necessary to get it to show up in radiant, but you'll also have to code the changes you want in, and the part you've quoted is only the comment describing how it's supposed to work. But just as you can't make a coffee machine make tea by labeling it "tea machine", you can't change a function by changing the comment describing it. I suggest you take a look at how it works - there's lots of entities, after all - or wait for people who know more about the specifics of Jedi Academy coding than me.
RancorSNP Posted October 23, 2012 Author Posted October 23, 2012 No that's not what I mean. Probably "adding" in the main title deceived you.I want to use already existing flags like "STARTOFF OPEN NO_KNOCKBACK ONE_SHOT NO_IMPACT" etc using ingame spawn command.
eezstreet Posted October 23, 2012 Posted October 23, 2012 All you have to do is pass the spawnflags (as well as other map related things) into level.spawnVars, and then increment level.numSpawnVars as well. So basically your command should look like this: void Cmd_Spawn_f( gentity_t *ent ) { gentity_t *spawnedEnt; // ...some kind of positioning crap and stuff here strcpy(level.spawnVars[0][0], "spawnflags"); strcpy(level.spawnVars[0][1], va("%s", [b]your_spawn_flags_here[/b])); level.numSpawnVars++; G_Spawn(spawnedEnt); } Fighter likes this
therfiles Posted October 24, 2012 Posted October 24, 2012 I'm confused. Is that above code already implemented into the game? I know what he is asking, in fact, I have asked about it before. Using the SPAWN command (I.e. Spawn Misc_Exploding_Crate) is practically useless, because, in sp, spawing an fx_runner or ref_tag is unusable cause I can't add an fx file to use/target name to use. RancorSNP likes this
mrwonko Posted October 24, 2012 Posted October 24, 2012 So this is about console commands for map (entity) creation in singleplayer? I didn't even know that was possible (beyond npc spawning), but I suggest you simply edit the bsp file (or rather, edit the entity part and do an -onlyents compile).
RancorSNP Posted October 24, 2012 Author Posted October 24, 2012 I can't make radiant work on my pc (win 7) so I cant edit bsp files, as far as I know at least.Spawn entity command has incredible potential, and with additon of little scrypting you can do just any scenario come true.Npc spawn id name would get useless too, cos there are a lot of entity npc's spawning them. Using spawn ent, allows you to program unique behavior for every one of them.
minilogoguy18 Posted October 24, 2012 Posted October 24, 2012 Lugormod is the only way I know of doing what you want which is real time editing of the map in game, everything but the brushes can be changed. Multiplayer only but you can load a sp map if you want but npcs don't behave properly on the jamp engine.
eezstreet Posted October 24, 2012 Posted October 24, 2012 idd, the spawn command in sp is so lacking. The above code should work for MP, with the obvious modifications needed. If I ever RE the spawn command function fully, I'll let you know (I have the address for it located, just a matter of hooking it as a JAMod or whatever plugin) RancorSNP and therfiles like this
mrwonko Posted October 24, 2012 Posted October 24, 2012 I can't make radiant work on my pc (win 7) so I cant edit bsp files, as far as I know at least.Use 1.6.
MUG Posted October 24, 2012 Posted October 24, 2012 I can't make radiant work on my pc (win 7) so I cant edit bsp files, as far as I know at least.Run it as administrator and under properties on your shortcut select disable visual themes.
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