Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Crimson Wizard

#12881
Quote from: JJS on Fri 24/08/2012 17:30:07
Still, for true encapsulation of the whole debug output method an event system is necessary.
Do you plan making each game entity send event messages, or something simplier (or totally different)?

Meanwhile, updated refactory from main.
Tested in a small game, new roomstats code looks working so far.
#12882
Yeah, there's some debug console in AGS already, as it looks like from the code, but funny thing is I don't remember ever seeing it in work.
CConsoleOutputTarget class is supposed to write there, but to my shame I now recall I haven't tested that.

As for errors in output system - well, I'll certainly recheck everything there.

EDIT: @JJS, yeah you are right about SAFE_DELETE. Dunno how I missed that one. Thing is that delegate is deleted both from destructor and also out::shutdown()
#12883
Quote from: JJS on Fri 24/08/2012 14:54:10
Anyone opposing a beautifying of the whole code? I mean running a tool over it that cleans up the formatting.
Heh, I was arguing about this with Alan v. Drake some time ago :).
My main argument against doing that was that I have to copy changes from 'main' branch.
But since a) we are about to move to refactored code anyway, b) it does not look like we are copying any big changes (and any changes at all) from "official" SVN or elsewhere, c) it is actually unknown how long it will take to rewrite everything --- I think my argument does not have much weight anymore.

Quote from: JJS
Edit: I am still trying to build for Android, but the toolchain really likes to mess with me... The linker gives an undefined reference error for a symbol that is clearly defined in a source file that gets build. :-X
Edit2: Are you kidding me? The file is shown as being successfully built while in reality the compiler creates an empty object file.
That sounds similar to Visual Studio bug that could not compile the second file of same name but compiled the first one instead :) Don't know if the reasons same though.

BTW, again about debug output system I mentioned above. Have anyone looked at it? I want to merge last changes from main to refactory on this weekend. If there are no objections I will also copy output system there.
#12884
I am sorry for this may seem a dumb question, but do you click on the second button in the exactly same situation as when you clicked on first?
The script makes character change the room. Do you click on second button when the character is in the other room?
#12885
Quote from: BrightBulb on Fri 24/08/2012 13:43:49
I'm not quite sure if I understand you correctly.
I mean I did the same as you did, according to your explanation in the first post, and I have no error. I mean, there is possibly some other factor that causes this error.

Quote from: BrightBulb on Fri 24/08/2012 13:43:49
In my case I actually want both GUIs/buttons to run the same script.
Yes, that's what I did and it worked.

Earlier you said:
Quote
also tried linking the second button to its own script, but it just doesn't react
Do you mean you were unable to link second button to its own script, or that nothing happens when you click on it?
BTW, what version of AGS do you use?
#12886
Just for information, I made similar thing: exported existing gui and imported it back as a copy. Both have buttons which reference same function. Both buttons call that function when clicked.

There must be something else.
#12887
Quote from: Armageddon on Fri 24/08/2012 06:26:37
Also I have added more mouse modes but hotspots/objects won't show anymore than the two usermodes.
They won't. AGS can't do that (unfortunately).

Quote from: Armageddon on Fri 24/08/2012 06:26:37
How do you check what mouse mode is processing?
By reading manual :P
http://www.adventuregamestudio.co.uk/wiki/?title=Mouse_functions_and_properties#Mouse.Mode
#12888
It is CRect then! (with overrides for whole bmp blt).

Quote from: JJS on Thu 23/08/2012 14:19:43
I am still in the process of making the refactoring branch compile for other platforms. At the moment I am taking care of Android. There is a very annoying bug in the Android toolchain that makes it impossible to include "debug/debug.h". Instead of using the files in the user include path it will include the respective file from the standard library (wrong) So I have to rename the file. Any suggestion for a new name? Maybe "debug/agsdebug.h"? I know this is stupid, but I cannot help it.
The 'debug/debug' unit contains logging functions and helper functions that communicate with Debugger. In such case I propose to move logging functions to 'debug_log' and debugger helpers to 'debugger'.

Quote from: JJS on Thu 23/08/2012 14:19:43
Also I am strongly considering switching development to the refactoring branch. The original code is a mess and it gets worse every time I hack something in. An additional benefit would be that the refactored code is actually used and therefore checked for errors.
Makes good sense. I am already finding some minor mistakes I did. :/

Quote from: JJS on Thu 23/08/2012 14:19:43
- Replace the debug output system ASAP because it is a hassle to do debug output in a lot of files since they don't have access to the platform header and VS only understands OutputDebugString while *x*-like stuff needs printf and Android again its own thing and then my head explodes.
I posted this a while ago: http://www.adventuregamestudio.co.uk/forums/index.php?topic=46290.0
Any thoughts on that?


Regarding myself, I switched back to work in my personal repository because what I do now is making several parallel branches at once (replacing strings, file streams and bitmaps with new classes) and I do not want to clutter adventuregamesstudio repo. Later I'll merge them in one and pull to central refactory branch.
I'm taking tzachs's advice about little step, although that may mean some of the code I do now will be later replaced once again.
#12889
Are there any benefits in using structs when passing coordinates to drawing functions?

Random examples:
Code: cpp

CBitmap::DrawRect(CRect &rc, int color);
CBitmap::Blit(CBitmap *bmp, CRect &rc_src, CRect &rc_dst);


As I see this, advantages commonly are: the parameters are grouped and hence it is easier to understand what's what, less likely someone will make a mistake.
On other hand, this makes writing little longer when you can't use struct right away and have to init CRect right at function call, some may say this makes code more cluttered.
What do you think?
#12890
The Rumpus Room / Re: It's THE second Coming
Wed 22/08/2012 21:30:38
The Rumpus Room was either a mistake or the craddle for the new genre in adventure games.
Centuries later people will study those threads, arguing whether they are evidence of ingenious stupidity or the burst of inspiration.

