20.void(
entity this) target_spawn_spawnfunc;
28 _setmodel(
this, this.
model);
38 float i, n, valuefieldpos;
39 string key, value, valuefield, valueoffset, valueoffsetrandom;
45 for(i = 0; i < n-1; i += 2)
59 LOG_INFO(
"target_spawn: invalid/unknown entity key ", key,
" specified, ignored!");
77 if(valuefieldpos != -1)
79 valueoffset =
substring(value, valuefieldpos + 1,
strlen(value) - valuefieldpos - 1);
80 value =
substring(value, 0, valuefieldpos);
83 valuefieldpos =
strstrofs(valueoffset,
"+", 0);
84 valueoffsetrandom =
"";
85 if(valuefieldpos != -1)
87 valueoffsetrandom =
substring(valueoffset, valuefieldpos + 1,
strlen(valueoffset) - valuefieldpos - 1);
88 valueoffset =
substring(valueoffset, 0, valuefieldpos);
93 if(valuefieldpos != -1)
95 valuefield =
substring(value, valuefieldpos + 1,
strlen(value) - valuefieldpos - 1);
96 value =
substring(value, 0, valuefieldpos);
104 else if(value ==
"activator")
109 else if(value ==
"other")
114 else if(value ==
"pusher")
116 if(
time < act.pushltime)
117 valueent = act.pusher;
122 else if(value ==
"target")
127 else if(value ==
"killtarget")
132 else if(value ==
"target2")
137 else if(value ==
"target3")
142 else if(value ==
"target4")
147 else if(value ==
"time")
154 LOG_INFO(
"target_spawn: invalid/unknown variable replacement ", value,
" specified, ignored!");
167 LOG_INFO(
"target_spawn: try to get a field of a non-entity, ignored!");
173 LOG_INFO(
"target_spawn: invalid/unknown entity key replacement ", valuefield,
" specified, ignored!");
176 value = getentityfieldstring(data2_x, valueent);
179 if(valueoffset !=
"")
184 value =
strcat(value, valueoffset);
193 LOG_INFO(
"target_spawn: only string, float and vector fields can do calculations, calculation ignored!");
198 if(valueoffsetrandom !=
"")
206 data2 =
stov(valueoffsetrandom);
210 LOG_INFO(
"target_spawn: only float and vector fields can do random calculations, calculation ignored!");
219 value =
strcat(
"target_spawn_helper", value);
222 e.target_spawn_spawnfunc(e);
230 value = strreplace(
"'",
"", value);
231 putentityfieldstring(data.x, e, value);
281 e.spawnfunc_checked =
true;
285 else if(this.
target ==
"*activator")
317 n = numentityfields();
318 for(i = 0; i < n; ++i)
320 fn = entityfieldname(i);
321 ft = entityfieldtype(i);
322 next = i *
'1 0 0' + ft *
'0 1 0' +
'0 0 1';
327 if(fn ==
"target_spawn_spawnfunc")
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define FOREACH_ENTITY_STRING(fld, match, body)
ERASEABLE string db_get(int db, string key)
ERASEABLE void db_put(int db, string key, string value)
float target_spawn_initialized
void target_spawn_helper_setsize(entity this)
void target_spawn_useon(entity e, entity this, entity actor, entity trigger)
void initialize_field_db()
float target_spawn_spawnfunc_field
void target_spawn_helper_setmodel(entity this)
void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, entity t2, entity t3, entity t4, entity act, entity trigger)
void target_spawn_use(entity this, entity actor, entity trigger)
void target_spawn_reset(entity this)
void target_spawn_spawnfirst(entity this)
bool target_spawn_cancreate(entity this)
entity target_spawn_activator
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void InitializeEntity(entity e, void(entity this) func, int order)