• 0

    posted a message on return array?
    Quote from pixartist: Go

    @BlinkHawk: Go

    so why do functions offer arrays as return values ?

    edit: btw, most modern languages in fact allow returning arrays. Only low level languages like c don't allow this, but you can get around that by using structs (and i'm pretty sure you can directly return structs in c, not just pointers)

    First C isn't a low level programming language, it's a high level programming language. LLPL are x86, MIPS, PowerPC, ARM, etc arquitectures and they work quite different than galaxy, C or JAVA.

    second, an array is actually a hidden pointer(in the case of galaxy and C). It's the pointer to the start direction of the memory assigned to that array. In JAVA, it is an object (a reference to a struct). In other words the function is only returning the direction.

    third, indeed you can return structs in C, this could be the 'exception' as it uses the computer's STACK to do so, which is less efficient than returning the pointer to that struct. However, we are talking of Galaxy, not of C. In galaxy, you can't return structs only native types and arrays, so that's it. Oh and as I said before, you can't return more than 1 value.

    Posted in: Miscellaneous Development
  • 0

    posted a message on return array?
    Quote from pixartist: Go

    @pixartist: Go help :(

    You can't. In fact in most programming languages you can't return more than 1 value. Before patch 9 of beta you could have used pointers to pass variables by reference and modify them, but they were removed by unknown reasons. (Still haven't tested if release sets them back).

    You will have to work around using global variables or some way to pass those values back.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Spoilers] New models
    Quote from SunflashX088: Go

    Did anybody else notice Diablo?

    yeh and a murloc marine, he appears in tosh's first mission as an easter egg.

    Posted in: General Chat
  • 0

    posted a message on Sc2 Singleplayer Secrets (Possible Spoilers)

    in the lava world (Tosh's first mission) where you have to harvest 8000 high yield minerals, you'll find Diablo lord of terror in the southeast. You'll need to use a flying command center to see him.

    Posted in: General Chat
  • 0

    posted a message on [Spoilers] New models
    Quote from zifoon: Go

    @BlinkHawk: Go

    well, the models say "Dark"

    And yes there is a dark archon but it's not exactly DA from SC1

    well if you play the campaign, you'll notice that they appear in a mission in which they are corrupted and are controlled by [low spoiler alert!] some being.

    Look into zeratul's memories mini campaign.

    Posted in: General Chat
  • 0

    posted a message on M3 Exporter

    @tigerija: Go

    it will detach them according to your smooth groups. It will also check for unwraps.

    Posted in: Third Party Tools
  • 0

    posted a message on M3 Exporter
    Quote from tigerija: Go

    Can someone tell me something about smoothing groups in SC2 ? There are quiet a pain in the ass. Normals and shading is strange in SC2 as I change smoothing groups. Best way is to deattach polys. Same as Wc3...

    easier is to export the mesh as .3ds and reimport it back, rather than detaching polies.

    Posted in: Third Party Tools
  • 0

    posted a message on [Spoilers] New models
    Quote from Lonami: Go

    Some pics of the dark protoss would be great, as well as of new buildings :P.

    @vjeux: Go

    Yeah, awesome xDDD.

    they are actually corrupted protoss, not "dark" protoss as zeratul.

    Btw, there's no reaver model in the editor, nor in the assets. It may have been removed before release. However, there's an scout model.

    Posted in: General Chat
  • 0

    posted a message on An annoying trend within the SC2 mapping community

    well you can always use an MPQ editor once he releases his map to learn of it ;).

    Plus you guys know the say: "A good wizard never reveals his secrets". The ugly truth, isn't it?

    Posted in: General Chat
  • 0

    posted a message on Battle.net updates for the download of SC2 client~

    @ZenoFrozen: Go

    exactly, it's impossible for them to decrypt those MPQE

    according to what I read, the encryption algorithm is called Salsa20. These algorithm requires a 256 bits key which is no where found in the installer, probably it's sent by blizzard servers when you try to install it. The thing is they can't brute force a key because they would need to try 2^256 combinations, which is near impossible to find in a human's live spam, making it even funnier.

    Anyways, 1 day to go :D.

    Posted in: General Chat
  • 0

    posted a message on An annoying trend within the SC2 mapping community

    the second of your examples is actually contradictory to what you said. He showed how it was done and which values he tested.

    Posted in: General Chat
  • 0

    posted a message on Anyone here is intermediate at C programming?

    Let me correct you all.

    first variables in C and C don't start on their identity (0), they start with the data originally in the static memory or stack (depends if they are locals or globals), so it can be anything. However, some C compilers will reserve the memory as 0.

    second, the proposed algorithm will get you the power plus one, but it won't get you Base^Power.

    Here, I have fixed up your algorithm and I have added some propositional logic to help you out note some things.

    int main()
    {
    	/** Calculates the natural power of any base.
    	 *
    	 * @pre Power >= 0;
    	 * @post (%product i | 0 <= i < Power : Base) == Total
    	 */
    	float Base, Total = 1.0;		// if a variable is not initialized in C, it may not
    	int Power, x;				// contain 0 but instead the value which was originally
    						// in memory (means other value used before by other program).
    	// try this:
    	// printf("%d", Base); // it may print a random value if your compiler does not set reserved memory as 0.
    	printf("Input the base: ");
    	scanf("%f", &Base);
    	printf("\nInput the exponent: ");
    	scanf("%d", &Power);
    
    	/// @assert 0 <= Power
    
    	/// @invariant 0 <= x < Power &&
    	///				Total == (%product i | 0 <= i < x : Base)
    	/// @variant Power - x
    	for (x = 0; x != Power; x++)
    		Total = Total * Base;
    
    	// it's more eficient to use only one printf call.
    	printf("%.2f^%d is equal to %.2f\n", Base, Power, Total);
    	system("PAUSE");
    	return 0;
    }
    

    And here's the code for any Power:

    int main()
    {
    	/** Calculates the natural power of any base.
    	 *
    	 * @pre ((Base == 0) ==> Power > 0)
    	 * @post ((Power >= 0)==>(%product i | 0 <= i < Power : Base) == Total) &&
    	 *       ((Power < 0)==>(%product i | 0 <= i < -Power : 1/Base) == Total)
    	 */
    	float Base, Total = 1.0;		// if a variable is not initialized in C, it may not
    	int Power, x;				// contain 0 but instead the value which was originally
    						// in memory (means other value used before by other program).
    	// try this:
    	// printf("%d", Base); // it may print a random value if your compiler does not set reserved memory as 0.
    	printf("Input the base: ");
    	scanf("%f", &Base);
    	printf("\nInput the exponent: ");
    	scanf("%d", &Power);
    
    	if (Power < 0) {
    	    Base = 1.0/Base;
    	    Power = -Power;
    	}
    
    	/// @invariant 0 <= x < Power &&
    	///				Total == (%product i | 0 <= i < x : Base)
    	/// @variant Power - x
    	for (x = 0; x != Power; x++)
    		Total = Total * Base;
    
    	///
    	printf("%.2f^%d is equal to %.6f\n", Base, Power, Total);
    	system("PAUSE");
    	return 0;
    }
    
    Posted in: Off-Topic
  • 0

    posted a message on Anyone tried WASD online in phase 2?

    I tried it in waterworks using faster speed settings and, the delay was bad. Then I tried again using normal speed and the latency was decent and playable.

    Maps with TPS or WASD should be locked to normal speed settings and should be designmed to work fast with such settings.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Can you beat the Very Hard AI 1vs1? Show me!
    Quote from MTops: Go

    @YiffMaster: Go

    I received a replay from a friend of mine with the same worker harass strategy you just described. And it was indeed sad to see how poorly the AI responded. So that one is definitely on the list.

    @BlinkHawk: Go

    Do you have a replay of that?

    quite late, already desinstalled the beta. However, it's easy to reproduce, just tech fast a supply depot and a barrack, make 1 or 2 marines and get the best position in their base entry to make bunkers. As you make them you keep filling them with rines and meanwhile you tech for siege tanks and some extra AA. then you bring the siege tanks and finish the job.

    Posted in: General Chat
  • 0

    posted a message on Curious about "pre-release" digital dl and GE
    Quote from Sixen: Go

    That's correct. There were changes to the Live Editor that did not make it into the Beta. However, keep in mind, they can always release a patch on the first day of Live if they make major changes within the Game Data...

    that's for sure, remember that the full game copies were made by the end of beta phase 1(or before, not sure how much it takes to make the physical product), all the changes made after must be added through a patch.

    Posted in: General Chat
  • To post a comment, please or register a new account.