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

#41
strazer. nice font by the way :P It's big but perfect for large-resolution games. the last version of sci studio has a BIG problem. it crashes after some time. bad management of resources? i will have to talk with the sci creator somehow.

[edit] strazer, i also have an outline for the smallest font in the game. 8 px height. the outline version i think is 9 px. in the SCI pack it was font.030. i have made font.035(normal) and font.036(outline). i just don't have space yet stince i don't have a webpage yet. but if anyone wants them i'll e-mail them to whomever needs.

but. Scorpiorus. i have FURTHER questions:

1. having a hi-colour palette makes a big diffrence? i mean, the same game using the same sprites but one with 256 colours and the other with 16 million. would that make a BIG diffrence? or a smaller diffrence :P

2. a lot of variables would reduce game speed?

3. having many guis would slow down the game? a lot or little. i know that i depends on the guis. for example, i have a game with 4 guis simmultaneously (i hope i spelt that right). one for mouse-label, actions, and two other buttons. now. adding the inventory screen and the menu makes 6.

4. how do you turn off the repeatedly execute?

and lastly. i have this scrips

if(mouse.x >= 188 && mouse.x <= 201)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Talk to");
Ã,  Ã,  else if(mouse.x >= 204 && mouse.x <= 224)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Look at");
Ã,  Ã,  else if(mouse.x >= 231 && mouse.x <= 254)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Move");
Ã,  Ã,  else if(mouse.x >= 257 && mouse.x <= 270)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Pick up");
Ã,  Ã,  else // (mouse.x >= 293 && mouse.x <= 306)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Use");

[edit] for this to make sens imagine this in the bottom right corner.

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, < y = 201
Ã,  [talk to] [look at] [pick up] [use]Ã,  Ã, |
^ ________________________________|
x =188

which sucks :P what I am trying to do is to have a LABEL that follows the mouse (using first code). and display some text accordingly when mouse is over. now, i have not seen anything related to OVER except in the gui creation (image when mouse over).

The problem is that having two guis i have two such scripts. it only works, partially for the second one and the label stays forever in the mode last used.

Ex: if i put my mouse over pickup, and the text label now is "Pick up" when i go outside those regions, and try to click around, the text remains "pick up" that makes sence since i do not kill the label when it exits. but i am struggling to make this work.

i see some games work this way.

in my game the mouse-label is VERY VERY important. i have text for everything. how would i be able to display a specific text without going to. oh wait. i think i know. using a string buffer, and use the buffer instead of raw text. whenever one tries to do something, change the buffer :P

let me try it.

[edit]

The whole repeatedly execute:

function repeatedly_execute() {
Ã, 
Ã,  // mouse-label
Ã,  if(mouse.x >= 265 && mouse.y >= 204)
Ã,  Ã,  SetGUIPosition(LABEL, 215, 210);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // |Ã,  Ã,  label _|
Ã,  else if(mouse.x <= 50 && mouse.y >= 204)
Ã,  Ã,  SetGUIPosition(LABEL, 0, 210);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // |_ labelÃ,  Ã,  |
Ã,  else if(mouse.x <= 50)
Ã,  Ã,  SetGUIPosition(LABEL, 0, mouse.y + 6);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // | labelÃ,  Ã,  Ã, |
Ã,  else if(mouse.x >= 265)
Ã,  Ã,  SetGUIPosition(LABEL, 215, mouse.y + 6);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // |Ã,  _label_Ã,  |
Ã,  else if (mouse.y >= 204)
Ã,  Ã,  SetGUIPosition(LABEL, mouse.x - 50, 210);Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // |Ã,  Ã,  Ã, label |
Ã,  else
Ã,  Ã,  Ã, SetGUIPosition(LABEL, mouse.x - 50, mouse.y + 6);Ã,  // |Ã,  Ã, labelÃ,  Ã, |

Ã,  // inventory button (the bag)
Ã,  if(mouse.x <= 52 && mouse.y >= 210) {
Ã,  Ã,  GUIOn(BAG);
Ã,  Ã,  SetLabelText(LABEL, 0, "Inventory");
Ã,  }
Ã,  else {
Ã,  Ã,  GUIOff(BAG);
Ã,  Ã,  SetLabelText(LABEL, 0, "@overhotspot");
Ã,  }

Ã,  // actions barÃ,  Ã, 
Ã,  if(mouse.x >= 188 && mouse.y >= 218 && mouse.x <= 320) {
Ã,  Ã,  GUIOn(ACTIONS);
Ã,  Ã,  if(mouse.x >= 188 && mouse.x <= 201)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Talk to");
Ã,  Ã,  else if(mouse.x >= 204 && mouse.x <= 224)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Look at");
Ã,  Ã,  else if(mouse.x >= 231 && mouse.x <= 254)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Move");
Ã,  Ã,  else if(mouse.x >= 257 && mouse.x <= 270)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Pick up");
Ã,  Ã,  else // (mouse.x >= 293 && mouse.x <= 306)
Ã,  Ã,  Ã,  SetLabelText(LABEL, 0, "Use");
Ã,  }
Ã,  else {
Ã,  Ã,  GUIOff(ACTIONS);
Ã,  Ã,  SetLabelText(LABEL, 0, "@overhotspot");
Ã,  }
}

