So I just realized that CreateEntity isn't MP compatible (and is why Mav posted a while back not to use it or DeleteEntity) - that's the reason City Watch was crashing with the ping feature in MP but working fine in SP. I also recently used it in another mod and the same thing happened. Is there any way to create an entity without using CreateEntity?
One solution would be to have the objects pre-placed in the map, and then respawn them and move them when you need them. I don't really want to have to do this, as I like my gamemodes to be able to load the stock maps and not have huge file sizes. Are there any ways that a map marker can be attached to a matrix? I know that's there's MapAddRegionMarker, MapAddEntityMarker, and MapAddClassMarker, but as far as I can see there's no way to attach one to a matrix without it being an object.
Alternatives for CreateEntity? [Solved]
Moderator: Moderators
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Alternatives for CreateEntity? [Solved]
Last edited by Noobasaurus on Mon Jul 13, 2015 4:55 pm, edited 1 time in total.
-
jedimoose32
- Field Commander

- Posts: 938
- Joined: Thu Jan 24, 2008 12:41 am
- Projects :: Engineering Degree
- Location: The Flatlands of Canada
Re: Alternatives for CreateEntity?
Sorry to post without a proposal or solution, but thanks for bringing this up... I wasn't aware of this limitation and I have used CreateEntity in a few places in my current project. I'll try to revise my code I guess.
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Alternatives for CreateEntity?
I thought it was compatible... Do you try running it server side only?
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: Alternatives for CreateEntity?
Well this is strange...I just tested it server side only (using a nearly default map with only create entity) and it didn't crash. I then hosted it normally and it didn't crash either. Now with this one I spawned a clone trooper, and for the other ones I spawned a destructible object, so I'm going to try that now and see what happens.
INTERESTING. If you spawn an entity with the class label "destructablebuilding" it crashes in MP. However, a normal soldier will not crash when spawned using that method.
It also does not crash for dedicated servers (using the server manager or using the normal game client).
EDIT: After trying out a bunch of different class labels, it seems that AnimatedBuilding works the best for now and is also MP compatible. Time to go fix City Watch. Solved.
EDIT2: Nevermind. It doesn't crash, but for the client the objects appear to be invisible and have buggy collision. The host can see objects fine.
INTERESTING. If you spawn an entity with the class label "destructablebuilding" it crashes in MP. However, a normal soldier will not crash when spawned using that method.
It also does not crash for dedicated servers (using the server manager or using the normal game client).
EDIT: After trying out a bunch of different class labels, it seems that AnimatedBuilding works the best for now and is also MP compatible. Time to go fix City Watch. Solved.
EDIT2: Nevermind. It doesn't crash, but for the client the objects appear to be invisible and have buggy collision. The host can see objects fine.
