-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract transfrom from a DB model only if is selected by the user #56
Conversation
|
bd11516
to
638555d
Compare
The model being existent in the cache according to the log: 364 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl] = {}
365 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Size"] = 2
366 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"] = {}
367 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1] = {}
368 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["O"] = {}
369 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["O"][1] = 0
370 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["O"][2] = 0
371 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["O"][3] = 0
372 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["O"]["Slot"] = "!1"
373 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["A"] = {}
374 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["A"][1] = -0
375 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["A"][2] = 90
376 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["A"][3] = 0
377 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["A"]["Slot"] = "!1"
378 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["P"] = {}
379 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["P"][1] = 0
380 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["P"][2] = 0
381 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][1]["P"][3] = 0
382 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2] = {}
383 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["O"] = {}
384 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["O"][1] = -7.6932037700317e-06
385 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["O"][2] = 175.99998474121
386 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["O"][3] = 0
387 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["O"]["Slot"] = "!2"
388 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["A"] = {}
389 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["A"][1] = -0
390 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["A"][2] = -90
391 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["A"][3] = 0
392 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["A"]["Slot"] = "!2"
393 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["P"] = {}
394 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["P"][1] = -7.6932037700317e-06
395 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["P"][2] = 175.99998474121
396 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Offs"][2]["P"][3] = 0
397 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Type"] = "Plarail"
398 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Unit"] = "NULL"
399 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Name"] = "AJ-01 Station"
400 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] CacheQueryPiece: tCache[models/ron/plarail/scenery/aj01.mdl]["Slot"] = "models/ron/plarail/scenery/aj01.mdl"
401 [24-03-27 18:59:32] SERVER > TRACKASSEMBLY [LUA] IsModel: Deep >> {true}|true|models/ron/plarail/scenery/aj01.mdl| |
Hey, @Grocel I think we are ready with this. Could you please ask @marchc1 to test this branch. If it works I will merge it. 360 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] MakeEntityNone: Create {-1}|models/ron/plarail/tracks/misc/ar01.mdl|
361 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] GetTransformOA: Extract {1}|0.000000 0.000000 0.000000|-0.000 -90.000 0.000|
362 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] LocatePOA: Origin transform from model {1}|1|0,0,0|
363 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] GetTransformOA: Extract {1}|0.000000 0.000000 0.000000|-0.000 -90.000 0.000|
364 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] LocatePOA: Angle transform from model {1}|1|-0,-90,0|
365 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] GetTransformOA: Extract {2}|-0.000008 175.999985 0.000000|-0.000 90.000 0.000|
366 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] LocatePOA: Origin transform from model {2}|2|-7.6932037700317e-06,175.99998474121,0|
367 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] GetTransformOA: Extract {2}|-0.000008 175.999985 0.000000|-0.000 90.000 0.000|
368 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] LocatePOA: Angle transform from model {2}|2|-0,90,0|
369 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] GetCacheSpawn: Allocate {[Sk$Bh]Trick or treat KID!}
370 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] GetCacheRadius: Allocate <[Sk$Bh]Trick or treat KID!>
371 [24-03-27 20:54:02] CLIENT > TRACKASSEMBLY [LUA] TOOL.ElevateGhost: (false) <2.2499997615814>
372 [24-03-27 20:54:22] CLIENT > TRACKASSEMBLY [LUA] BIND_PRESS: (+attack) Skipped
328 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] IsModel: File >> {nil}|true|models/ron/plarail/tracks/misc/ar01.mdl|
329 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] MakeEntityNone: Create {169}|models/ron/plarail/tracks/misc/ar01.mdl|
330 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] GetTransformOA: Extract {1}|0.000000 0.000000 0.000000|-0.000 -90.000 0.000|
331 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] LocatePOA: Origin transform from model {1}|1|0,0,0|
332 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] GetTransformOA: Extract {1}|0.000000 0.000000 0.000000|-0.000 -90.000 0.000|
333 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] LocatePOA: Angle transform from model {1}|1|-0,-90,0|
334 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] GetTransformOA: Extract {2}|-0.000008 175.999985 0.000000|-0.000 90.000 0.000|
335 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] LocatePOA: Origin transform from model {2}|2|-7.6932037700317e-06,175.99998474121,0|
336 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] GetTransformOA: Extract {2}|-0.000008 175.999985 0.000000|-0.000 90.000 0.000|
337 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] LocatePOA: Angle transform from model {2}|2|-0,90,0|
338 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] GetPlayerSpot: Cached {[Sk$Bh]Trick or treat KID!}
339 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] GetCacheSpawn: Allocate {[Sk$Bh]Trick or treat KID!}
340 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] IsModel: Deep >> {true}|true|models/ron/plarail/tracks/misc/ar01.mdl|
341 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] SetPosBound: (OFF) Skip
342 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] AttachBodyGroups: SetBodygroup {1}|0|0|0|
343 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] AttachBodyGroups: Success {0}
344 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] CacheQueryAdditions: Record not located
345 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] AttachAdditions: Model skip <models/ron/plarail/tracks/misc/ar01.mdl>
346 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] MakePiece: {Entity [170][gmod_plarail_ar01]}|models/ron/plarail/tracks/misc/ar01.mdl|
347 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] ApplyPhysicalSettings: {Entity [170][gmod_plarail_ar01]}|false|true|true|metal|
348 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] ApplyPhysicalSettings: Success
349 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] ApplyPhysicalAnchor: {Entity [170][gmod_plarail_ar01]}|nil|false|true|false|0|
350 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] ApplyPhysicalAnchor: NoCollide base invalid {nil}|nil|
351 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] ApplyPhysicalAnchor: Success
352 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] TOOL.LeftClick: (Spawn) Success
353 [24-03-27 20:54:22] SERVER > TRACKASSEMBLY [LUA] DELAY_ACTION: Freeze:[true] |
Nice, that you got it done. 👍
|
Hey @Grocel Generally it is OK to have one I can confirm. Precache is used only when the model is about to be ghosted or spanned. The algorithm is pretty much the following:
I must test also the ghosting on all the modes. When OK the spawn will too as it also uses |
Looks fine for me then. |
IsString you removed was for |
Just noticed... My bad.. Must return this ... |
84253e8
to
5e28078
Compare
Must test this in LUA and SQL modes for ghosting and spawning before merging. But I am 95% sure it will be OK |
Added: Selection search point slot being taken with priority Updated: Spawn margin sends message to the user
Hi, @Grocel just validated all the cases
|
The custom piece (in
|
Ah... I see in case the attachment is invalid thank you ! |
Hey, @Grocel Add a custom DSV by attaching it to the DSV list
|
Everything is validated. Thanks for testing it in this specific case!
|
Fixed in c6bbdc4 |
Nice. Did you check if the angle can have this issue too? Does the Did you also notice my |
Yep, quite neat thing you have found there indeed ;) The |
Good example for this is PHX single unit track. PIECES:Record({"models/props_phx/trains/tracks/track_single.mdl", "#", "#", 1, "-0.327,-61.529,8.714", " 15.45284,0,12.548828"})
PIECES:Record({"models/props_phx/trains/tracks/track_single.mdl", "#", "#", 2, "-0.327, 61.529,8.714", "-16.09597,0,12.548828", "0,180,0"}) |
Ah, I see. This totally makes sense, because the origin could be a way out of reach for the player to hit without leaving the hit object. Just for clarification:
The description below says, that attachments would be supported at least for angles ( |
Yeah.. Exactly
|
|
|
|
Hello, @Grocel Added in: 4fc6604 Tested with cartesian products for point being TRACKASSEMBLY_PIECES "models/props_lab/blastdoor001b.mdl" "POA Test" "Door" 7 "!NULL" "!test1" "0,90,0" "NULL"
TRACKASSEMBLY_PIECES "models/props_lab/blastdoor001b.mdl" "POA Test" "Door" 8 "!NULL" "!1,2,3" "0,-90,0" "NULL"
TRACKASSEMBLY_PIECES "models/props_lab/blastdoor001b.mdl" "POA Test" "Door" 9 "!NULL" "1,2,3" "0,90,0" "NULL"
TRACKASSEMBLY_PIECES "models/props_lab/blastdoor001b.mdl" "POA Test" "Door" 10 "!4,5,6" "!test1" "0,-90,0" "NULL"
TRACKASSEMBLY_PIECES "models/props_lab/blastdoor001b.mdl" "POA Test" "Door" 11 "!4,5,6" "!1,2,3" "0,90,0" "NULL"
TRACKASSEMBLY_PIECES "models/props_lab/blastdoor001b.mdl" "POA Test" "Door" 12 "!4,5,6" "1,2,3" "0,-90,0" "NULL" LocatePOA: Origin transform from spawn {7}|!test1|0,0,0|
LocatePOA: Point transform from spawn {7}|!NULL|0,0,0|
LocatePOA: Origin transform from spawn {8}|!1,2,3|1,2,3|
LocatePOA: Point transform from spawn {8}|!NULL|1,2,3|
LocatePOA: Point transform from spawn {9}|!NULL|1,2,3|
LocatePOA: Origin transform from spawn {10}|!test1|0,0,0|
LocatePOA: Point transform from spawn {10}|!4,5,6|4,5,6|
LocatePOA: Origin transform from spawn {11}|!1,2,3|1,2,3|
LocatePOA: Point transform from spawn {11}|!4,5,6|4,5,6|
LocatePOA: Point transform from spawn {12}|!4,5,6|4,5,6| |
Currently TA can still hit the limit of the internally stored models in the source engine via calling
util.IsValidModel
directly or triggering aENT:SetModel
routine that later fills a space in this array too. When registering transform we haveThis caches a transform POA dummy entity which is used to extract the parameters for model
X
, however everyENT:SetModel
call on this entity fills one slot in the internal strings table of 4K limitPossible resolution: Adjust
asmlib.GetNormalSpawn
or some of its internal routines ( most likelyLocatePOA
). The idea is that if a model is chosen from the user it will be ghosted. So if it does, the entity must be spawned and a slot will be filled anyway. In this case the transform temporary entity can be used for extracting the position and angle. Currently TA inLua
database mode will call the extraction for every model in the database parametrized to use transform attachments with notation!<attachment_id>
for points, origins and angles (POA
). TheDB
cache must obtain a KV pair that stores the current initialization status if the picked model and to extract it only if needed a.k.a. when this internal flag isfalse
( attachment not yet loaded ). Loading the attachment will trigger this flag totrue
and one model will be inserted in the internal game model cache.