Jump to content

Adding spawn flags in game? (entities)


Recommended Posts

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) potential

For eg. we will use a camera :

 

 

/*QUAKED misc_camera (0 0 1) (-8 -8 -12) (8 8 16) VULNERABLE

A 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!

Link to comment

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.

Link to comment

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
Link to comment

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
Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...