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 - Scorpiorus

#2061
Quotehow'd you stumble across that fix?? lol
well, I had a script where the interface was being disabled inside the repeatedly_execute():

function repeatedly_execute() {
if (.......) DisplableInterface();
}

or something similar... then on some event I was enabling it again but the game didn't respond so I  was going to check out it this way:
DisplableInterface();
DisplableInterface();
EnableInterface();

As far as I figured out what's wrong I changed the script adding if (IsInterfaceEnabled()==1) condition statement.

so that is ;)


-Cheers
#2062
We need somehow to retrieve the frame by frame with converting into bmp and display. :P
#2063
Interface problems:

CJ, I am not sure if it's a bug, just want to inform you http://www.agsforums.com/yabb/index.php?board=6;action=display;threadid=6299

-Cheers
#2064
Oh, completely forget about interface problem:

I already encountered similar problem... a month ago

if you disable interface three times (for example) you need to enable it three times as well:


DisableInterface();
DisableInterface();
DisableInterface();

EnableInterface();


interface is STILL disabled!


DisableInterface();
DisableInterface();
DisableInterface();

EnableInterface();
EnableInterface();
EnableInterface();

and the above script works fine. Interface becomes enabled.

Some my suggestion before disabling interface check if it's realy enabled:

Just replace each line: DisableInterface();
With: if (IsInterfaceEnabled()==1) DisableInterface();

not sure if it's a bug or it is the mechanism by means it should  work (remember disabling level :P)

-Cheers
#2065
Quoteor would it be easier to just script the whole game in flash instead?
I think it would be easer do that way. :P

Also there is the thread about flash animations: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=6014. There are some implementing & time consumption problems though.

-Cheers
#2066
I understand why you are asking this however it's not technicaly trivial (maybe even impossible now) to apply such transformations to the characters/objects, because I suppose you want them still to be interactable. :P Some workarounds possible but I don't like them.

And you still can rotate them using some paint program then just import in AGS.

Also such real-time transformations by AGS could(would) slowdown the game.

-Cheers
#2067
That is actually why I decided to write the CCS plugin. Here is the thread where I had a talk with junc about the same thing: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=2959
You can see there that making the character perform a couple of actions took about 40 lines of code. And it just for one sequence! And those IFs......
Yep, the only possible solution to make such things is to write amount of IF statements. It's ok when you need it to happen only in one room but when not? So, yes, juncmodule had used CCS plugin instead. The plugin interface isn't perfect but anyway it does its job. Atleast it keeps the repeatedly execute function clean. :)

QuoteBut maybe I'll just have it so the game pauses, I haven't fully decided yet.
Years ago playing different quests I always wonder  why in some games you can't perform actions while the NPC is doing something. Now it's eviden why developers block the player (SpaceQuest). ....because when I would like to check what happens if I exit the room just before the NPC does. ;D

-Cheers
#2068
I just have a test and figured out the next:
When you start the dialog (using RunDialog() or through the interaction editor) AGS saves the current cursor mode and changes it to the arrow.
And when the dialog was finished it restores previously saved mode.

You place it inside dialog_request(), right? But when the dialog_request() is running the dialog itself hasn't ended actually. It will be just after dialog_request() has finished executing. Therefore it overrides the mode was set. (with MODE_TALK in your case):

Sequence:
==========
1. Run the dialog and save current mode (MODE_TALK)
2. On choose option run dialog_request()
3. SetCursorMode(MODE_"ARROW"); dialog is still running
4. GUIOn(...)
5. Ruturn from dialog_request(); dialog is still running
6. End dialog on stop command and restore saved mode
So we have MODE_TALK instead.

Quote'm thinking of changing mouse cursor before i run the dialog, then changing it again afterwards. that should work ( i think)
Yes, that is. Also you can set the mode just after the dialog has ended:

dialog script:
@2
run-script 1
stop


Global script:

int TimeForShopping = 0;
function dialog_request (int value) {

if (value == 1) {
   TimeForShopping = 1;
}

}


function repeatedly_execute() {

 if (TimeForShopping == 1) {
       SetMouseCursor(6);
       GUIOn(...);
       TimeForShopping = 0;
 }

}

-Cheers
#2069
QuoteEnableInterface(2);
NEVER works, i repeat NEVER, always gives me parameter errors when i try to run the script. heres the script anyhow.
Because it does take no parameters at all:

EnableInterface ()

Re-enables the player interface, which was previously disabled with the DisableInterface function. Everything which was disabled is returned to normal.

Just EnableInterface(). Looking at you script I guess you thought that it enables GUI#2 for the player to control. No, if you disable interface all GUIs become inactive. There was a misunderstanding in terminology. While the whole interface is an ability for the player to control the game, the GUIs are windows with buttons, labels, textboxes etc... Just a user menues in other words.

