[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 > Resources > 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, 07:13 PM   #16 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 384
D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)
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, 07:35 PM   #17 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 2,233
Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)
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.
- I don't have wc3 installed anymore since a while, please consider it before answer me.
- less efficient != inefficient
- features, less verbosity, decent api, safety > ridiculous script "efficiency" "won" and map broken. That's all a matter of scale.
Troll-Brain is offline   Reply With Quote
Old 03-30-2012, 08:36 PM   #18 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 384
D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)
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-31-2012, 12:31 AM   #19 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 2,233
Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)
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.
- I don't have wc3 installed anymore since a while, please consider it before answer me.
- less efficient != inefficient
- features, less verbosity, decent api, safety > ridiculous script "efficiency" "won" and map broken. That's all a matter of scale.
Troll-Brain is offline   Reply With Quote
Old 03-31-2012, 06:47 AM   #20 (permalink)
Registered User Nestharus
Semi-Here
 
Join Date: Jul 2007
Posts: 5,924
Nestharus has disabled reputation
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 -> http://www.hiveworkshop.com/forums/j...t-data-187478/
Nestharus is offline   Reply With Quote
Old 03-31-2012, 08:03 AM   #21 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 5,867
PurgeandFire has a reputation beyond repute (2153)PurgeandFire has a reputation beyond repute (2153)PurgeandFire has a reputation beyond repute (2153)PurgeandFire has a reputation beyond repute (2153)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
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, 08:06 AM   #22 (permalink)
Registered User Nestharus
Semi-Here
 
Join Date: Jul 2007
Posts: 5,924
Nestharus has disabled reputation
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 offline   Reply With Quote
Old 03-31-2012, 10:31 AM   #23 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 2,233
Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)
@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.
- I don't have wc3 installed anymore since a while, please consider it before answer me.
- less efficient != inefficient
- features, less verbosity, decent api, safety > ridiculous script "efficiency" "won" and map broken. That's all a matter of scale.
Troll-Brain is offline   Reply With Quote
Old 03-31-2012, 10:33 AM   #24 (permalink)
Registered User Nestharus
Semi-Here
 
Join Date: Jul 2007
Posts: 5,924
Nestharus has disabled reputation
Awww, this is all u need

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

You can get rid of your trigger and everything ;o.
Nestharus is offline   Reply With Quote
Old 03-31-2012, 10:36 AM   #25 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 2,233
Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)
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.
- I don't have wc3 installed anymore since a while, please consider it before answer me.
- less efficient != inefficient
- features, less verbosity, decent api, safety > ridiculous script "efficiency" "won" and map broken. That's all a matter of scale.
Troll-Brain is offline   Reply With Quote
Old 03-31-2012, 11:43 AM   #26 (permalink)
Registered User Nestharus
Semi-Here
 
Join Date: Jul 2007
Posts: 5,924
Nestharus has disabled reputation
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 offline   Reply With Quote
Old 03-31-2012, 03:11 PM   #27 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 384
D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)
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 04:16 PM.
D.O.G. is offline   Reply With Quote
Old 04-08-2012, 11:57 AM   #28 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 384
D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)
Added working multiplayer version.
D.O.G. is offline   Reply With Quote
Old 04-08-2012, 02:09 PM   #29 (permalink)
Registered User Troll-Brain
cool != useful
 
Troll-Brain's Avatar
 
Join Date: Apr 2008
Posts: 2,233
Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)Troll-Brain is a glorious beacon of light (469)
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.
- I don't have wc3 installed anymore since a while, please consider it before answer me.
- less efficient != inefficient
- features, less verbosity, decent api, safety > ridiculous script "efficiency" "won" and map broken. That's all a matter of scale.
Troll-Brain is offline   Reply With Quote
Old 04-08-2012, 04:15 PM   #30 (permalink)
Registered User D.O.G.
\m/
 
D.O.G.'s Avatar
 
Join Date: Oct 2007
Posts: 384
D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)D.O.G. has a spectacular aura about (140)
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 08:36 PM.




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