Recent Posts

Pages: 1 ... 8 9 [10]
91
Outpost 2 Divided Destiny / Re: Outpost 3 Alpha Testing Commencing
« Last post by Zhall on October 07, 2017, 12:41:43 AM »
Fistoz and I had a match.



We found some issues, and ill be working on them eventually.
92
Game Discussion General / Re: Cataclysm of Chaos V5
« Last post by lordpalandus on October 06, 2017, 05:31:20 PM »
Nothing would happen if I eliminated the first one. In the UI, the function call itself looks quite different than the one in the msg. It looks the same in code view, but if I omit the first one, then no function call occurs.

The "then" may or may not be present I can't remember. I deleted the function call when I found out it didn't do as expected and moved on. All I know for sure was that it was a if-else statement with only the if code block filled with code.

Spells are coupled with the Spellbook. Technically they do not exist, they are just string placeholders, with a specially designed series of functions that actually are the spells. So when you type cast arcane zap, the spell arcane zap is just a series of string variables and then in a different spot, the string is used in a switch statement to determine the correct numerical code to be used. Its a very complex and difficult beast, but it works.

Spellbook is a separate object, that is added to the player's inventory at game start.

Yeah, I dunno. I'll have to think on why one way worked and the other didn't some other time. Going out for supper with a friend, so can't type much at the moment.

EDIT: After a bit of work, I determined how to do my Bad Traits system for my game, and implemented them for the first 5 investigatables (corpses excluded, so that you can always search those corpses for lore!)
93
Game Discussion General / Re: Cataclysm of Chaos V5
« Last post by Hooman on October 06, 2017, 01:55:49 PM »
Interesting. You seem to be calling the function SpellPurchase twice. What would happen if you eliminated the first call, so only the second call embedded in the msg call was used?

Looking at your if statement, it looks to be doing an assignment of false to Spellbook.KnowArcaneZap, rather than a comparison. In JavaScript you need a double == sign for comparison. Though the "then:" part is not proper JavaScript syntax. Something weird is going on here. Is this a non-JavaScript code display? In VB syntax, a single equal sign would perform comparison, so that if code could make sense using the syntax of a language other than JavaScript.



Syntax oddities noted above aside, have you considered a function that works like:
Code: [Select]
SpellPurchase(player, spell)
msg ("You purchase the spell and your current soul shards are = " + player.SoulShards + ".")

Here the player object is passed to the function, allowing the function to update both the spell book (assuming the spellbook belonged to the player object, though I suspect this might not be true in your code), and the player's money.

There is no second call in the msg statement. It simply outputs player.SoulShards, which should have been updated by the previous call.



As for int ShardCost;, that would be valid C++ syntax yes, but not valid JavaScript syntax. JavaScript would use var ShardCost; to declare a variable. JavaScript doesn't use static types, so there's no way to declare a type when you define the variable.
94
Game Discussion General / Re: Cataclysm of Chaos V5
« Last post by lordpalandus on October 06, 2017, 11:02:36 AM »
In Quest there is a button in the interface called "Code View". I clicked on it and copied verbatim all the code in the function call itself.

ShardCost is a local variable, and yet it is odd that it lacks the variable type before it; ie = int ShardCost; as a variable declaration within the function body.

...

SpellPurchase(player.SoulShards)
msg ("You purchase the spell and your current soul shards are = " + SpellPurchase(player.SoulShards) + ".")

...

The calling function is SpellPurchase. The code I showed before is all the code within the function call.

Then the msg afterwards tells the player what their current soul shards are. The SpellPurchase(player.SoulShards) is the value returned by the function call.

///

The calling function has no issues and nor does the msg afterwards, if the code in the function call is of the version that worked, it will properly display in the message that your current soul shards are now 200. Otherwise, it sets current soul shards to 0, and spews an error.

There is no other code present to show you. I'm not holding anything back. Unless there is code hiding elsewhere in the codebase, outside of the function call or the calling function, then all the code presented is all the code.

EDIT: I forgot to mention that it was part of an If-Else statement.

If (Spellbook.KnowArcaneZap = false) then:
{
  ShardCost = 100
  Spellbook.KnowArcaneZap = true
  return (CurrentShards - ShardCost)
}

With no else. Thus if you knew the spell, nothing would happen.
95
Game Discussion General / Re: Cataclysm of Chaos V5
« Last post by Hooman on October 06, 2017, 02:11:14 AM »
Can you include the calling code and function signature too. And is this copy/pasted, or retyped code? I ask because these errors are often the result of very hard to see typos.

I'm noticing there is no "var" before any variables, so they seem to be declared elsewhere, possibly as function arguments.

The problem is most perplexing. I feel there is something missing here.
96
OutpostHD / Re: Linux Data Folder Issue
« Last post by Hooman on October 06, 2017, 01:51:08 AM »
On debian/ubuntu, you should replace `sudo make install` by `sudo checkinstall` so that the package is tracked by the packet manager and you don't end up with random files spread around your filesystem :)

Thank you for that! I'm wondering now if this can be used to speed up the TravisCI tests. A lot of the time is spent on the SDL2 compiling. Though the .deb packages would need to be hosted somewhere and downloaded by the test VM to install from. Not sure how appropriate it is to put them in the repo itself.



... enough, at least, to google them.

That's all that really matters  ;)

But yeah, that's the big glaring thing in the Filesystem code that's been bugging me for awhile.

I've been finding myself hesitant to make changes to your code. I think this will be a breaking change, in terms of source code interface compatibility. It's got me wondering about intent, and what your design goals are. It seems like PhysFS handles the default common case well. Could just delegate stuff to PhysFS without much change in semantics or complicated wrapping. Not sure if you're trying to build any restrictions or abstractions on top of it.

I think the PHYSFS_setSaneConfig does exactly what you want. It sets a read path where the executable is installed, allowing you to load game assets, and a read/write path in an appropriate subdirectory of the user's home directory, for things like saved games, or user specific config.

The one difference I think I see, is you seem to be adding subpaths to where the executable is installed, whereas the default is the parent folder containing the executable. I think perhaps the default config makes a lot of sense, and path to assets can be adjusted to include the subfolder.

Oh, and the setSaneConfig method can also search the read folder for archives with a given extension, and automatically add them. That can save you from manually specifying archives to load, and also eliminate error messages from adding archives you haven't created yet.

If a game doesn't want the default config, maybe the initialization of PHYSFS and the config of folders should be split into separate methods. Or maybe the default can run, but can be cleared or undone later. Or maybe you just want to disallow that, and say the default config should be good enough for any game likely to be created using NAS2D. Which might actually be very true. I'm thinking just stick with what setSaneConfig provides and not worry about it.


I was thinking the Filesystem::init could be something like this:
Code: [Select]
void Filesystem::init(const std::string& argv_0, const std::string& organizationName, const std::string& appName, const std::string& archiveExt)
{
if (FILESYSTEM_INITIALIZED) { throw filesystem_already_initialized(); }

std::cout << "Initializing Filesystem... ";

if (PHYSFS_init(argv_0.c_str()) == 0)
{
throw filesystem_backend_init_failure(PHYSFS_getLastError());
}

if (PHYSFS_setSaneConfig(organizationName, appName, archiveExt, false, false) == 0)
{
std::cout << std::endl << PHYSFS_getLastError() << std::endl;
}

FILESYSTEM_INITIALIZED = true;

std::cout << "done." << std::endl;
}

Was also thinking some of those messages might be more appropriate for cerr rather than cout. Not that it much matters for a graphical application.
97
OutpostHD / Re: Linux Data Folder Issue
« Last post by leeor_net on October 05, 2017, 03:14:53 PM »
I assume you meant apt get, in which case, thank you. :P

Yus... you see how much experience with Linux I have. I sort of know the commands but not quite... enough, at least, to google them.

And huh, I didn't realize it was so early in the game. But yeah, that's the big glaring thing in the Filesystem code that's been bugging me for awhile.
98
Outpost 2 Divided Destiny / Re: Outpost 3 Alpha Testing Commencing
« Last post by Zhall on October 05, 2017, 02:17:58 PM »
I'll hit you up on American and Europe battlenets.

lasers are op, and they use a hacky work around in order to operate.

Cargo trucks cannot even be selected once they are on route, giving any commands at so will remove them from the route.
99
Game Discussion General / Re: Cataclysm of Chaos V5
« Last post by lordpalandus on October 05, 2017, 10:27:46 AM »

At this point, most of my coding needs are met with the UI, so I see no point in bothering with messing with JavaScript. It'll just be time away from developing, like pointless refactoring.

===

Okay, I'll reiterate. One way worked and one way didn't and the difference between the two code snippets is a minor change. Here is the original code (This way borked):
{
  ShardCost = 100
  CurrentShards = CurrentShards - ShardCost
  Spellbook.KnowArcaneZap = true
  return (CurrentShards)
}

(This way worked):

{
  ShardCost = 100
  Spellbook.KnowArcaneZap = true
  return (CurrentShards - ShardCost)
}

It is a minor change, in the syntax. One way does nothing, spews an error, and nulls my Soul Shards. The other properly subtracts 100, and returns 200 to my soul shards and doesn't spew an error. The only change I made to the function call was moving the subtraction into the return value, and that made it work. Any other way of doing the function call borked. Explain why.

===

Honestly, I just use function calls to make the code easier to read at this point or reduce code redundancy. I'll likely tackle a something with a deeper concept if I run into a more complicated problem in the project OR in a different project.
100
Outpost 2 Divided Destiny / Re: Outpost 3 Alpha Testing Commencing
« Last post by fistoz on October 05, 2017, 10:21:02 AM »
Yeah BliČ separates his game servers in regions.
Couldn't find the map on EU, but tried it on 'murica :)

As posted as game review IG :
Quote from: fistoz
Still alpha, not much to say ofc, but at least there's already one thing every Outpost 2 players dreamed about : vehicles fluidity and efficiency on movement !
So many years of improvements from OP2 to SC2 ^^

Few things I could mention even though it's only starting :
- cargo trucks are stopping their mine-smelter route when path is a bit block (ex. if your vehicle factory create some in the path, or if you hold position on it)
- laser lynx a bit OP atm. Shooting everything from afar while moving xD
- not sure if they aim correctly at manual target, seems like they prefer tubes or near vehicles first
- a separation between fighting and utility vehicles could be useful later on (F2 army selection, hehe)
- AI not working yet (well.. have fun to make it adapt to the new gameplay somehow :p)

Promising/interesting :D

Didn't test it in multiplayer yet. Just tested 5-10min vs an (afk ^^) AI

If you want to try things, I'm kinda connected 24/7 so feel free to ask ;) (I'm in France though, may not always be ready at your hours, but try anyway)
My Bnet tag : fistoz #2528
e/ Seems like Bnet app uses separated friend lists as well :/ Oh well, I'll keep an eye on it anyway !
Pages: 1 ... 8 9 [10]