[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > JASS Resources


JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum.

Reply
 
Thread Tools
Old 03-30-2012, 06:13 PM   #16 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 326
D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)
With checking for sync I can set CHECK_SPACE_TIME to 0.1 and this will work as your second idea.

I think I will test new code today, but I don't promise.
D.O.G. is offline   Reply With Quote
Old 03-30-2012, 06:35 PM   #17 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 1,940
Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)
More comments are needed if you set it to 0.1, because users would expect to be more accurate than it is.

Also, i suppose a GetLastTimeSync function wouldn't hurt.

Finally instead of the SpacePressed function it would be better to use a function interface or a custom function with a code argument.
I agree that it is a very specifical use, but "hardcoding" a stuff in a needed library is not a good practice.

Or just use the Event library, as it is afterall a custom event.
__________________
- There are bugs with wc3, but most of time, the bug is between the keyboard and the chair.
- Never believe some warcraft "fact" without a proof, even from an "experienced" user, that's how myths & legends born.

You spam "...", "lol", and smilies such as "; p", "^)^",">.>"? You think you're the best and all other ones are stupids or at least less clever than you ? You think your errors are funny, while the other ones are incredibly lame ?
Maybe you've too much ego,or worse, you're a douchebag
Troll-Brain is online now   Reply With Quote
Old 03-30-2012, 07:36 PM   #18 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 326
D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)
Quote:
Originally Posted by Troll-Brain View Post
More comments are needed if you set it to 0.1, because users would expect to be more accurate than it is.

Also, i suppose a GetLastTimeSync function wouldn't hurt.

Finally instead of the SpacePressed function it would be better to use a function interface or a custom function with a code argument.
I agree that it is a very specifical use, but "hardcoding" a stuff in a needed library is not a good practice.

Or just use the Event library, as it is afterall a custom event.
Can tell me how to do custom events?

Anyway, code even with checking for sync doesn't work in multiplayer. I don't have any idea...
D.O.G. is offline   Reply With Quote
Old 03-30-2012, 11:31 PM   #19 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 1,940
Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)
Quote:
Originally Posted by D.O.G. View Post
Can tell me how to do custom events?

Anyway, code even with checking for sync doesn't work in multiplayer. I don't have any idea...
I suppose there are some libraries here which use the library Event.
You could take them as an example.

It doesn't work, even with the boolean ?
How it doesn't work btw ?

You could also back to the loop sync (first block of code), because as said i'm not 100 % sure it will work even if it should.

And finally the guy who wrote about the sync stuff could be wrong.
__________________
- There are bugs with wc3, but most of time, the bug is between the keyboard and the chair.
- Never believe some warcraft "fact" without a proof, even from an "experienced" user, that's how myths & legends born.

You spam "...", "lol", and smilies such as "; p", "^)^",">.>"? You think you're the best and all other ones are stupids or at least less clever than you ? You think your errors are funny, while the other ones are incredibly lame ?
Maybe you've too much ego,or worse, you're a douchebag
Troll-Brain is online now   Reply With Quote
Old 03-31-2012, 05:47 AM   #20 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,920
Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)
This is coded wrong. When you use spacebar, the player's window goes to that player's start location, not to some point off the screen.


GetStartLocationX(GetPlayerId(GetLocalPlayer())) == GetCameraTargetPositionX() and GetStartLocationY(GetPlayerId(GetLocalPlayer())) == GetCameraTargetPositionY()

It's a quick fix ; ).

Also, be sure to start the start location coords in vars to improve speed and readability a bit ^_^.
Jass:
set x = GetStartLocationX(GetPlayerId(GetLocalPlayer()))
set y = GetStartLocationY(GetPlayerId(GetLocalPlayer()))


Nice attempt for one of your first resources, gj ^)^. +rep.


Be sure to use the Event library for your custom events ; ).


This is the main thing you have to watch out for -> Custom Event Data
Nestharus is online now   Reply With Quote
Old 03-31-2012, 07:03 AM   #21 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 3,561
PurgeandFire has much of which to be proud (1106)PurgeandFire has much of which to be proud (1106)PurgeandFire has much of which to be proud (1106)PurgeandFire has much of which to be proud (1106)PurgeandFire has much of which to be proud (1106)
He calls this:
call SetCameraQuickPosition(Space_X, Space_Y)

So the spacebar should go to the point off screen, unless I'm mistaken.
PurgeandFire is offline   Reply With Quote
Old 03-31-2012, 07:06 AM   #22 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,920
Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)
Ah, my bad =). I've never used that native, so I wasn't sure what it did ;p.

I just knew from experience that spacebar auto returns u to player start locations ^)^


Then all this needs is the event stuff and it's good to go =D.


Spacebar event will be a very useful event to have. It's too bad that it's local only for the moment.

edit
make this use timeout of .031250000 for more accurate event responses please =O. As such, please make this use CTL so that it's merged with other timers of that timeout =). All you need to do is make a TimerGroup ^_^.
Nestharus is online now   Reply With Quote
Old 03-31-2012, 09:31 AM   #23 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 1,940
Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)
@D.O.G :

Don't worry using CTL will never be a requirement for that. (In case you don't like/understand the API)
Using one timer for that is enough fine here.
Plus i'm not sure that even in a single player game cameras are that fast.
__________________
- There are bugs with wc3, but most of time, the bug is between the keyboard and the chair.
- Never believe some warcraft "fact" without a proof, even from an "experienced" user, that's how myths & legends born.

You spam "...", "lol", and smilies such as "; p", "^)^",">.>"? You think you're the best and all other ones are stupids or at least less clever than you ? You think your errors are funny, while the other ones are incredibly lame ?
Maybe you've too much ego,or worse, you're a douchebag
Troll-Brain is online now   Reply With Quote
Old 03-31-2012, 09:33 AM   #24 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,920
Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)
Awww, this is all u need

call TimerGroup32.create(function Actions).start()

You can get rid of your trigger and everything ;o.
Nestharus is online now   Reply With Quote
Old 03-31-2012, 09:36 AM   #25 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 1,940
Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)
CTL is ugly to use for many of us :

Quote:
Originally Posted by myself
In case you don't like/understand the API
Plus, you can't get rid of the trigger action, at least not with the sync version.
EDIT : But yeah for SpaceHandlerLocal you don't need a trigger, only a timer.
__________________
- There are bugs with wc3, but most of time, the bug is between the keyboard and the chair.
- Never believe some warcraft "fact" without a proof, even from an "experienced" user, that's how myths & legends born.

You spam "...", "lol", and smilies such as "; p", "^)^",">.>"? You think you're the best and all other ones are stupids or at least less clever than you ? You think your errors are funny, while the other ones are incredibly lame ?
Maybe you've too much ego,or worse, you're a douchebag
Troll-Brain is online now   Reply With Quote
Old 03-31-2012, 10:43 AM   #26 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,920
Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)Nestharus is a splendid one to behold (928)
Oh yea, this actually won't need recursive events. I don't see a spacebar event ever happening within a spacebar event, so you don't need to worry about the recursive stuff ;D.
Nestharus is online now   Reply With Quote
Old 03-31-2012, 02:11 PM   #27 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 326
D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)
I'm not going to use your CTL. It doesn't add something to functionality of my snippet and is useless there. Also I don't want my snippet has any requirements

Last edited by D.O.G.; 04-08-2012 at 03:16 PM.
D.O.G. is offline   Reply With Quote
Old 04-08-2012, 10:57 AM   #28 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 326
D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)
Added working multiplayer version.
D.O.G. is offline   Reply With Quote
Old 04-08-2012, 01:09 PM   #29 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 1,940
Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)Troll-Brain is just really nice (375)
So StoreReal with GetLocalPlayer doesn't work, you have to do a loop ?
That doesn't really make sense, because with or without the loop it's already used in a local block for each player.

Or have you done it just to be sure ?
__________________
- There are bugs with wc3, but most of time, the bug is between the keyboard and the chair.
- Never believe some warcraft "fact" without a proof, even from an "experienced" user, that's how myths & legends born.

You spam "...", "lol", and smilies such as "; p", "^)^",">.>"? You think you're the best and all other ones are stupids or at least less clever than you ? You think your errors are funny, while the other ones are incredibly lame ?
Maybe you've too much ego,or worse, you're a douchebag
Troll-Brain is online now   Reply With Quote
Old 04-08-2012, 03:15 PM   #30 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 326
D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)D.O.G. will become famous soon enough (113)
Quote:
Originally Posted by Troll-Brain View Post
So StoreReal with GetLocalPlayer doesn't work, you have to do a loop ?
That doesn't really make sense, because with or without the loop it's already used in a local block for each player.

Or have you done it just to be sure ?
I've made it to be sure. I have tested - current version (4.0) works 100% with 2 players (must work with more players).

EDIT: I've added untested version without loops. Hopefully, I could test it tonight.
D.O.G. is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 05:05 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle