Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Hi,
I'm new to this forum & this is my first mod and first Python experience (I'm a C#/Java developer)
In the past hours I worked on a mod to force super-speed in game.
This is a script mod that enables super-speed by pressing the "3" key twice.
Basically I override the time scale method in clock.py (to return the super_speed_three scale) and the "clock.setspeed" console command ( used by numeric keys to change time_speed).
Feel free to report bugs, I'll do my best to fix them
General python programming tips are apriciated
Hope this helps
Instructions
Copy the mod .zip in "Documents/Electronic Arts/The Sims 4/Mods"
Start the game, go to Options->Game Options->Enable Script Mods
Restart the game
Enjoy
Changelog
v0.02 )
Temporarly disabled automatic super_speed_three because it was causing the game to become unresponsive
Fixed a bug where the game wouldn't pause in Build Mode
Here is the code if you want to edit it without downloading the .zip file:
Code:
# The Sims 4
# Copyright 2014 Electronic Arts Inc. All rights reserved.
"""
Super Speed Mod - Created by artum
Version: 0.02
This enables SuperSpeed-like game_speed by pressing "3" twice
It'll conflict with mods that:
- Modify default "clock.set_speed" console command
- Modify GameClock._clock_speed_to_scale or GameClock.set_clock_speed method in clock.py
- Adds custom variables/methods with the same names as the one used in this script (Who would do that?)
"""
import sims4.commands
import services
import clock
from clock import GameClock, ClockSpeedMode, ClockSpeedMultipliers, GameSpeedChangeSource, ClockSpeedMultiplierType
from server_commands.clock_commands import send_clock_telemetry_data
GameClock.OLD_clock_speed_to_scale = GameClock._clock_speed_to_scale
GameClock.OLD_set_clock_speed = GameClock.set_clock_speed
GameClock.superspeed = False
GameClock.last_user_speed = ClockSpeedMode.PAUSED
#Modified Input Class (Original at simulation/server_commands/clock_commands.pyo)
@sims4.commands.Command('clock.setspeed', command_type=sims4.commands.CommandType.Live)
def set_speed(speed='one', _connection=None):
output = sims4.commands.Output(_connection)
speed = speed.lower()
clock_service = services.game_clock_service()
if speed == 'one':
speed = ClockSpeedMode.NORMAL
elif speed == 'two':
speed = ClockSpeedMode.SPEED2
elif speed == 'three':
speed = ClockSpeedMode.SPEED3
if speed == ClockSpeedMode.SPEED3 and clock_service.last_user_speed == ClockSpeedMode.SPEED3:
clock_service.superspeed = not clock_service.superspeed #Toggle
else:
clock_service.superspeed = False
send_clock_telemetry_data(_connection, speed)
clock_service.set_clock_speed(speed, change_source=GameSpeedChangeSource.USER)
clock_service.last_user_speed = speed
#Overrides _clock_speed_to_scale method ( surface/clock.py)
def modded_clock_speed_to_scale(self, clock_speed):
if clock_speed == ClockSpeedMode.SPEED3 and self.superspeed and not services.get_super_speed_three_service().in_or_has_requested_super_speed_three():
return ClockSpeedMultipliers.super_speed_three_multiplier(ClockSpeedMultiplierType.DEFAULT) #without ClockSpeedMultiplierType.DEFAULT it lags :S
else:
self.superspeed = False
return self.OLD_clock_speed_to_scale(clock_speed)
def modded_set_clock_speed(self, speed, change_source=GameSpeedChangeSource.GAMEPLAY) -> bool:
if (speed != ClockSpeedMode.SPEED3 or services.get_super_speed_three_service().in_or_has_requested_super_speed_three()):
self.superspeed = False
return self.OLD_set_clock_speed(speed, change_source)
GameClock.ignore_game_speed_requests = True #SuperSpeedThree disabled while trying to fix it
GameClock._clock_speed_to_scale = modded_clock_speed_to_scale
GameClock.set_clock_speed = modded_set_clock_speed
Could you perhaps spell out in a bit more detail what exact feedback you are looking for, what you’re unsure about, etc?
Because this forum is not meant to be a means to circumvent upload moderation .. it’s OK to post attachments so that others can help you figure out a problem, but you sound like this does work for you. Or does it not?
Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.
Could you perhaps spell out in a bit more detail what exact feedback you are looking for, what you’re unsure about, etc?
Because this forum is not meant to be a means to circumvent upload moderation .. it’s OK to post attachments so that others can help you figure out a problem, but you sound like this does work for you. Or does it not?
The mod is working for me, I only want to be sure that it works for everyone without weird bugs, etc.
Have you seen this thread, post #3? http://modthesims.info/showthread.php?p=4516432 There seem to be issues with the game going out of sync when clock is being messed with .. I have no idea whether you did it the same way, or different, or which is better or worse.
Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.
I'm overriding the same exact method but intead of fixed numbers I use Maxis method to get the super_speed_three multiplier ( ClockSpeedMultipliers.super_speed_three_multiplier(ClockSpeedMultiplierType.DEFAULT) ) which should always return a good value without messing with sync.
Ok, bugs found so far:
- Some scripts that force the game to PAUSE don't stop the super-speed (FIXED in next revision)
- When the real super_speed_three try to start it blocks the game (Currently trying to fix it)
I'm considering to add some way to tweak speed multipliers for each speed without messing with script files, but I don't know If multipling default speeds would lead to sync problems.
Btw I'll surely try to add this option
Currently I'm waiting Maxis patch for further modifications in order to upload the mod in the Download section for release
For now It doesn't seem so, tomorrow I'll test with crazy custom speeds & I'll report back :D
(I submitted the current version in the Download section & waiting for approval, then I'll release it as an update )
i think i was having some issues because the motives (while on super speed) would fill up and go back down, and one sim stayed at work 3 hours later than she should've while i had super speed on. other than that, it's a great mod.
It seems that the delay when sims get back from work increase at higher speeds :S
I think this is Maxis related stuffs, the delay is present even at normal speeds (just some minutes more than speed 1).
I'll look in some files to see where this delay could be generated...
oh yeah, the delay does happen for at least 15 (sim) minutes on normal speeds. nevermind about the motive thing, that happens at regular speeds too i think. it could be a bug i guess?