I am trying to work my way trough but i cannot make it to work. And i would have required a such label for each inventory item.
#42
strazer, your font gives me an error when i try to open it from SCI Studio. I have version 3.01 I will try importing it into the game. Importing it into the game is weird. Both fonts are outlines only. I tried using the font in the game. It works, but both fonts are OUTLINES :P Changing the colour would change the outline and the core would be transparent, since there is none.

SteveMcCrea, yes well. my guess was that the game has functions to declare extra variables. Simmilar to link-lists or malloc or calloc functions where you can declare arrays or reserrve memory in the middle of the program. I don't think that for UNKNOWN variables there are spaces in memory. The restrictions for 2000 dialogue options, 255 rooms, and so forth are because of there initial internal declarations/initialisations. But also there is a restriction for ints. I don't know so you are probably right. Which means that if you use 1 variable or 10 variables, it still works like using 10 variables.  Or it might be that it throws out the unused ones and works like 1 :P i don't know. never-mind
#43
that is my exact feeling. i am against using a lot of unecessary variables. but repeatedly execute runes i don't know how many times per second. you said 40.

well. both ways work. but i see people delcaring a lot of variables for uncessesary operations. ex:

x = strlen("hello") - 5;
function(1 + x);

instead of doing
function(1 + strlen("hello) - 5);
/* which is exacty the same thing except that you are not using up memory. */

it might seem silly. but when you have a milin ints in this way, and 4 bytes for each int you would consume about 1 mega of ram. which is not much. who cares anyways :P with the new computers you have 1 GB ram. oh well. back to the OLD-drawing board :D

my guess was first one as well.
#44
I have this code

function repeatedly_execute() {
Ã,  if(mouse.x >= 215 && mouse.y >= 218)
Ã,  Ã,  SetGUIPosition(LABEL, 215, 218);
Ã,  else if(mouse.x >= 215)
Ã,  Ã,  SetGUIPosition(LABEL, 215, mouse.y);
Ã,  else if (mouse.y >= 218)
Ã,  Ã,  SetGUIPosition(LABEL, mouse.x - 50, 218);
Ã,  else
Ã,  Ã,  Ã, SetGUIPosition(LABEL, mouse.x - 50, mouse.y);
}

If i would use variables instead of doing it this way, would it be slightly faster or slightly lower. I know we won't see the diffrence, because of fast computers we use this day. A 386 might see a diffrence. But I am curios.

or doing it this way

int LABELx;
int LABELy;

function repeatedly_execute() {

Ã,  if(mouse.x >= 215 && mouse.y >= 218) {
Ã,  Ã,  Ã, LABELx = 215;
Ã,  Ã,  Ã, LABELy = 218Ã,  Ã, 
Ã,  }
Ã,  else if(mouse.x >= 215) {
Ã,  Ã,  Ã, LABELx = 215;
Ã,  Ã,  Ã, LABELy = mouse.y;
Ã,  }
Ã,  else if (mouse.y >= 218) {
Ã,  Ã,  Ã, LABELx = 215;
Ã,  Ã,  Ã, LABELy = mouse.y;
Ã,  }
Ã,  else {
Ã,  Ã,  Ã, LABELx = mouse.x - 50;
Ã,  Ã,  Ã, LABELy = mouse.y;
Ã,  }

Ã,  Ã,  Ã, SetGUIPosition(LABEL, LABELx, LABELy);
}

my guess is that the first one is slightly faster. By 2 clock cycles let's say :P Since i am doing a test, as in the second one, but i am also calling a function which copies the three values and return something. Now in the second one, i am using two spaces for ints in memory, then i am doing the test, assigning values to ints, then calling the functions, copying the values, etc, etc.

Which one would be faster?

P.S. this is my indy-like mouse-label instead of statusbar. Whoever needs the code may use it as long as he is lazy to make one himself. All you need is a transparent gui of 100w x 22h with a label of the same size and the text centered. Put @overhotspot@ in the label. and to make the gui transparent just change the GUI background color to ZERO and outline to ZERO. and you're done :P

It's tested and works. I did not test the second one, but it makes sense, except errors which might occur.

[edit] the GUI must be called "LABEL" and it only works for a viewport of 320x240. that is 320 x 240 and 640 x 480 resolutions.
#45
i would ask to add something alse for scripting.

SetLabelTextAlignment (int GUI, int OBJECT, LEFT|CENTER|RIGHT)

one might think it is not very useful. but if you be using a gui to put the text inside you might need it to play around with the text instead of having it forever in one position.

now. thank god i don't need to play around with the viewports. my game will be 640 x 480 because my graphics designer wants something than looks nice (he draws nice backgrounds :P) and i want something fast. 800 x 600 gets slow with loads of effects.

but thank you for the information. thanks very much. i've been doing noting yesterday but here i go again today. thank you.  ::)

there are a couple of small functions missing from ags but one can get around them. when i need something that is not there, i will then see which ones. but ags is pretty fine  ;)

i would strongly strongly suggest double-clicks for both left and right mouse buttons.

again, thank you for the information
#46
thanks very much. now its a bit easier to make my label look acceptable.

hm. but i wonder. since on 800x600 the viewport is 400x300, would it make a diffrence if i script the game for a viewport of 320x240? or do i need a

if ResolutionIs = ???... i don't know the function, if there is one or the variable name. but i think i have to add something similar when working with the viewport.

anyway. i will show you the complete script when i am done. it will add lables indy-style to the game. i am trying to make a game without menus ;D

i don't know how to get around the inventory. i will probably add a pop-up gui.
#47
is there any way one can change the alignment of label inside a gui from the script? i have made a indy-like label using a non-click-able transparent gui wich has one label with @overhotspot@ and in my repeatedly execute i have a script that tells that gui to follow the mouse. thank you Alynn.  but, when i go near the edge of the screen the text goes OUTSIDE of the visible area. i can change the posision of the gui, but then the text will look awfull. if i have a 100 px gui, and the text takes up only 50px, when i change the position of the gui, the text will have a 50px space between it and the cursor.

Ex: ^ = cursor | = edge ..=empty space
           |
Barell..|...........
    ^    |

becomes
                      |
Barrell............|
                    ^|

I have looked trough the manual and there is no such functions available and there is no such thing as a SetGuiLabelAlignment, but there is a SetGuiLabelPosition and a SetGuilabel... (i forgot). only two of them for label. i can use GetObjectsomethingsomething but is just to return a boolean or a int number.

I tried to make this myself. I know that the whol game uses 320x240 even at 800x600. At least i like it that way. Therefore changing resolution should not affect the way it behaves. I know that each letter takes an amout of pixels "n." I need to get what is the name of the hotspot and move the label accordingly.

Now, how would I get the hotspot's name? ??? I am a beginner, but I am able to work around some things.

PS (offtopic) the AGS script language looks like C language. (NOT C++ with overloads >> or :: etc) but with dot operator (join) mouse.x that is a struct, right? deftype struct mouse { int x, y; } ;D  ::)
#48
lol. nobody posted for a long time so i forgot about this. I WILL READ EVERYTHING!!!!

