replacing the crocodile model with another prop for func_croc

  • If you're asking a question make sure to set the thread type to be a question!

Billo

aa
Feb 8, 2016
920
397
Hey guys.
In short , I would like to replace the crocodile model for a different one for sharkbay but i dont know how.
Func_croc only makes a crocodile appear. it doesnt have any other options. Someone told me to rewrite the code of func_croc for the map but I am not sure how this is possible.
Any ideas?
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
I think the model is models/props_island/crocodile/crocodile.mdl. Specifically, I'd guess the "attack" animation is used. Try overriding that model and animation in your map's custom files.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
Make the model, give it the same filename and filepath as the crocodile model, and pack it into your map. That should work, I think, although I've never tried this before so I can't be sure.
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Only works for players who play on this map first, and then that model is cached for all maps after this, until you restart or recache.
 

Billo

aa
Feb 8, 2016
920
397
so lets say i make a trigger multiple which if you touch it a shark comes and does the animation of jumping like the crocodile, would that be the next logical solution? but of course i should have at least 8 shark with the trigger for each possible space of water available.
Should I go with that solution or is there anything better?
 

ics

http://ics-base.net
aa
Jun 17, 2010
841
540
Overwriting existing model with some packed model within map is no good. Anyone who runs that map on a server, will crash or even the clients crash to desktop.
 

AsG_Alligator

qhull precision error
aa
Aug 5, 2016
595
1,191
I did ask Eric about a model selection option for the entity but alas they did not add it. They only added OnEat outputs.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
so lets say i make a trigger multiple which if you touch it a shark comes and does the animation of jumping like the crocodile, would that be the next logical solution? but of course i should have at least 8 shark with the trigger for each possible space of water available.
Should I go with that solution or is there anything better?
Env_entity_maker possesses the ability to spawn its point_template at a specified entity via the ForceSpawnAtEntityOrigin input. Perhaps you could just do one trigger_multiple with the OnStartTouch > env_entity_maker > ForceSpawnAtEntityOrigin > !activator.
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
Env_entity_maker possesses the ability to spawn its point_template at a specified entity via the ForceSpawnAtEntityOrigin input. Perhaps you could just do one trigger_multiple with the OnStartTouch > env_entity_maker > ForceSpawnAtEntityOrigin > !activator.
Here, I managed to do it: Using the above method, I managed to create a system that nearly replicates the functionality of func_croc, but allows for customizability in the model and animation that is used. The testing map below has two versions of this: A purely model-based version that plays a model's (currently the default crocodile, can be swapped out for any animated model) attack animation as the jumping animation, as well as a second version that uses a func_movelinear to make a model without a jumping animation (in my case, a sword) jump up and down. All entities are removed after their animations are done, and multiple sets of entities won't interfere with each other.

Also, I have no idea why the crocodiles are shiny.
 

Attachments

  • test_customcroc.vmf
    31.5 KB · Views: 195
  • test_customcroc.bsp
    40.6 KB · Views: 224

Billo

aa
Feb 8, 2016
920
397
okay So i tested it and I replaced the crocodile with the shark and it works phenomenaly! Thank So much for your time and work. I will use your logic on my map and I will give you credit on the next update. thanks again so much.
 

ficool2

L4: Comfortable Member
Oct 28, 2017
161
232
It is possible to override the model of an entity_croc directly (this works for *any* entity however except players) without using the BSP-packing method, with some caveats:
- Animation length and amount must be the same, and the hitbox/collision will not change
- The method itself can be confusing and complicated on your first tries

If this method will suit you, then PM me and I'll explain it
 
Last edited:

Billo

aa
Feb 8, 2016
920
397
no need to. I tried Da Sputd Lord's Logic and it worked with no problems at all. thank you for helping though ;)
 

Billo

aa
Feb 8, 2016
920
397
Hmmmm there is a post on the top saying: okay So i tested it and I replaced the crocodile with the shark and it works phenomenaly!........