ET_MOVER Description key


(CoD4Fun) #1

is there anybody who knows where i can find the description key of script_movers in the source code ? for example in goldrush the tank has a description of ‘jagdpanther’. where in the source can i find it ? gentity_t struct doesnt have something called ‘description’ or anything else. or maybe i didnt see, but i watched now 3 times and didnt see anything with a name 'description" or something. maybe it is just renamed key of gentity_t, anybody knows ?


(crapshoot) #2

look in SP_script_mover and / or search for CS_SCRIPT_MOVER_NAMES


(CoD4Fun) #3

meh. i somehow dont manage to figure it out because a lot of the involved functions end up in the yet unrelease et engine, syscalls. i think the most relevant piece of code is this, taken from SP_script_mover(gentity_t *ent):

		if( G_SpawnString( "description", "", &s ) ) {
			trap_GetConfigstring( CS_SCRIPT_MOVER_NAMES, cs, sizeof(cs) );
			Info_SetValueForKey( cs, va("%i",ent-g_entities), s );
			trap_SetConfigstring( CS_SCRIPT_MOVER_NAMES, cs );
		}

what happens here O_O two of these functions end up in syscall. basically it says: if that description key is set go into that if statement ?

i dont really understand what G_SpawnString is doing, look here how its defined:

#define		G_SpawnString(		key, def, out ) G_SpawnStringExt	( key, def, out, __FILE__, __LINE__ )

then:

trap_GetConfigstring( CS_SCRIPT_MOVER_NAMES, cs, sizeof(cs) );
trap_SetConfigstring( CS_SCRIPT_MOVER_NAMES, cs );

end up in syscalls like i said. and therefore i also cant really follow what

Info_SetValueForKey( cs, va("%i",ent-g_entities), s );

is doing.

with who i have to go in bed to get that engine source :smiley:

and sorry for sounding stupid. maybe those kind of questions dont belong here, maybe some unwritten law or something, dunno. basically i only want to set that description key, as i have something fun in mind :smiley:

edit_ the entity i want to assign that description key is not a script_mover, it is just a very fake/hacked gentity_t struct.


(crapshoot) #4

it’s getting the value from the description “key” on the entity and then setting it in the config string so the clients can see it basically. just alter that Info_SetValueForKey call if you want immediate results :

Info_SetValueForKey( cs, va("%i",ent-g_entities), "CoD4Fun" );

then when looking at the tank on grush for example you would be seeing “CoD4Fun” instead of the description keys value (‘Jagdpanther’). of course you would want to adjust your function for your specific purpose, but this should at least show you what needs to be changed.

edit: a little more detail about what that Info_SetValueForKey function is doing

the game has a separate config string specifically for mover names ( CS_SCRIPT_MOVER_NAMES ) and it consists of a bunch of key / value pairs. the key is the entity number and the value is the name. so, when a client moves their cursor to point at an entity, the client does a lookup for the entity number it is pointing at and draws the value for that key on the screen. ent-g_entities in this function is the actual entity number of whatever entity was passed to SP_script_mover.


(CoD4Fun) #5

hey it works :slight_smile: i got first results. from here not long anymore.

greetz