AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   More entity woes (https://forums.alliedmods.net/showthread.php?t=2972)

Mugwump 06-22-2004 13:46

More entity woes
 
As I posted in another thread I have been trying to create a dummy player entity like a wax figure, I have tried using similar code to that used in the sh_beyonder superhero as well as the code in the Ent Copying thread posted here earlier.

I have no problem with creating the entity, settings its attributes and its origin, in the case of the beyonder like example it does what it should, moves when I move, etc.My problem is no matter what I try the only model I can get to stick on the entity is the first counter-terrorist model.

All of the CS models are precached in plugin_precache().

If I explicitly try this:
entity_set_model(myentity, "models/player/terror/terror.mdl")

it either spawns the entity with no model (its not visible) or that first CT model appears.

I have also tried this approach:
entity_get_string(id, EV_SZ_model, arg, 63)
entity_set_string(myentity, EV_SZ_model, arg);

to copy the model I currently am using, it only displays that first CT model.

Anyone have any suggestions for what might be wrong or what I should try, this is getting frustrating.

Thanks,
Mugwump

AssKicR 06-22-2004 14:22

from the beyonder code

Code:
new model[32],modelchange[128] get_user_info(id,"model",model,31) format(modelchange,127,"models/player/%s/%s.mdl",model,model) client_print(id,print_chat,"You Spawned A Fake with model %s",model) //DEBUG MESSAGE entity_set_model(beyonder[id], modelchange)

Mugwump 06-22-2004 14:49

Yep, I tried that Asskickr. After trying and failing with so many deviations I tried a version with just your beyonder_makeil routine code and it would only spawn for me an invisible fake.... No idea what may be wrong. :(

Mugwump

AssKicR 06-22-2004 16:54

did you precache the models

Mugwump 06-22-2004 17:26

Yes, all models were pracached, I have this plugin_precache() routine:

public plugin_precache(){
precache_model("models/player/leet/leet.mdl")
precache_model("models/player/arctic/arctic.mdl")
precache_model("models/player/guerilla/guerilla.mdl")
precache_model("models/player/terror/terror.mdl")

precache_model("models/player/gign/gign.mdl")
precache_model("models/player/sas/sas.mdl")
precache_model("models/player/gsg9/gsg9.mdl")
precache_model("models/player/urban/urban.mdl")

precache_model("models/player/vip/vip.mdl")

return PLUGIN_CONTINUE

}

I am really confused on this one, I even tried your sh_beyonder.sma file verbatim and even that wouldn't produce the desired results ... :(

Mugwump

Ingram 06-22-2004 19:23

lol, u used my code from the ent copying thread?
thats the problem, :P

players have a lot more settings (settings for ent) i only included the ones to copy an object like a box (func_wall). bailopan pointed this out in the next post

i had a plugin to list all the settings for an ent u r looking at, but i didn't realize i had put it in my complied folder until after i complied and if anyone else has done this, it disappears lol. Anyways i got nothing better to do, so i guess i can remake this plugin

Mugwump 06-22-2004 20:19

jj, the thing of it is I had more luck when I used the code you posted as the basic idea and modified for my needs from there, at least then I could get entity to spawn and mimic my actions, though it always spawned with the same CT model. When I tried to use an alternative approach using the sh_beyonder code as an example I couldn't even get an entity to appear, it reported to have been created but it was not visible to me ...


I'd be interested in seeing the script you mention to dump the entity variables, in the event you write it again. :)

Mugwump

Ingram 06-22-2004 23:44

1 Attachment(s)
sry i kinda rushed this (but i got a header in). My server began to fill up so i decided to play, all work and no play makes me go crazy. Anyways, heres the .sma

and btw, i fixed those warnings from the pm. (stupid me)

Mugwump 06-23-2004 00:25

Excellent, thanks, will have a look at this soon. :)

Mugwump


All times are GMT -4. The time now is 14:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.