" Local Time " ? - Exists?

Demi666

New Member
Reaction score
127
okay so i just woundered, is it possible to make a local daytime?

like its 13:00 for player 1 red
and 14:00 for player 2 blue ?

i cant seem to find anything that matches what im looking for
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
it's a bit strange of a request.
if the "global" gametime is not good enough for you, and not even to e.g. give player 1 a +3 hour bias and player 4 a -6 hour bias, then you could still go on and have global reals for each player containing their "custom" time.
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
well, whatever you're doing, if there is a direct relation between the (one and only) gametime and your playertime, which can be expressed by a function, then there'll barely be any need to even create variables. I'll create some anywhoo to show you what I mean

e.g.
JASS:

globals
  real time_p1
  real time_p2
  real time_p3
  real time_p4
endglobals

function DoSomething takes nothing returns nothing
local real gametime=GetFloatGameState(ConvertFGameState(2))  //game time of day
set time_p1= gametime - 1.0 // game time of day minus 1 hour
set time_p2= gametime + 1.0 // game time of dy plus one hour
set time_p3=SquareRoot(time_p1+time_p2)+GetRandomReal(0,gametime) //whatever sort of time
set time_p4=gametime //game time of day again
call DoWhatEver(Player(0),time_p1)
endfunction


If necessary, create a real array for your time, or if those few kb an array consumes are too much, then a little function that allocates player number and player time will do as well. If you'd constantly like to access your player times in various instances, then it will be wise to have a function which constantly runs and constantly readjusts/updates the individual player times. Have the function run as often per second as accurately your need your time. Otherwise, if things are rather simple just calculate your time locally.
Hope that helps

EDIT: fixing some
 

SerraAvenger

Cuz I can
Reaction score
234
JASS:
function Trig_TryThis_Actions takes nothing returns nothing
     if GetLocalPlayer() == Player(0) then // Can be any player instead of Player(0)
        call SetTimeOfDay( 12 )
    endif
endfunction


Might work, not sure if this is battle.net friendly.

seems weird to me...
handle > gamestate > fgamestate

Global variables of type fgamestate:

common.j:
GAME_STATE_TIME_OF_DAY


Thus you change a handle for a local player. If you ask me, this will cause a server split....

greets, davey
 

SFilip

Gone but not forgotten
Reaction score
634
> this will cause a server split
I agree, this can't turn out good.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> this will cause a server split

Aye, I suspected it too, but Demi666 can always try to test it.

If this doesn't work, there nothing will work.
 

Demi666

New Member
Reaction score
127
well could you please give me full code? long time since i read jass or even touched WE i kind of need to copy / paste sorry lol^^ im making a map atm :)

so i have to read upp on jass when i have the time :) thanks
 

Silvenon

New Member
Reaction score
19
Can I bump my quick questions when we're still on the GetLocalPlayer() topic? Sorry, I just need those answers :). I would've written the code you asked for if I knew.

Can you "GetLocalPlayer" (that's a verb) ShowUnit and SetUnitVertexColor?
 

Silvenon

New Member
Reaction score
19
Darn!!! That sucks...... Is there any way to hide a unit for only one player? (I don't mean set it's alpha to 0 because then you can still see the shadow)
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>Darn!!! That sucks...... Is there any way to hide a unit for only one player? (I don't mean set it's alpha to 0 because then you can still see the shadow)
I wonder if this works:
JASS:
function ShowUnitForPlayer takes player p,unit u , boolean Show returns nothing
    if GetLocalPlayer() == p then
        call ShowUnit(u,Show)
    endif
endfunction
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> ~GaLs~

Did you read Chocobo's post? No, it will not work.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> You sure it's not the other way around?

What Chocobo said makes more sense. You can always test it.
 
Z

Zouflain

Guest
If a unit that is hidden on one screen but not another, I am almost certain that causes a split. Essentially, the computer with the unit hidden is left asking "okay, so what the crap just did that anyway?"
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
The game doesn't desync from stuff that one player can see and another can't.

It desyncs if that unit only exists for one player.
Seeing is different though.

As for the colors, well, a unit only has its current color.
It doesn't have a different set for each player...
 

SFilip

Gone but not forgotten
Reaction score
634
> You sure it's not the other way around?
It makes sense to me, a unit hidden with ShowUnit cannot be, for instance, attacked, while the one "hidden" with vertex coloring can and works pretty much like a normal unit.
Do correct me if I'm wrong though.
 
General chit-chat
Help Users
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top