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

#141
Thanks for the smart suggestion of the second item to replace the first one.

I tried SetInvPic and found that it does not change the invitempic when it is already selected. Maybe I did something trivial wrong there. Anyway, I'll go for the replacement option.

cheers, martijn
#142
I created a puzzle where you have to melt your way out of a cell with plexiglass windows, using a solder stift.
I want to change the inventory picture when the solder stift is connected to a voltage, to indicate that it is hot.

is there a function to do it ( i cannot find it either in the help and teh search through forums) or do I have to "do it the hard way, using ChangeCursorGraphic.

something like :

if (ActiveInv ==23 AND stift = hot){
   changecursorgraphic( xx);
}

cheers,

martijn
#143
A great suggestion!
I work around this problem for a while by creating small thin paths and have the character move around in a room along these lines. This way I can prevent the character from doing strange sideways sliding walks.

I noticed that this has been requested about a half year ago as well. So maybe it is difficult to implement. If it is not though, i would really like this feature!!

cheers, Martijn
#144
OKAY, Indeed the problenm was too trivial,
I had a room of size  320 * 204 instead of 320 *240
When the diemnsions of the background do not fit, the GUI cannot be projected over the background and is left out...

Thanks for your interest and sorry for taking up your time :-(
Martijn
#145
Quote from: Pumaman on Fri 04/06/2004 20:57:07
Can you be more specific? what script are you using to turn it back on? in what interaction?

Pumaman, I just notice that the "problemroom" has a different size of background, can that be the problem??
#146
I'll send the code of two different rooms:

First room(1): Here is what I am doing in the room where the gui does not appear:

Then room(2) I'll show the code from the opening scene: it seems that the first room after theopening does not show the GUI, when I make room 3 the second room, my problem occurs in room 3 instead of room 2.


// room script file (room1)


int line1=-1;
int line2=-1;
int line3=-1;
int line4=-1;
int line5=-1;
int line6=-1;
int line7=-1;


int currentID = 0;
int colour = 31;
int font = 0;
int centered = 0;
int xpos = 10;

function TypeLine(string line, int vspacing){
 
  int length=0;
  int i = 0;
  string displayedline;

  int textid = 0;

  length = 0; 
  i=0;
  StrCopy(displayedline," ");
  textid = CreateTextOverlay(xpos,50,400,font,colour,displayedline);

  length=StrLen(line); //set string length
  while(i<length){
   
    StrFormat(displayedline, "%s%c", displayedline, StrGetCharAt(line,i));
    SetTextOverlay(textid, 10,vspacing,400, font, colour, displayedline);

    if (StrGetCharAt(line,i) == ' '){
      Wait(5);
    }
    else{
      PlaySound(1);
      Wait(1);
    }
    i++;
  }
  return textid;
}

 

function room_a() {
  // script for room: First time player enters screen

line1 = TypeLine("Je naam: Volta.", 30);
Wait(60);
line2 = TypeLine("Je beroep: Space agent.", 50);
Wait(60);
line3 = TypeLine("Je cover: Engineer aan boord van een transportschip.", 70);
Wait(60);
line4 = TypeLine("Je missie: In het geheim vervoer je de", 90);
line5 = TypeLine("zwarte diamant van saturnus naar het", 110);
line6 = TypeLine("Amsterdam Museum of Space Minerals.", 130);
Wait(60);
line7 = TypeLine("Volta, stel de AIVD niet teleur.........", 190);


Wait(100);
RemoveOverlay(line1);
RemoveOverlay(line2);
RemoveOverlay(line3);
RemoveOverlay(line4);
RemoveOverlay(line5);
RemoveOverlay(line6);
RemoveOverlay(line7);

NewRoomEx(2,59,160);   



}

function room_b() {



function room_c() {
  // script for room: Player enters screen (before fadein)
GUIOff(0);
GUIOff(1); 
}



******************************************************************


// room script file (room2)

function room_a() {
  // script for room: Player enters screen (before fadein)

GUIOn(1);
}

function room_b() {
  // script for room: Player enters screen (after fadein)
}

function hotspot1_b() {
  // script for hotspot1: Any click on hotspot
DisplaySpeech(EGO,"De deur naar de gang");
DisplaySpeech(EGO,"Laten we maar gaan...");
Wait(10);
NewRoomEx(4,141, 190);   
}

function room_c() {
  // script for room: First time player enters screen

StopMusic ();
Wait(20);

DisplaySpeechAt(60, 59, 150,COMPUTER,"Je wordt over 5 minuten verwacht in de kantine voor ontbijt");
DisplaySpeechAt(60, 59, 150,COMPUTER,"Eet smakelijk");
Wait(30);
MoveCharacterDirect(EGO, 150,150);

}
#147
After my introscreen, where I have turned off Gui(1), I want to turn it on again in room(2);

Now, the gui appears again, but only in room(3).
I have tried everything I can think off...
What am i missing??? I'm getting crazy.......

Is there a secret overruling setting or anything???
Or might this be my first bug? I can hardly believe AGS offers bug at my level :-P

regards,

a desperate Martijn
#148
Thanks for all the suggestions.
All togehter I conclude that I must find another puzzle.
The design is for an electricity learninggame. Idea was that you have an electric caterpillarlike vehicle with two headlights. By turning on a headlight at e.g. the right side, the current will drop for the engine and the vehicle will turn.
learning goal: learn to think non-locally, adding a component to a circuit can affect other components in the circuit.

Therefore I would need to turn on and off the headlighhts separately and move the spots over the screen atthe same time. It will be too difficult to program this I am afraid.

maybe I will go with the option for two very big (ten times the screen dimensions) objects with a hole in it. Moving tghese object would reflect the postition of the light circles.\

Again thanks for thinking along, and I'll keep informed about the result in the critics lounge.

martijn
#149
Thanks for all the help!
here is the final, wqorking and tested code.
Off course a sound1.wav is stored in the game root.


//#######################################
//=============================================
//TypeLine types a text on the screen, letter by letter, at a vspace distance from the
//top of the screen
//The function returns the id of the line printed, so this can be called in order to identify
//the line later on; e.g. in order to remove the line
//=============================================

function TypeLine(string line, int vspacing){
 
//declare local vars
  int length=0;
  int i = 0;
  string displayedline;
  int textid = 0;
//initialise vars , overdoing it a bit ;-)
  length = 0; 
  i=0;
  StrCopy(displayedline," ");
  textid = CreateTextOverlay(xpos,50,400,font,colour,displayedline);

          //get string length, to know how long the loop must run
  length=StrLen(line); //set string length
         //start loop
  while(i<length){
         // pick character at position "i"and stick it at the end of string "displayed line"
    StrFormat(displayedline, "%s%c", displayedline, StrGetCharAt(line,i));
         //set textoverlay as displayedline
    SetTextOverlay(textid, 10,vspacing,400, font, colour, displayedline);

         // if a space is added to the string do not play a sound, else play a 'tick'
    if (StrGetCharAt(line,i) == ' '){
         Wait(10);
   }
   else{
        PlaySound(1);
        Wait(5);
    }
           //increase the loop counter
    i++;
  }
  return textid;
}
//#########################################

 
 


function room_a() {
  // script for room: First time player enters screen



//type lines and play sound of ticking machine
line1 = TypeLine(" first line", 50);Wait(60);
line2 = TypeLine(" second line", 70);
Wait(60);
line3 = TypeLine(" 3rd line.", 90);
Wait(60);

Wait(100);

//after a pauzethe text is removed again
RemoveOverlay(line1);
RemoveOverlay(line2);
RemoveOverlay(line3);
#150
Thanks a lot! I learned a great deal from this.
Wonderfull!!!
#151
Great! That did the trick,
Now I am left with one small problem:
I want to check for spaces:
is the character at place "i" a space, then wait a bit longer to play the next sound

if (     (StrComp(StrGetCharAt(line,i)," ")  !=0  ){
  Wait(10);
}
else {
Wait(5);
}

P.S. Waht does %s%c mean? I may be abvle to solve the rest of the questions myself once I understand the principle...
#152
Thanks,
I tried the followinfg script without a double 'displayedline' but that also fails, I changed the line into:
    StrCopy(displayedline_new, StrCat(displayedline_old,StrGetCharAt(line,i))  );

The complete script:

function TypeLine(string line, int vspacing){
 
  int length=0;
  int i = 0;
  string displayedline_new;
  string displayedline_old;

  int textid = 0;

  length = 0; 
  i=0;
  StrCopy(displayedline_old," ");
  textid = CreateTextOverlay(xpos,50,400,font,colour,displayedline_new);

  length=StrLen(line); //set string length
  while(i<length){
    StrCopy(displayedline_new, displayedline_old);
    StrCopy(displayedline_new, StrCat(displayedline_old,StrGetCharAt(line,i))  );
    i++;
    SetTextOverlay(10,vspacing,400,font, colour,displayedline_new);
    PlaySound(1);
    Wait(5);
  }
  return textid;
}
#153
Thanks a lot for the quick help. I have been trying to create a mix of both yoyr suggestions. I am afraid I am missing an essential property of obone of the string functions, since I keep getteing an error about comparing a string to a non-string in the following line:     StrCopy(displayedline,StrCat(displayedline, StrGetCharAt(line,i) )  );

the complete function is copied below.
can you see quickluy what I am missing ( I am not a programmer, but trying to make the best of it ;-))

function TypeLine(string line, int vspacing){
 
  int length=0;
  int i = 0;
  string displayedline;
  int textid = 0;

  length = 0; 
  i=0;
  StrCopy(displayedline," ");
  textid = CreateTextOverlay(xpos,50,400,font,colour,displayedline);

  length=StrLen(line); //set string length
  while(i<length){

    StrCopy(displayedline,StrCat(displayedline, StrGetCharAt(line,i) )  );
    i++;
    SetTextOverlay(10,vspacing,400,2,10,displayedline);
    Wait(5);
    PlaySound(1);
  }
  return textid;
}
#154
Can I create credits that are in "being typed style"?
I mean: A text is printed ('being typed') on the screen letter by letter, while you hear the typewriter sounds in the background.

hHs this been done before in AGS?
regards,
Martijn
#155
Is it possible to have two spots of light similar to the flashlightplugin?
I intend to make a vehicle with two headlights moving in a dark scene, trying to stay on the road. For specific nature of the puzzle I need two separate beams of light?

can anyone reflect on this?

regardss,
martijn
#156
Thanks for all the feedback !

I have improved the instructions in some way.
In the first shuttle screen you already see the current meters, connected to the throttles (is that correct english for the red knobs?)

http://www.xs4all.nl/~koops/ags/spacespy_devel18.zip

After the crash (in the final game it will be triggered by some other event) you open the dashboard and can create the current by applying the resistors and wires, to bypass the throttle.
I understand that this was not clear for you.
I would greatly appreciate suggestions to make this more intuitive. Maybe make the places for the components to be placed more clear?

BTW, another sample of a similar puzzle can be accessed by Ctrl-X to room 3.
is that puzzle more intuitive?

Thank you in advance for the feedback,

martijn
#157
The second part should also work fine.
Pick a resistor and place it on the print, build a cicuit to control the current.
Slides are broken now...
#158
thanks. I'll try that next time. Now I have solved the question by drawing 40 different sprites. If interested you can download demo from: http://www.xs4all.nl/~koops/ags/spacespy_devel17.zip
#159
This puzzle has been create to be used in school, as aprt of an adventure.
can anyone please reflect on the difficulty and maybe suggest improvements on the conceptual level?
I am aware of the crapy shuttle graphics.

The goal of this puzzle is that the players learns that resitors in parallel conduct a higher current that in a serial configuration.

The compiled version is zipped at: http://www.xs4all.nl/~koops/ags/spacespy_devel17.zip

cheers, martijn
#160
 am not sure about the classes. I use the struct command to set up value.x, value.y etc.

cheers,

martijn
SMF spam blocked by CleanTalk