[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 > Submissions


Submissions Submit JASS resources! If approved, they will be moved to their proper section.
Please read me first.

Reply
 
Thread Tools
Old 04-06-2012, 03:44 PM   #16 (permalink)
Registered User LeP
lol, *****
 
Join Date: Feb 2008
Posts: 134
LeP has little to show at this moment (45)LeP has little to show at this moment (45)LeP has little to show at this moment (45)LeP has little to show at this moment (45)LeP has little to show at this moment (45)
Quote:
Originally Posted by Magtheridon96 View Post
Just for the record, my map went down by 600KB when I stopped extending structs.
That pretty much falls under premature optimization.
If, and only if, these 600kB stop your map from working it's perfectly fine to optimize it.
__________________
___________________________________________________
/!\ Don't call it Schnitzel /!\

Please excuse my english. I know that it's not that good, but i'm doing my best.
LeP is offline   Reply With Quote
Old 04-06-2012, 03:52 PM   #17 (permalink)
Forum Moderator Magtheridon96
JESUS MAN
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,700
Magtheridon96 has a brilliant future (1809)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
Well, honestly, you made some pretty good points here.
But come on, who would need to extend a Dialog struct? :/

I know you're being imaginative and thinking of all these scenarios in which you can actually do something pretty cool with it, but.. well, I don't know what to say.

Maybe he can include a textmacro and use delegates so you can have the results obtained from extending without actually extending ^.^
__________________
Magtheridon96 is offline   Reply With Quote
Old 04-06-2012, 04:12 PM   #18 (permalink)
Registered User LeP
lol, *****
 
Join Date: Feb 2008
Posts: 134
LeP has little to show at this moment (45)LeP has little to show at this moment (45)LeP has little to show at this moment (45)LeP has little to show at this moment (45)LeP has little to show at this moment (45)
Quote:
Originally Posted by Magtheridon96 View Post
Well, honestly, you made some pretty good points here.
But come on, who would need to extend a Dialog struct? :/

I know you're being imaginative and thinking of all these scenarios in which you can actually do something pretty cool with it, but.. well, I don't know what to say.

Maybe he can include a textmacro and use delegates so you can have the results obtained from extending without actually extending ^.^
I already gave examples why you would extend this in particular.
But it's not only about a Dialog but about easy extendability in general.
Why restrict it without any good reason? And if you do, do it via extends array, so that i atleast get a compile-time error.

Textmacro + delegate is no real option.
Textmacros are for repetitive structures of code.
Delegates are cool, but too restricted in vJass. They are good for reusing but since they don't fulfill interface requirements you can't really use them in your polymorph code without giving up some of the good things you get from delegates. Modules work better in that regard under vJass (that is, reusing code which fulfills interface rules).

But both have there uses. They aren't exclusive.
__________________
___________________________________________________
/!\ Don't call it Schnitzel /!\

Please excuse my english. I know that it's not that good, but i'm doing my best.

Last edited by LeP; 04-06-2012 at 04:22 PM. Reason: e: rephrasing
LeP is offline   Reply With Quote
Old 04-06-2012, 06:13 PM   #19 (permalink)
Registered User The_Witcher
#1 in Top 20 Spells!
 
The_Witcher's Avatar
 
Join Date: Dec 2008
Posts: 269
The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)
Come on guys :D
I will go back to the onDestroy method to keep the structure simple!
There won't be spammings of dialog destroys i think,
So this should be a solution everybody can live with^^

@Bribe: what does jass precendence mean? Sorry i am from germany^^
and i didn't change any configuration for jasshelper... I simply updated to cohadars mod...
__________________
Need a well coded Spell or System?? PM me! My Resources
The_Witcher is offline   Reply With Quote
Old 04-06-2012, 06:57 PM   #20 (permalink)
Forum Moderator Bribe
Keep it simple
 
Bribe's Avatar
Spells, Help Zones & JASS Moderator
 
Join Date: Sep 2009
Posts: 5,581
Bribe has much of which to be proud (1209)Bribe has much of which to be proud (1209)
PayPal Donor: This user has donated to The Hive. 
Precedence is when you can call function "foo" from above function "bar", but "bar" can't call "foo" because "bar" is below "foo".

Jass:
function foo...

function bar...
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.