QuoteOK i've made a new character... it contains one frame of one loop, which is indeed a ball sprite. I've also set it to load in the particular room i want and it appears... though obviously stays still.
now what?
Now goto the room editor and draw a walk-able area as I already said then set it's scaling parameters.

Next goto character panel, place a ball character just under that walkable. You have to enter appropriate co-ordinates (use mouse pos label in the room editor to find out what co-ordinates you need to set)

Next open script editor and write MoveCharacter() command. Using Player enters screen iteraction for example:

function room_*() {
// script for room: Player enters screen (after fadein)
  MoveCharacterDirect(BALL, character[BALL].x, character[BALL].y - 40);

}

-Cheers
#2070
Advanced Technical Forum / Re:OOAGS
Tue 27/05/2003 13:07:53
Then you could use a 2D array (N x M). Input parameter is a cell position (x,y). To work out if there was a row of crosses you have to check horizontal, vertical and two diagonal rows to consist of defined amount of crosses. Process calculations from the input position in these 4 x 2 = 8 directions (each row could have two directions to go). Suppose the player has placed a cross at position (x,y). (the grid dimensions: 1..N, 1..M btw)

+--------> X
|
|
|
|
|
Y

Now checking the horizontal row:
if the element in the right square (x+1,y) is a cross then increase counter and goto element (x+2, y) and check if it's a cross again;

else check for opposite direction:
if the element in the left square (x-1,y) is a cross then increase counter and goto element (x-2, y) and check if it's a cross again; etc... x-3, x-4


if counter >= 3 for example then there is a line of crosses.

once you have checked horizontal row the same for vertical and diagonal:

vertical:
=========
if the element in the lower square (x,y+1) is a cross then increase counter and goto element (x, y+2) and check if it's a cross again; etc... y+3, y+4

else check for opposite direction:
if the element in the upper square (x,y-1) is a cross then increase counter and goto element (x, y-2) and check if it's a cross again; etc.. y-1, y-2

if counter >= 3 for example then there is a line of crosses.

diagonal #1:
============

if the element in the lower-right square (x+1,y+1) is a cross then increase counter and goto element (x+2, y+2) and check if it's a cross again; etc... (x+3, y+3), (x+4, y+4)...

else check for opposite direction:
if the element in the upper-left square (x-1,y-1) is a cross then increase counter and goto element (x-2, y-2) and check if it's a cross again; etc...

if counter >= 3 for example then there is a line of crosses.

diagonal #2:
============

if the element in the upper-right square (x+1,y-1) is a cross then increase counter and goto element (x+2, y-2) and check if it's a cross again; etc... (x+3, y-3), (x+4, y-4)...

else check for opposite direction:
if the element in the lower-left square (x-1,y+1) is a cross then increase counter and goto element (x-2, y+2) and check if it's a cross again; etc...

if counter >= 3 for example then there is a line of crosses.


you could make one function processing all 8 directions: GetDirectionNum(x, y, dx, dy);
so it would check this way (x+dx, y+dy), (x+2*dx, y+2*dy), etc... (dx and dy are either 0, 1 or -1). the function could return a counter value.

GetDirectionNum(x, y,  1,  0);
GetDirectionNum(x, y, -1,  0);

GetDirectionNum(x, y,  0,  1);
GetDirectionNum(x, y,  0, -1);

GetDirectionNum(x, y,  1,  1);
GetDirectionNum(x, y, -1, -1);

GetDirectionNum(x, y, -1,  1);
GetDirectionNum(x, y,  1, -1);


Now making a row function which helps combine the opposite directions (so we have a row):

int GetRowNum(x, y, dx, dy) {
return  GetDirectionNum(x, y,   dx,   dy) + GetDirectionNum(x, y,  -dx,  -dy);
}

GetRowNum(x, y, 1,  1);
GetRowNum(x, y, 0,  1);
GetRowNum(x, y, 1,  0);
GetRowNum(x, y, 1, -1);


so something like this :P

PS There is a more general algorithm working with any dimension array which just goes through all possible directions. But for 2d it's enough I think.

-Cheers
#2071
You can use the character representing a ball. Draw a walk-able area, set continuous scaling and make the character move upwards.

