Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
https://raw.githubusercontent.com/jusito/ttt_entity_replace/master/lua/autorun/server/jusito_ttt_entity_replace.lua
The script hooks into entity creation, because this indeed is to early to process it directly the processing is delayed for one tick. According to the docs this should be the way to go but maybe if a second mod modifies it in an clone/remove old one and both mods removing the same entity but creating a new one. In this case this would trigger 2 entity creations and both should be visible. But if i got you, there is a weapon with an illegal class?
Spawning a weapon for a player, if you look at the log (even without debug) you should see "spawning [weapon] and ammo [ammo]" if ammo and weapon identical, this could explain the behavior. Maybe in very weird rare cases if the playercount changes within a tick, probably during increase could also be something.
For replacing, create only called once: https://github.com/jusito/ttt_entity_replace/blob/master/lua/autorun/server/jusito_ttt_entity_replace.lua#L315
Maybe the remove is failing, the log output should show you what weapon is replaced with what. If you get both weapons on the ground, removing is the cause, if you get two weapons of the replaced one its either conflict with another mod or gm itself. If removing is failing, maybe just calling it a second time after one additional tick or default just one tick later. For the second, I have no idea ad hoc.
source
weapon_zm_revolver
target
tfa_csgo_incen
tfa_csgo_flash
tfa_csgo_frag
tfa_csgo_smoke
tfa_csgo_sonarbomb
tfa_csgo_medishot
tfa_fas2_ifak
end
1. Starting gm_flatgrass, no script errors (if errors, there is not even one mapping rule in config)
2. jusito_list - working (commands are printed)
3. jusito_spawn Jason weapon_medkit - working (got a medkit, if this is not working you may have not the config from above)
4. jusito_weapons_list - not working here, sad but shouldnt break it
5. placing with ream script "random weapon" 5x (shotguns there)
6. changing config.txt source ttt_random_weapon target weapon_medkit end (newline seperatet, you dont need to restart anything just replace)
7. calling jusito_reload which reloads the config now
8. placing from now "random weapon" result in a medpack
9. calling jusito_replace_entities replaces all existing shotguns with medkits
I tried this, can you repeat it if its working for you?
- I tried it in sandbox mode
- singleplayer
- using TTT weapon placer
- lua not placed by hand only workshop subscription
- config.txt contains 1 rule "source nothing target nothing end" (newline seperated, otherwise script doesnt work, the rule does just nothing because there is no ent with classname "nothing")
If you are using the mod on a server and the gamemode is TTT, please try this:
jusito_weapons_list => should also list your *bo* weapons (even if not the normal weapons should be removed because it tries to spawn the new one)
jusito_spawn YourIngameName weapon_ttt_glock
You should get ttt_bo_asp and no other weapon, which means the config and mod is loaded.
If thats not the case, you could activate debug mode in line 3 (local DEBUG_MODE = true). If you cant I can add an option in console for it. This will provide a lot more details.
My problem is, I don't know how to place spawns in gm_flatgrass but normal replacing is working for me.
For both used hooks I tested it with my 2 test maps on a server with TTT gamemode, kakariko(which spawns later) and yacht_alpha2(which spawns weapons on map load). Both working with example_fas2, so at least its not an update which broke it. Hook according to the API is still fine for this. Replacing ttt_random_weapons works for me in this setup. So I guess it's something I haven't thought about yet.
The config you provides looks fine for me, but I cant test it because I dont have the weapon pack - and cant find it. But even with every entity should be processed on every creation. If the source is fine the ent should be replaced, even if target isn't valid - thats intended.