Doing it like this would make the script much shorted but achieve the same. Instead of using absolute names, it will reference to the current value of asParent / asTimer, which at runtime will be the entity currently used to call the events.
Anyway, have you tried, instead of using ResetProp, to use the CreateEntityAtArea? Perhaps you can just create new bottles at defined areas instead? Broken props may not want to reset, as they might be considered non-existant.
Mudbill Wrote:Perhaps you can just create new bottles at defined areas instead? Broken props may not want to reset, as they might be considered non-existant.
Yeap. A broken entity disappears forever. You can't reset it (I tried).
I had to create new entities just like mud says.
Doing it like this would make the script much shorted but achieve the same. Instead of using absolute names, it will reference to the current value of asParent / asTimer, which at runtime will be the entity currently used to call the events.
Anyway, have you tried, instead of using ResetProp, to use the CreateEntityAtArea? Perhaps you can just create new bottles at defined areas instead? Broken props may not want to reset, as they might be considered non-existant.
I prefer using absolute names as you put it. I know it's cluttered but for some reason having everything laid out as plain as possible makes it easier to work with, even if it does leave me with long ass scripts. Anyway, thanks. I went to bed after posting and my last thoughts were to just use createentityatarea scripts. I should've got up and edited my post lol.
Update: I tried doing the createentityatarea trick and it didn't work. However By turning on the debug mode I saw that it was giving a warning when I started the map that the bottles referenced in the callback didn't exist. Seems adding my collide callback to the OnStart was causing the issue. Now I have the collide callback get created each time a new bottle is spawned and it's working beautifully. I guess the system can't handle a callback being created before the entity the callback needs exists.
New question: How do I make an object float? I've played custom stories with objects that have no gravity and if you grab it and throw it it just sorta floats away. I'm trying to do that. I unchecked the "has gravity" box in the model editor but that did nothing. I tried doing a search but I can only find stuff about floats in terms of scripting.
Edit: Sigh, nevermind. Apparently the object needs to have a mass more than 0 before it will float around. Sorry.
Could someone check something for me? I'm trying to use the cot from AMFP but I'm having trouble. It shows up fine in both the model editor and level editor, but once I'm in-game it's invisible. I can tell it's there though since walking to where it should be stops my character. I tried doing a search but apparently Cot is too short of a word to qualify for a search. Blegh.
(09-04-2014, 02:43 PM)Mudbill Wrote: Have you made sure it's not just a .map_cache file fooling you?
Not possible because A: I have the loading of map_cache files disabled and B: if it was a cache issue then the collision wouldn't exist. I did go ahead and check for it just in case and it is indeed not the issue.
Even when I disable caches, they still appear. I'm guessing they don't go into effect, but they're there anyway. I have experienced collision boxes being present when the model isn't because of caches. Either that or maybe the model has no body assigned and is located at co-ords 0,0,0.
Not really sure how to assign bodies. I've edited dozens of models and I always just added some shapes, selected them and picked to create body. My problem must have something to do with my ent file because I tried putting the cot.DAE in as a static object and it was able to show up just fine. Meh, my use doesn't really require the player to be able to interact with the cot so I'll probably just leave the static object version in there and call it a day.