-Cheers
#2072
QuoteWhich characters are free to replace??
i mean, i replaced some like [ or %, and then, when i used them, they did "strange" things. ([ beaks line and %d make the variable stuff, logically)
Is there a way for override (english?) that?? or i just have to assign my special charaters to different slots?? if so, what characters should i avoid??
thanks
Familiar problem ([). Well, the best way is to use TTF instead.

-Cheers
#2073
The solution here is to remove the code:

while (character[PIN].animating) Wait(1);

****isert here another npc animation******

ReleaseCharacterView(PIN);
MoveCharacterDirect(PIN,340, 133);
SetTimer(2,800);


And just start the animation here.
Oh, if you want him to move elsewhere after the animation has been done just check it in repeatedly but separately instead:

room's repeatedly:


//the first part:
if (IsTimerExpired(1)==1){
character[PIN].room = 17;
character[PIN].x = 340;
character[PIN].y = 133;
SetGlobalInt(21,1);
MoveCharacterDirect(PIN,185, 151);
while (character[PIN].walking) Wait(1);
NPC_HasComeToTheScreen = 1; //he has arrived
SetCharacterView(PIN,71);
AnimateCharacter(PIN,0,5,0);
}


//the second part:

if (NPC_HasComeToTheScreen) { // some GlobalInt I think

 if (character[PIN].animating == 0) {
    ReleaseCharacterView(PIN);
    MoveCharacterDirect(PIN,340, 133);
    SetTimer(2,800);
    NPC_HasComeToTheScreen = 0; //so it wouldn't happen repeatedly!
 }

}

so this way :P

-Cheers
#2074
Did you finish the dialog after the run-script command? (stop I mean)

-Cheers
#2075
Also did you lose it when you were saving the project?
Do you mean it goes black when you running the game?
#2076
QuoteThe pixel perfect click detecting only works on none-scaled characters... I think...
The manual states it doesn't work correctly with the scaled ones. Not sure but maybe CJ got the option disabled at all for the scaled characters.


QuoteSorry to step in here, but I have been wondering about a very similar thing: If you've got a GUI (background color 0) with a partly transparent Image, will clicks on the transparent parts count as a click on the GUI or not?
Yes, it will. Setting the GUI not clickable allows to make it non-interactable but it will be entirely non-interactable though. You can use the ProcessClick() function to process click through the clickable GUI btw.

-Cheers
#2077
Advanced Technical Forum / Re:OOAGS
Mon 26/05/2003 21:20:32
QuoteThe project I'm working on will be a LOT easyer if it IS possible, although I'm sure I'll be able to work round it if it isn't... I think...
Yes, AGS doesn't support OOP but C++ does. CJ had made a great feature allowing the support of external DLLs. What you could do (if you really need to use OOP) is to write your system as an external dll and then just import it into ags as a plugin. This way you are free to use any tools that C allows. You can even do not use the script at all but C only; although IMHO it is much more better to combine them by scripting the most of things in AGS itself and writing sub-engines (sub-systems) as an external library and providing the interface functions as well. I had tried and really liked that.
Yes, the dll is not cross-platform so I am not sure you are able to write a linux version of your game. At least for now because Linux has no dlls but... I am sure it has something similar and I hope it will be possible to compile a linux-style binary without problems as well provided the written code is portable enough. :P


Quoteand before someone forum quotes rules at me again "OOAGS" IS a descriptive thread heading, as OO is a pretty standard acronym for "Object Oriented", which is the technical area I'm asking about.
That's ok but I think another reason why threads should be named descriptively is that someone else may look for the thread using the searching function and it just helps them to find one much quickly. :)


Quoteanyway, does anyone know if the Character Control System could be used to perhaps simulate an object oriented aproach?
Do you mean the plugin? If you do, when it depends on what exactly you want to achieve. You want to use OOP so I am guessing it maybe some system of objects processing simultaneously and interacting with each other by means of sending messages. Just a guess... :P

-Cheers
#2078
yes, check  pixel-perfect click detection in the game options panel.
#2079
Quotemaybe it might have something to do with ctrl + z being the keyboard shortcut for "undo" but i'm just guessing.
Yep, that is. Just when the script editor is opened having no text inside it save that state. Then AGS loads script file so when you pressing Ctrl-Z it processes the undo command and erases the whole script.

There are also some useful hotkeys:

Ctrl - A: select all
Ctrl - T: swap two lines
Ctrl - L: delete current line
Ctrl - J: return (enter key)
Ctrl - M (or Shift - Enter): return but to the 1st column
Ctrl - Backspace: delete the word before the cursor
Ctrl - Delete: delete the word after the cursor
Ctrl - +, /, - (gray): change font size
Ctrl - End: goto last line
Ctrl - Home: goto first line

there are also useful shortcuts like Ctrl - Right/Left/Up/Down, Alt - Right/Left, Shift - Right/Left/Up/Down/Home/End

-Cheers
#2080
ok, then just do what TK said:
Quote from: TK on Fri 23/05/2003 13:02:57
SetPlayerCharacter(CHARID);

You can use unhandled_event (int what, int type) to achieve what you want:

function unhandled_event (int what, int type) {
 if (what == 3 && type == 6) {
         SetPlayerCharacter(GetCharacterAt (mouse.x, mouse.y));
 }
}

Now whenever you click on a character with USERMODE1 cursor mode you get switched to that one.
SMF spam blocked by CleanTalk