(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Hosted Projects > Reinventing the Craft > Miscellaneous

Miscellaneous A forum for a variety of functions where users may also request other features.

Reply
 
LinkBack Thread Tools Display Modes
Old 07-18-2007, 11:07 PM   #1 (permalink)
 
MindWorX's Avatar

Wulfy loves Nex!
 
Join Date: Aug 2004
Posts: 293

MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)

PayPal Donor: This user has donated to The Hive. Hosted Project of the Year 2007: Reinventing the Craft 

TimeAPI

native GetTimeSeconds takes nothing returns integer // seconds (0 - 60)
native GetTimeMinutes takes nothing returns integer // minutes (0 - 59)
native GetTimeHours takes nothing returns integer // hour (0 - 23)
native GetTimeMonth takes nothing returns integer // month (0 - 11, 0 = January)
native GetTimeDayWeek takes nothing returns integer // day of week (0 - 6, 0 = Sunday)
native GetTimeDayMonth takes nothing returns integer // day of month (1 - 31)
native GetTimeDayYear takes nothing returns integer // day of year (0 - 365)
native GetTimeYear takes nothing returns integer // year since 1900

Tutorial: N/A
Download: N/A
Native Set Type: Single Player or WarSoc
Release: 0.03alpha
Other: N/A
__________________
"Wulfy loves Nex!"
MindWorX is offline   Reply With Quote
Old 07-18-2007, 11:47 PM   #2 (permalink)
 
Saitek009's Avatar

The shortest Sith
 
Join Date: Jun 2007
Posts: 64

Saitek009 is on a distinguished road (64)Saitek009 is on a distinguished road (64)


Nice job Mindy! Thanks for adding my ideas.
-Saitek

[EDIT]

Here's a trigger that syncs the system clock with the Warcraft 3 game clock.

function Trig_Real_Time_Actions takes nothing returns nothing
call SetTimeOfDay((I2R(GetTimeHours())) + (I2R(GetTimeMinutes()))/60 +
(I2R(GetTimeSeconds()))/3600)
endfunction
//===========================================================================
 function InitTrig_Real_Time takes nothing returns nothing
  set gg_trg_Real_Time = CreateTrigger( )
  call TriggerRegisterTimerEventPeriodic( gg_trg_Real_Time, 30.00 )
  call TriggerRegisterTimerEventSingle( gg_trg_Real_Time, 0.00 )
  call TriggerAddAction( gg_trg_Real_Time, function Trig_Real_Time_Actions )
  call SetTimeOfDayScale(0.0055)
endfunction
The time is re synced every 30 seconds just in case someone pauses the game thus pausing the WC3 clock.

Note: This will only work in single player.
In a LAN or Bnet game it will cause a desync.

Have fun!
__________________
Do you sue the jawbreaker company if you eat
a jawbreaker and it breaks your jaw or if
you eat one and it doesn't?
? ?

Last edited by Saitek009; 07-25-2007 at 02:43 AM.. Reason: New info needed to be added and I did not want to double post.
Saitek009 is offline   Reply With Quote
Old 07-25-2007, 11:11 AM   #3 (permalink)
 
MindWorX's Avatar

Wulfy loves Nex!
 
Join Date: Aug 2004
Posts: 293

MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)

PayPal Donor: This user has donated to The Hive. Hosted Project of the Year 2007: Reinventing the Craft 

Nice example of how to use the natives in a WarcraftIII map. +REP
__________________
"Wulfy loves Nex!"
MindWorX is offline   Reply With Quote
Old 11-24-2007, 08:10 PM   #4 (permalink)
Model & Tutorial Moderator
 
Pyritie's Avatar

 
Join Date: Nov 2006
Posts: 7,328

Pyritie has much of which to be proud (1028)Pyritie has much of which to be proud (1028)Pyritie has much of which to be proud (1028)Pyritie has much of which to be proud (1028)Pyritie has much of which to be proud (1028)Pyritie has much of which to be proud (1028)Pyritie has much of which to be proud (1028)

Super Donor: This user has donated at least $100 to The Hive. Hero Contest #1 Winner: Slatie 

So basically you can use this to set the ingame time to the computer's time?
Pyritie is offline   Reply With Quote
Old 11-24-2007, 08:20 PM   #5 (permalink)
 
MindWorX's Avatar

Wulfy loves Nex!
 
Join Date: Aug 2004
Posts: 293

MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)MindWorX has a spectacular aura about (122)

PayPal Donor: This user has donated to The Hive. Hosted Project of the Year 2007: Reinventing the Craft 

Yes. But it could also be used to make special events at certain dates or times...
__________________
"Wulfy loves Nex!"
MindWorX is offline   Reply With Quote
Old 04-08-2008, 04:18 AM   #6 (permalink)
 
joosh_7's Avatar

-Onihero
 
Join Date: Aug 2007
Posts: 77

joosh_7 has little to show at this moment (7)


Nice feature
__________________
+rep people who help you!
joosh_7 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

All times are GMT. The time now is 08:51 AM.






Your link here 
Advertising | Loans | Loan | Loans | Free Advertising
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle