wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-25-2009, 08:46 PM   #2146
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Collapse JASS:
interface MyInterface

struct OtherStruct extends MyInterface
endstruct

struct YourStructThatExtendsBoth extends OtherStruct
endstruct
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-25-2009, 10:22 PM   #2147
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Mmm, I was expecting something different. That has a special problem, what happens if Parent doesn't know of struct A ?
Even worse, every time I update AInterface, I have to update the Parent and struct A, the parent shouldn't need to be changed, I am afraid someone may kill me for saying this, but the heritage way doesn't seem to be much "modular" ...

Only me to come up with a design JassHelper can't support ...
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 07-26-2009, 04:00 AM   #2148
Blubb-Tec
Full Metal Mapping!
 
Blubb-Tec's Avatar
 
Join Date: Nov 2006
Posts: 270

Submissions (1)

Blubb-Tec will become famous soon enough (37)Blubb-Tec will become famous soon enough (37)

Default

Quote:
Originally Posted by Flame_Phoenix
Mmm, I was expecting something different. That has a special problem, what happens if Parent doesn't know of struct A ?
Even worse, every time I update AInterface, I have to update the Parent and struct A, the parent shouldn't need to be changed, I am afraid someone may kill me for saying this, but the heritage way doesn't seem to be much "modular" ...

Only me to come up with a design JassHelper can't support ...

no, actually not. simple thing is, with current vJass design, its simply not possible to implement. thats why (afaik) vex is remaking the vjass structs phase.
__________________
P A R T Y

"In a way, we're all troubled adolescent girls... deep inside."
Blubb-Tec is offline   Reply With Quote
Old 07-26-2009, 05:02 AM   #2149
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
Originally Posted by Flame_Phoenix
Mmm, I was expecting something different. That has a special problem, what happens if Parent doesn't know of struct A ?
Even worse, every time I update AInterface, I have to update the Parent and struct A, the parent shouldn't need to be changed, I am afraid someone may kill me for saying this, but the heritage way doesn't seem to be much "modular" ...

Only me to come up with a design JassHelper can't support ...
Could it be your parent actually behaves more like a module?
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 07-26-2009, 09:39 AM   #2150
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

MMm, how can I explain myself ...
Well, I will give you the example of my problem.

The Parent is a struct called Shape:
Collapse JASS:
struct Shape
    //methods and  members
endstruct

Now Shape has a child, or many childs, in this case Shape has a child called Line which has an interface, LineI:
Collapse JASS:
interface LineI
    //methods
endinterface

struct Line extends Shape //Shape is the father of all Shapes, such as circles, lines and so on!
endstruct

My problem is that Line should also be able to implement LineI. It does not make sense for the father Shape to implement an interface that belongs exclusively to one of his childs. If tomorrow I add another Shape, called Circle, I will have to change the father, which makes no sense.

As for modules, each child has several modules. Per example, shape Line has modules XefxLineModule (which makes pictures with xefx) and LightningLineModule (which makes pictures with lightnings). Both modules are optional.

I hope you understand my problem no Vex, I can't explain any better.
In this case I have to choose, so I will leave behind the interfaces because I don't want the father Shapes (the core) to be updated every time a user (or I) add a new child Shape.

I will keep working, but when vJass suports what is in my head, I will be sure to implement it =D
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 07-26-2009 at 09:40 AM.
Flame_Phoenix is offline   Reply With Quote
Old 07-26-2009, 10:19 AM   #2151
Eleandor
User
 
Join Date: Jan 2006
Posts: 118

Eleandor is on a distinguished road (12)

Default

A "shape" is quite unlikely to actually exist. You would probably have "specific" shapes such as a circle or a line, rather than a "generic" shape. Therefor, "Shape" should not be a struct but an interface.

Then you can extend lineI from Shape and Line from LineI. That is, assuming you still need LineI.
Eleandor is offline   Reply With Quote
Old 07-26-2009, 11:49 AM   #2152
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 191

Dark_Dragon has little to show at this moment (9)

Default

Quote:
Originally Posted by MindWorX
Dark_Dragon, please read up on things before you ramble on.
http://en.wikipedia.org/wiki/Namespa...ter_science%29

wow and thats why i think schools suck... lol teaching me wrong... ty for this +rep!
__________________
Undefined shadow...
Dark_Dragon is offline   Reply With Quote
Old 07-26-2009, 03:14 PM   #2153
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Shape is a struct because it contains data needed for all other childs. It wouldn't make sense for Shape to be an interface, specially having in mind it is also a core trigger.
Different people have different implementation decisions, I am not here to discuss the decisions I took, I am here to explain them so Vex can understand them and with this understanding make a better JassHelper.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 07-26-2009, 04:22 PM   #2154
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 191

Dark_Dragon has little to show at this moment (9)

Default

Quote:
Originally Posted by Flame_Phoenix
Shape is a struct because it contains data needed for all other childs. It wouldn't make sense for Shape to be an interface, specially having in mind it is also a core trigger.
Different people have different implementation decisions, I am not here to discuss the decisions I took, I am here to explain them so Vex can understand them and with this understanding make a better JassHelper.

yeah i understand, but looking at how code should look like if extends could have multiple/structs,interfaces i can only immagine extremely slow code which u would not like to use.

EDIT: {
yeah vex is editing structs so this new way might really be awesome, faster and much more of use (like having multiple extends on one struct) i hope it gets that way.
}

well i as well came in some trouble and i am not sure did vex allow that:

Collapse JASS:
struct some
    static method test takes nothing returns nothing
    endmethod
endstruct

and know i need to use that static method as function pointer or object function... i tried functiontype.some.test but it did not work so i guess its impossible...
__________________
Undefined shadow...

Last edited by Dark_Dragon : 07-26-2009 at 04:31 PM.
Dark_Dragon is offline   Reply With Quote
Old 07-26-2009, 04:26 PM   #2155
Eleandor
User
 
Join Date: Jan 2006
Posts: 118

Eleandor is on a distinguished road (12)

Default

Interfaces can contain data to be used by children...

Quote:
It wouldn't make sense for Shape to be an interface
It makes more sense than if it would be a struct. A struct is something *real*. A "shape" is not *real*. There are no shapes in real life. All we have are "circles", "lines", etc. which we identify as a "shape", which is exactly why a shape should be an interface, not a struct.

And if you're not here to *discuss* implementation decisions, then maybe consider that using interfaces is the *right* way to do it, and using structs is not even possible simply because it's the *wrong* way to do it? I'm telling because Vex can understand how such a feature is not necessary, nor would it be good to have.

Last edited by Eleandor : 07-26-2009 at 04:28 PM.
Eleandor is offline   Reply With Quote
Old 07-26-2009, 05:04 PM   #2156
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
Interfaces can contain data to be used by children...
Yes, I forgot this detail ...

Still, Shapes can't contain methods, only method interfaces, and I need them. I am sure my decision is not the wrong one. Even if Shape is an interface (which is not relevant for now) the previous problems I were pointing would still be valid.
I need a fix for this.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 07-27-2009, 12:34 AM   #2157
Dark_Dragon
User
 
Dark_Dragon's Avatar
 
Join Date: Apr 2008
Posts: 191

Dark_Dragon has little to show at this moment (9)

Default

Quote:
Originally Posted by Flame_Phoenix
Btw, one questions, is it possible for a struct A to extend a Parent struct AND an interface ? If yes, how can I do that?

Collapse JASS:
struct A extends Parent, AInterface
endstruct

This does not work =(

Collapse JASS:
struct A
  delegate Parent deleg1
  delegate AInterface deleg2
endstruct
__________________
Undefined shadow...
Dark_Dragon is offline   Reply With Quote
Old 07-27-2009, 12:40 AM   #2158
daPanda
User
 
Join Date: Jan 2009
Posts: 28

daPanda has little to show at this moment (0)

Default

I have a few questions about allocation if someone could clarify plz.


on another forum I was reading a post about global structure allocation. someone had posted the following:

Collapse JASS:
struct Branch   
//data
endstruct

globals   
Branch array STBRANCH[500]
endglobals

function test takes nothing returns nothing
   set STBRANCH[1] = Branch.create()   
   set STBRANCH[2] = Branch.create()
endfunction

someone replied that the calls in the function to create each array element wasn't necessary because global array elements don't need to be created or destroyed.

another person in the same thread also said that the following is also legit without allocating it each array element:

Collapse JASS:
struct name extends array
     real x
     real y
endstruct

function bla takes nothing returns nothing
     set name[1].x = 5.
     set name[2].y = 6.
endfunction

without even having to declare a global var or allocate each element.

but, when I try to do this, the data I store is unstable. I can't see anywhere in the output code where name[1] or name[2] is assigned a pointer (allocated) with the above code "as is".

In my mind, it seems necessary to do the following first before using the above:
set name[1] = name.create()
set name[2] = name.create()

I've always done it this way (allocating each array element). When I tested the above by removing the .create() from my global struct array elements, the data is unreliable.

are they correct in saying that the array elements don't have to be allocated manually if they are global struct arrays? I mean, I know they array itself is allocated (obviously) but each element is allocated as well?

their statements have me confused.

thanks for your input

Last edited by daPanda : 07-27-2009 at 02:34 AM.
daPanda is offline   Reply With Quote
Old 07-27-2009, 01:01 AM
Litany
This message has been deleted by Litany.
Old 07-27-2009, 03:17 AM   #2159
ToukoAozaki
extends net.wc3c.Jasser
 
Join Date: Jun 2008
Posts: 336

Submissions (5)

ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)

Send a message via MSN to ToukoAozaki
Default

Suggestion: I hope there were means to manipulate wts strings inside vJass code, like this:

Collapse JASS:
//! externalizestring name content [locale|localeid]
//! externalizestring externalfilename

// so that
//! externalizestring MESSAGE "Peace! Through! Power!"
//! externalizestring MESSAGE "무력에 의한 평화를!" 1042
//! externalizestring MESSAGE "武力による平和を!" ja-jp
// produces something like
globals
    wtsstring MESSAGE = 899
endglobals
// which is automatically compiled into something like GetLocalizedString("TRIGSTR_899") when assigned to a string.
// the type should be constant like key.

// For proper localization, most users would heavily depend on external files like slk.

Last edited by ToukoAozaki : 07-27-2009 at 03:25 AM.
ToukoAozaki is offline   Reply With Quote
Old 07-27-2009, 08:35 AM   #2160
Barade
User
 
Barade's Avatar
 
Join Date: May 2006
Posts: 164

Barade is on a distinguished road (14)

Default

Line 62438: memory exhausted.
wtf?!
Yeah, this wtsstring stuff would be very very useful. I've already started writing a tool which replaces strings in user-defined function calls like GetLocalizedString by expression STRING_id and creates a kind of fdf string file. Unfortunately my custom fdf file (path UI\FrameDef\GlobalStrings.fdf) did not seem to work.
Natives in map script do not work?
I've used some RtC natives and when I clicked on the map in Warcraft's map list nothing appeared and I was unable to start a game.

edit:
Best way to solve internationalization in Jass would be to replace:
Collapse JASS:
GetLocalizedString("Bla bla bla bla")
by
Collapse JASS:
GetLocalizedString("TRIGSTR_<Id>")
and adding TRIGSTR_<Id> to map string file when creating the map script like trigger editor does. Don't know if strings have to be resetted in custom map script when opening the map again since I use external code files. Maybe an external string file solution would be useful, too.
__________________

Last edited by Barade : 07-27-2009 at 09:11 AM.
Barade is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services