thank you very much everyone!!!!!!!
#49
Modules, Plugins & Tools / mouse double-clicks
Fri 05/03/2004 14:25:51
Is it possible to use double click in AGS?
I checked the manual but I haven't found anything. Should I re-look? :P

I am trying to use a left single click for walk and left double click for look.
#50
very useful, thankee!!!

you can also add the tokens: @overhotspot@ @score@ @totalscore@ etc

[edit] i see that some global variables are missing. is this quick reference for 2.6? I think it might need updating.
#51
ok. i ask you this:

how can I use StrLen with any hotspot name. for example, if I have my mouse over a door "Door" right? I would like to have a StrLen("@overhotspot@") which should give 5 and use that number to adjust a gui, label using almost the same principle. e.g.

repeadedly_execute
{
   len_gui = StrLen("@overhotspot") ;
   //which does not work
   SetGuiPosition(GUI,mouse.x,mouse.y);
   SetGuiSize(len_gui * 10, 9);
}

or

if(GetLocationType(mouse.x,mouse.y)>0)
{
StrLen(GetLocationName(mouse.x,mouse.y));
}

which does not work. code problem i guess.
#52
thankee!

hehe. me comparing to SimB i did not even try to get it work all by my alone; rather, i asked you. won't do that again in a hurry....


----> I added this :

I looked trough the manual and I did not find any functions that deal with double-clicks. If I want, for example, single click for Left Mouse Button to make the character move to mouseposition and Double-Click LMB to make the character look at hotspot.

I might probably have to make the double-click myself, I think

on_mouse_click(LEFT)

probably IsButtonDown(LEFT)

i was trying to use a while loop and an if statement but i realised that some computers are slower than others therefore one double click on one system can be almost a drag in another. i was trying to use a timer to count how much time between to clicks and if lest than the required time then process as a double click. i might have to use go to, continue.

Is there another way?

I am trying to simplify the menu to make it from mouse + screen and the inventory, well I have to think about that but should be something simple and fast. more space for the graphics, and less cumbersome.
#53
yes, well, i think the title describe it all. in indiana jones fate of atlantis (i hope i spelt it right) which is indy 4 you get the classical menu of "look at" "smile to" "begin with" etc... well, not exacly, but you get my point. anyway, let me get back to the main idea...so, as I was saying in indy 4 you have a strange "moving-above-the-cursor" type of text similiar to a windows tooltip except that is moves with the mouse and blinks. how would I make such a thing?

it is probably a loop of some sort where the mouse coordinates are always updated and the text is moved as the mouse is moved. i just need an ideea or two of how to implement that.
#54
I don't think I need an avatar... ;D
SMF spam blocked by CleanTalk