*cough*cough*

Quote from: LimpingFish on Wed 22/08/2012 21:06:39
What did I just smoke? :shocked:
#12891
Quote from: ig299 on Wed 22/08/2012 01:21:18
But is there a code to shrink it or shall i do it myself?
ig299, Khris already gave you an example to how shrink it. It was written above, but I'll repeat what he said:

Code: bbcode

[img width=800]http://i.imgur.com/sR6Rx.jpg[/img]


See that "width=800" part? It determines the target width of you image in pixels.
I would suggest use different number though since 800 seems too big too. What about "width=400"?
Here how your image looks like when that code is used:
Code: bbcode

[img width=400]http://i.imgur.com/sR6Rx.jpg[/img]




EDIT: I didn't realize moderator has already fixed the image size in the first post.
#12892
Site & Forum Reports / Re: Website security
Tue 21/08/2012 23:21:29
SHA512 is good, but what about SSH encryption?



:tongue:
#12893
I am not sure I understood everything what was said here, but the situation about long unemployment sounds a bit familiar.
I had similar thing some time ago; I couldn't find a job for a long while (later I realized I did certain mistakes, but that's irrelevant), and when I finally did and thought the "unlucky" period is over, it turned out to be the worst job I ever had and that nearly drove me mad :/.
The anger mixed with self-overcriticism resulted in a long depression that lasts till now (I think it starts to weaken...), even though I changed to much better job already.
The details are personal and particular, I guess. For me the only thing that could improve my mood was making something for others and, especially, with others, the feeling that I and what I do is actually useful to people.

Don't know what happens with you, monkey, and how much it is same, thought I'd mention this... just in case.
#12894
Quote from: Khris on Tue 21/08/2012 06:27:10
Yes, but what I do is break it down into chunks and put them in their own functions:
Code: ags
function repeatedly_execute() {
  HandleMovement();
  UpdateScreen();
}

Also, I think I'd mention this: you may break your code into separate modules and make "repeatedly_execute" in every of them (if needed). AGS allows to make "standard" global functions like game_start, repeatedly_execute, on_mouse_click and some others in every module. I think they are called in the same order as scripts are listed in the project trees, e.g. first "repeatedly_execute" from the upper script, then from the second script and so forth.
#12895
Quote from: monkey_05_06 on Mon 20/08/2012 13:11:45
well way to derail a thread guys. so much for trying to be serious about this.
Well, I don't take life seriously anymore. I am having this ongoing depression for about couple of years now, and can't get rid of this feeling of absurd when I watch how people live (including myself).

If you hurt someone (just a guess based on "selfish jerk" stuff), then apologize and try to improve the situation. That's the only thing I can say.
#12896
ig299, no offense, but I'd recommend you to first study how scripts work in AGS in general before asking such question.
Secondly, try to understand what this code is supposed to do.
Then, there's a chance you will know where to put it without our help. Or maybe you'll write your own, even better code.
BTW is it your code? Sorry if it is and I am mistaken.
#12897
Moving view around regardless character's position is done with the use of SetViewport function.
http://www.adventuregamestudio.co.uk/wiki/?title=Room_functions#SetViewport
#12898
Quote from: Armageddon on Mon 20/08/2012 08:44:03
Well it's going to be a radio dial thing, so an actual bar that fills up isn't what I want, and since you can use your own graphics in a GUI Slider it should look good?
Ah, right, you can have your own graphics for slider too.
I just thought raw drawing is worth to be mentioned.
#12899
Quote from: ArmageddonI can't find anything in the help guide about how to do a timer
Yeah, it is put into "global functions" sections, may be a bit confusing. http://www.adventuregamestudio.co.uk/wiki/?title=Game_/_Global_functions#SetTimer
Anyway, kconan explained how to use it already.


Quote from: ArmageddonI'm thinking something about setting the slider
What about drawing the progress bar using raw drawing instead? That may look much prettier.

One of the ways to do that is to create a DynamicSprite from the sprite you are using for GUI's background (if you aren't create one transparent one with the size of GUI). Or, optionally, you may put button with no on-click handler.
So, you create a DynamicSprite at the game start and assign that new Dynamic Sprite as either the whole GUI or button's background (depending on your choice):
Code: ags

DynamicSprite* glProgressBarSprite; // this MUST be a global pointer, otherwise the sprite is released as soon as function ends

function game_start()
{
   ...
   glProgressBarSprite = DynamicSprite.CreateFromExistingSprite(SPRITE_ID);
   gGUI.BackgroundGraphic = glProgressBarSprite.Graphic;
   // or
   gProgressButton.NormalGraphic = glProgressBarSprite.Graphic;
   ...


Now you basically can draw upon the dynamic sprite anytime you want, and the GUI graphic will change.
Example code:
Code: ags

function OnScoreChanged()
{
   DrawingSurface *ds = sprite.GetDrawingSurface();
   ds.DrawRectangle(0, 0, 1 * game.score  10); // fill rectangle, which width depends on current game's score
   // you may apply more math here, like calculating percent of total score and take maximal progress bar size into consideration
   ds.Release(); // release drawing surface when finished drawing
}

You may draw using basic graphics and/or draw sprites.
#12900
A bit offtopic, but Sprite Font sounds like a good candidate for a new engine feature, rather than being separate plugin, don't you think?
SMF spam blocked by CleanTalk