Bribe is offline   Reply With Quote
Old 04-06-2012, 10:46 PM   #21 (permalink)
Registered User overcold_ice
Overfrozen by vJASS
 
overcold_ice's Avatar
 
Join Date: Apr 2011
Posts: 356
overcold_ice is on a distinguished road (71)overcold_ice is on a distinguished road (71)
onDestroy is a really bad thing to have in a struct @.@
overcold_ice is offline   Reply With Quote
Old 04-06-2012, 11:04 PM   #22 (permalink)
Registered User Adiktuz
BusyWithSchool
 
Adiktuz's Avatar
 
Join Date: Oct 2008
Posts: 8,529
Adiktuz has much of which to be proud (1092)Adiktuz has much of which to be proud (1092)Adiktuz has much of which to be proud (1092)Adiktuz has much of which to be proud (1092)Adiktuz has much of which to be proud (1092)
I was wondering why struct methods doesn't seem to follow precedence... I mean they still work no matter if the method was below or above and JH doesn't return an error...
Adiktuz is offline   Reply With Quote
Old 04-07-2012, 12:39 AM   #23 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 3,548
PurgeandFire has much of which to be proud (1103)PurgeandFire has much of which to be proud (1103)PurgeandFire has much of which to be proud (1103)PurgeandFire has much of which to be proud (1103)PurgeandFire has much of which to be proud (1103)
Quote:
Originally Posted by Adiktuz View Post
I was wondering why struct methods doesn't seem to follow precedence... I mean they still work no matter if the method was below or above and JH doesn't return an error...
If it is below JH will usually either create an entire copy of the function(s) or it will create a trigger and evaluate it. (along with a few functions and variables) So precedence is still important if you care about the text compiled.
PurgeandFire is offline   Reply With Quote
Old 04-07-2012, 12:46 AM   #24 (permalink)
Forum Moderator Magtheridon96
JESUS MAN
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,700
Magtheridon96 has a brilliant future (1809)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
And the reason all of this matters:
It's not about the effects that one trigger evaluation will create, it's about the effects of all the trigger evaluations caused by the multitudes of systems in your maps.
__________________
Magtheridon96 is offline   Reply With Quote
Old 04-07-2012, 06:41 AM   #26 (permalink)
Registered User The_Witcher
#1 in Top 20 Spells!
 
The_Witcher's Avatar
 
Join Date: Dec 2008
Posts: 269
The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)
To get rid of onDestroy things I updated the Dialog struct.
It extends array now and uses a simple recycler!
__________________
Need a well coded Spell or System?? PM me! My Resources
The_Witcher is offline   Reply With Quote
Old 11-21-2012, 06:54 PM   #27 (permalink)
Forum Moderator Magtheridon96
JESUS MAN
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,700
Magtheridon96 has a brilliant future (1809)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
- The DialogButton should use a module initializer because in it's current state, the system will break if a DialogButton is managed by an external system using a module initializer :/

- The destroy method of the dialog struct should clean the DialogButtons properly. (Add a destroy method to your DialogButton struct)
__________________
Magtheridon96 is offline   Reply With Quote
Old 11-21-2012, 07:57 PM   #28 (permalink)
Registered User The_Witcher
#1 in Top 20 Spells!
 
The_Witcher's Avatar
 
Join Date: Dec 2008
Posts: 269
The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)The_Witcher is just really nice (295)
Quote:
Originally Posted by Magtheridon96 View Post
- The DialogButton should use a module initializer because in it's current state, the system will break if a DialogButton is managed by an external system using a module initializer :/

- The destroy method of the dialog struct should clean the DialogButtons properly. (Add a destroy method to your DialogButton struct)
Updated. But the destroy method DOES clean the dialog buttons properly!
__________________
Need a well coded Spell or System?? PM me! My Resources
The_Witcher is offline   Reply With Quote
Old 11-21-2012, 11:01 PM   #29 (permalink)
Registered User Nestharus
User
 
Nestharus's Avatar
 
Join Date: Jul 2007
Posts: 4,911
Nestharus has disabled reputation
Yes, now it does, lol...

another thing, you forgot to call deallocate inside of your destroy method.
__________________

Anime-Planet.com - anime | manga | reviews
Nestharus 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 10:59 AM.





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