This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [Question] Time multiplicator  (Read 1963 times)

loked

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 7
    • View Profile
[Question] Time multiplicator
« on: December 05, 2014, 12:36:51 am »
Hi everybody! I'm there because I've a important question for my 3.3.5 Trinity server.

For more cycles of days and nights, I want an accelerated time but I have no idea where and how can I change this. If anyone has any information to help me, that would be awesome.

P.S. : Sorry if my english is bad.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

kojak488

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 351
    • View Profile
Re: [Question] Time multiplicator
« Reply #1 on: December 06, 2014, 03:58:29 am »
My previous research indicates it's hardcoded into the client.  You can change the time the sun and moon rise and set, but not accelerate it per se.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: [Question] Time multiplicator
« Reply #2 on: December 06, 2014, 11:38:04 am »
Fuh, really? Game time is taken from server and server takes it from its machine's system time. You might want to look at that. But don't ask where will you find this in core, I am no core developer.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz

Eatos

  • Registred Member
  • LUA Script Tinker
  • *****
  • Posts: 46
    • View Profile
Re: [Question] Time multiplicator
« Reply #3 on: December 06, 2014, 12:39:14 pm »
SMSG_LOGIN_SETTIMESPEED - controls timespeed of game, server time.
See where it is handled in emulator and add value to it
WorldPacket data(SMSG_LOGIN_SETTIMESPEED, 4+4+4);
data << uint32( MAKE_GAME_TIME() );
data << float(0.0166666669777748f) * 2.0f   // Makes Normal Game Speed x2 faster
data << uint32(0);   // 3.1.2
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

loked

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 7
    • View Profile
Re: [Question] Time multiplicator
« Reply #4 on: December 06, 2014, 04:59:47 pm »
Thanks Eatos! This is run and work really nice.

But, now I've a new problem...when a player connects, the game time start with local time. Is there a specific value for change it? If you have an idea.

I think what I search is in World.cpp or not?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

kojak488

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 351
    • View Profile
Re: [Question] Time multiplicator
« Reply #5 on: December 06, 2014, 08:40:41 pm »
Quote from: "Eatos"
SMSG_LOGIN_SETTIMESPEED - controls timespeed of game, server time.
See where it is handled in emulator and add value to it
WorldPacket data(SMSG_LOGIN_SETTIMESPEED, 4+4+4);
data << uint32( MAKE_GAME_TIME() );
data << float(0.0166666669777748f) * 2.0f   // Makes Normal Game Speed x2 faster
data << uint32(0);   // 3.1.2

Can't wait to compile and try this.  If it works, then I love you long time.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [Question] Time multiplicator
« Reply #6 on: December 10, 2014, 01:54:44 pm »
Quote from: "Eatos"
SMSG_LOGIN_SETTIMESPEED - controls timespeed of game, server time.
See where it is handled in emulator and add value to it
WorldPacket data(SMSG_LOGIN_SETTIMESPEED, 4+4+4);
data << uint32( MAKE_GAME_TIME() );
data << float(0.0166666669777748f) * 2.0f   // Makes Normal Game Speed x2 faster
data << uint32(0);   // 3.1.2

This works, e.g: my code for 20 minute day starting at 7am:

Code: [Select]
-- Set time to 7am
local p = CreatePacket(66, 12)
p:WriteULong(GetHungerGamesInitialTime()) -- time
p:WriteFloat(1.20000024) -- speed
p:WriteULong(0)
count = count + 1
rPlr:SendPacket(p)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

kojak488

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 351
    • View Profile
Re: [Question] Time multiplicator
« Reply #7 on: December 13, 2014, 04:27:46 am »
What bugs does it give you?  Someone earlier indicated a bug that would allow different players to be at different times of day depending on when they logged in as it goes out of sync.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »