|
Post by lexus20 on Jan 3, 2018 18:04:45 GMT -5
I'm creating 4-tile sliding doors that match the large base game windows, but the sim routes through the center when they should route through the left where the door opens. I tried changing the rig position to X = -1 instead of X = 0 both in blender and S4S but it didn't change anything. How can I force the sim to pass through the left not through the center of the door? Another thing is: how can I extend the footprint squares when placing the object in Buy Mode to 4 tiles instead of 2 (the original door I cloned was a 2-tile door)? The footprint itself is already correct (if you try to place other doors/windows in the square most to the right or most to the left they will intersect) but the squares that show up when placing it in Buy Mode is not. The package files (door and animation) are here.
|
|
|
Post by Zelrish on Jan 4, 2018 3:01:18 GMT -5
This looks like a mission for menaceman44 xD Maybe you will find some useful info on this post already. It's for a different kind of object but I assume it generally works the same way. A slot story ?
|
|
|
Post by menaceman44 on Jan 4, 2018 13:53:35 GMT -5
I don't think I'm going to be of any help on this occassion I'm afriad. You've done everything to the slots that I'd have thought of. Perhaps brujah could be of more help? He's worked with custom sliding doors already.
|
|
|
Post by brujah on Jan 12, 2018 0:01:37 GMT -5
The only way to change the routing of a door is to have a new script. As for the green squares, those are adjusted in the footprint.
|
|
|
Post by lexus20 on Jan 12, 2018 9:51:41 GMT -5
Thank you, I fixed the footprint squares.
About the routing, I'm not really sure what I need to put in the script. I don't know much about scripting, I've only done it once to add an interaction to terrain in a previous mod I made. I tried to give a look on how you did your script for the sliding doors you made but there was only a .pyo file and no .py file so I couldn't open it.
|
|
|
Post by brujah on Jan 16, 2018 20:44:21 GMT -5
If you have the python scripts extracted from the game look at simulation -> objects -> doors -> door.pyFrom there you will see:
def _get_positions(self): pos = self.transform.translation orient = self.transform.orientation offset = orient.transform_vector(sims4.math.Vector3(0.0, 0.0, 0.3)) cross = orient.transform_vector(sims4.math.Vector3(0.05, 0.0, 0.0)) p0 = pos + offset p1 = pos - offset p0.y = terrain.get_lot_level_height(p0.x, p0.z, self.routing_surface.secondary_id, self.routing_surface.primary_id) p1.y = terrain.get_lot_level_height(p1.x, p1.z, self.routing_surface.secondary_id, self.routing_surface.primary_id) return (p0, p1, cross)
In order to change the routing you will need to add another variable and apply it to the p0 and p1. The Vector3 formatting is (X,Y,Z) This is what I used for mine:
def _get_positions(self): pos = self.transform.translation orient = self.transform.orientation offset = orient.transform_vector(sims4.math.Vector3(0.0, 0.0, 0.3)) offset1 = orient.transform_vector(sims4.math.Vector3(0.465, 0.0, 0.0)) #This is my added variable cross = orient.transform_vector(sims4.math.Vector3(0.05, 0.0, 0.0)) p0 = pos + offset - offset1 #I applied it here, This is the front p1 = pos - offset - offset1 #And here, This is the back p0.y = terrain.get_lot_level_height(p0.x, p0.z, self.routing_surface.secondary_id, self.routing_surface.primary_id) p1.y = terrain.get_lot_level_height(p1.x, p1.z, self.routing_surface.secondary_id, self.routing_surface.primary_id) return (p0, p1, cross)
I basically copied the entire door.py and tweaked it with my own class name and replaced the __qualname__ as well. Anywhere the original class name was mentioned I changed it to the new class name. For example in the door.py:
def _is_valid(self): pos = self.transform.translation (p0, p1, cross) = self._get_positions() if abs(pos.y - p1.y) > Door.MAX_DOOR_PORTAL_HEIGHT_VARIATION or abs(pos.y - p0.y) > Door.MAX_DOOR_PORTAL_HEIGHT_VARIATION: return False return True
And in my slidingdoor:
def _is_valid(self): pos = self.transform.translation (p0, p1, cross) = self._get_positions() if abs(pos.y - p1.y) > SlidingDoor.MAX_DOOR_PORTAL_HEIGHT_VARIATION or abs(pos.y - p0.y) > SlidingDoor.MAX_DOOR_PORTAL_HEIGHT_VARIATION: return False return True
I hope this helped some.
|
|
|
Post by lexus20 on Jan 18, 2018 10:05:36 GMT -5
I did what you said and created my .py file. But when I tried to compile it I got this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python33\wideslidingdoor.py", line 1, in <module> from protocolbuffers import Routing_pb2 as routing_protocols ImportError: No module named 'protocolbuffers'
However that part where the error occurred was already in the original door.py, I didn't change anything on that part. I tried using the generated .pyo file anyway to see if it would work, so I renamed it to "__init__.pyo" just like yours (I'm not sure if the name makes any difference but I did it anyway), placed it inside a folder named "TS40_WideSlidingDoor" and compressed the folder into a .zip file with the same name. Then I changed the extension from .zip to .ts4script and placed it into my /Mods/Scripts folder. I also changed the header of the Object Tuning in the .package file to: <I c="WideSlidingDoor" i="object" m="TS40_WideSlidingDoor" n="TS40:WideSlidingDoor" s="14652844441625063089">
In the "c" I put the same name as the __qualname__ and in the "m" I put the same name as the folder/ts4script, but in game I cannot place the door as I get a "Script Call Failed" message. Could this be because of the error I got when compiling (if yes how can I fix it since that part is the same as the original door.py) or did I do something else wrong? The package, .py and .ts4script files are here (the animation package is there too but it's the same as the previous one I had posted, I didn't change anything in it).
|
|
|
Post by brujah on Jan 18, 2018 11:38:08 GMT -5
The script changed with the pre-pets patch. This looks like you were still using the script from before then. Re-extract the scripts and try again. You also haven't changed the class name.class Door(Portal): Should be
class WideSlidingDoor(Portal): As far as the added variable, I think it would look better if you change the value to 0.875 or 0.975 instead of 0.5.
|
|
|
Post by lexus20 on Jan 18, 2018 13:02:53 GMT -5
That's weird because I extracted the scripts yesterday and my game is up-to-date. But after I changed "class Door(Portal)" to "class WideSlidingDoor(Portal)" and changed the value to 0.875, it finally worked! I guess the problem was that I hadn't changed "class Door(Portal)". I still got that same error when compiling, but in-game it worked anyway. Thanks for the help!
|
|
|
Post by brujah on Jan 24, 2018 23:21:33 GMT -5
I saw in your studio you commented this This is generally the case if it is the only door on the front of the lot, it ends up automatically becoming the front door. Test it out by adding a second door to the same wall and/or changing which wall you put it on.
|
|