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

Topics - spook1

#21
I use the script for typewriter style credits (one letter at a time).

The function I use for this is :
Code: ags


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(10);
Ã,  Ã,  }
Ã,  Ã,  else{
Ã,  Ã,  Ã,  PlaySound(1);
Ã,  Ã,  Ã,  Wait(5);
Ã,  Ã,  }
Ã,  Ã,  i++; 
Ã,  }
Ã,  return textid;
}



I seem to have to replace the CreateTextOverlay function by
static Overlay* Overlay.CreateTextual(int x, int y, int width,
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  int font, int color, string text)

according to the help files.

I do not know what to do with this code snip ??
What does a star mean? How do I declare, define, adjust my function??

Any help would be greatly appreciated since I have stumbled over this before.
I was quite fluent in the old script, but now I get confused over and over again....
But I'll learn how to overcomeÃ,  :-P
#22
I cannot change the background image of my GUI.

Help says:

BackgroundGraphic property
(Formerly known as SetGUIBackgroundPic, which is now obsolete)

int GUI.BackgroundGraphic

Gets/sets the background image of the GUI.
You can set this to 0 to remove the background image from the GUI.

But neither the obsolete or the actual command succeed...

Any suggestions?
#23
I can define an event to happen when I talk to a character in the character definition window.
Now I need to have a local event (adressing room-variables) and therefore I need an event in a room, on "talk to character".

Is there a standard way to do this?

regards,
Martijn
#24
I feel rather silly, asking another easy question. But I cannot find the answer anywhere.

It has something to do with code running in the background??

I have a set of cEgo.Say("   "); commands.
(I must work this way, rather than use the dialog because I use %d variables in my speech)

At a certain point a function is called, and under conditions a transition must be made to another room.
The change is not made though, but the cEgo.Say("   "); speech commands continue to go on.

The funtion is something like :
Code: ags

function CheckSettings(int StartHB, int fluctuatie, int alarmgewenst){ 	
if ((StartHB + fluctuatie > GetTopLimit(StartHB))  || (StartHB + fluctuatie < GetBottomLimit(StartHB))  ){  
                Display("Alert");
	PlayAmbientSound(1, 1, 255,0,0);
	
	Display("Operatie mislukt, contract overleden...");
	StopAmbientSound(1);				cEgo.ChangeRoom(7); 
}

The change is never made though in the script below. Worse: the final changeroom generates an error: "already changeroom due"

here is the complete  script
Code: ags

if (GetGlobalInt(1)==1){
  cNurse.Say("Nou is het afwachten .... of ie het doet!");
  cNurse.Say("Onze kwaliteitsnorm eist 3 correcte alrams op rij.");
  cNurse.Say("Als u dat haalt blijven wij uw klant");
  cNurse.Say("Blijft u maar even rustig afwachten. u hoeft niets te doen");
  CheckSettings(80, 22, 1);   
			
  CheckSettings(70, -12, 0);  
  cNurse.Say("Laat eens even checken wat de waarden nu zijn meneer");
      
  CheckSettings(110, 12, 1);   
  cNurse.Say("En dat was drie. Ik ga naar bed en u kunt naar huis.");
  cNurse.Say("Onze dank is groot!!");
  cEgo.ChangeRoom(7);
	 }  


any suggestions would be very welcome      }
#25
Is there anything I can do about this error?

I copied the creditz script from on alder game into a new game.
Now I get an error on:

function addCreditLine(string Text) {
  SetCredit(currentID,Text,colour,font,centered,xpos,generateoutline);
  currentID = currentID+1;
}

about the string conversion

any suggestions?
#26
I created my own GUI and want to see a lable change value as I click a button.
When I click the button nothing happens though.

I am obviously missing something trivial, but what???

I have aÃ,  GUI with button: High_up


#sectionstart High_up_ClickÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function High_up_Click(GUIControl *control, MouseButton button) {
Ã,  if (HV < 296) { HV = HV + 5;}
}
#sectionend High_up_ClickÃ,  // DO NOT EDIT OR REMOVE THIS LINE

The int HV is exported to my room.
In the repeatedly execute of the room I call:

function room_b() {
Ã,  // script for Room: Repeatedly execute
Ã,  Ã, 
Ã,  String buf = String.Format("%d", HV);
Ã,  High_value.Text = buf;
Ã, 
}
#sectionend room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
#27
Is there a paramter to set the background animation speed from the script?

regards,

Martijn
#28
Is there a way to make specific regions of a character clickable?
E.g. make character touch his hair, feet, etc.
Look at different parts of the body.
To be more specific, I need this for interaction with a vehicle which is defined as a character.
I create some function Check_clicked_spot(), but now I started wondering if such a thing is already by default available in AGS.

regards,

Martijn
#29
I hvae a caterpillarvehicle, with many views (one headlight lit, two heqadlights lit, on headlight dimmed, the other bright etc. etc.etc.)
I made a charater for this vehicle, and called it FF11. It has three loops: straight, right and left.

Depending of a GI (nr 50) I set the view of this vehicle called FF11.
Now the right views won't show, no matter what I try.

Any suggestions??

Code: ags

// script for Room: Player enters room (after fadein)
....
Ã,  if (GetGlobalInt(50)==1) {Ã,  //aa
Ã,  Ã,  Ã,  Ã, // ChangeCharacterView(FF11, 45);
Ã,  Ã,  Ã,  Ã,  character[EGO].loop=0;
Ã,  Ã,  Ã,  Ã,  character[FF11].Walk(160, 100,eBlock);
Ã,  Ã,  Ã,  Ã, Display("Here will start the MiniGame");Ã,  

// script for Room: Player enters room (before fadein)

Ã,  if (GetGlobalInt(50)==1) {Ã,  //aa
Ã,  Ã,  Ã,  Ã,  character[FF11].FaceLocation(160, -1000);
Ã,  Ã,  Ã,  Ã,  ChangeCharacterView(FF11, 45);



#30
General Discussion / Innosetup configuration?
Wed 01/02/2006 12:26:12
I am trying to make Innosetup work for distributing my learning game on electricity.

It work fairly well, but I am a bit confused what to do with winsetup.exe.

When users run the installation file they are presented with the winsetup.exe window, and have to make choices on items they are not familiar with.
is there a way to strat the game directly, without having to go through the winsetup.exe?

Can I automte the winsetup.exe step using Innosetup?

I hope mthere is an easy ansewer to these questions,

regards,
Martjn
#31
I have a character that needs to change his looks during walking.
When walking through a pool the characters trousers must become dirty during walking.

In other words, I want to change views without interrupting the action.

I have several views for the character, all identical, but with different "clothes".

Is there an easy way to switch between the views? Or do I need to do a lot of coding, checking for the actual loop, spritenr and take it from there in the new interaction?

Any suggestions?
#32
I have a vehicle which can be steered by dahusting the wiring during driving./

Therefore I need a set of characters (I have too many for objects to be used, > 20) to move IN FRONT (drawn on top) of the vehicle.
These characters must move exctly along with the vehicle. E.g. the headlights must move along.

The trick with cCharacter.x = cMain.x + offset works quite ok, except that the cCharacter moves just after the main character.
It is drawn behind the main caharacter.

Any suggestions on how to do this would be greatly appreciated.

martijn
#33
In my game I have a set of caharcaters that should move in sync with the main character, but with an oofset.

FOLLOW_EXACTLY does not help here, sinde it does not provide the option of an offset.

I intend to make a small loop:

while (i <MaxChars)
  Char.x = cMainChar.x + Char.xoffset;
  Char.y = cMainChar.y + CHar.yoffset;
  i++;
}

Can thsi be done?? I am a bit confused by the obsoletness of a number of Charprperties.

Martin
#34
I want to set some characters at a start position when entering a  room.
(a hat on a main character). From there I intend to make the hat stay on the characters' head with FolloCharacterExactly.

I think I need to set everything in place before player enters room. I made a funtion

Initialize(string name, int xcoord, int ycoord){
if (character[Name].moving) StopMoving(Name);
Character[name].x = xcoord;
Character[name].y = ycoord;
}

But the code does not work (character[name].moving seems to be obsolete)
Does anyone know what to replace it by?

thanks in advance,
Martin
#35
I have a problem with rawdraw functions, and character movement.

I want to draw certain sprites at coordinates that are relevant to a characters position.


This works fine, exept for the fact that the rawdraw functions are called, only when the character stops moving.

So: lets say i have the hat of my main character defined as sprite 160. And the relative coordinates of the head of my character (where the hat must be placed) are hatcoord.x, and hatcoord.y

I Draw the hat as follows:

RawDrawImage(cCharacter.x + Hatcoord.x , cCharacter.y + hatcoord.y  , spriteslot);

The problem that occurs is that the hat is draw in the correct place, but ONLY after the character has stopped moving?
How can I make the hat (sprite) move along weith the charcater?
In other words, how can I rawdraw during mcharacter movement?

It probably has to do something with nonblocking, wait ?? I cannot figure it out.

P.S. I need to workthis way because I have over 30 "hats".

any suggestions?

Martijn
#36
In my global script I define a struct and build an arry from it.
I get an error message;

Unexpected KlikPlek


I am not a very experienced programmer so I cannot see what I am doing wrong. Any ideas??

Here is my code:


struct klikplek {
   int nr;
   int x;
   int y;
   int view_nr;
   int x_width;
   int y_width;
  };


KlikPlek klikplek[30];
#37
Hi,

I'm back. After more than a year I found some time to continue my game based learning project.
And in doing so new questions arise :-)

Is there a way to create a hotspot on an object?

In my game I have a caterpillar vehicle driving along the road (like the slot machine bike game in the demo game).
When the right engine current is disconnected it turns left and vice versa.
To diconnect the current the player must cut a wire on board the moving vehicle.

Can I define a hotspot on the object?
is there a simple way to do so?

Extra complicated is that the vehicle chnges perspective (is shape) when turning, so calculating the hotspot-area is also a bit complicated.

Any suggestions?

regards,

Martijn
#38
For my game I plan to make the player drive some vehicle through a dark area.
he needs to turn on lights to see where he is going.

Now I am looking at different representations of the scene.
A helicopterview seems to be the simplest to program. But for the game it would be much nicer if the player can drive and see through the main window of the vehicle, scrolling over the planet.

Any suggestions how to proceed?

I know how to program  a bit in AGS, I have made a caterpillar vehicle to be steered by two levers. it works fine.
#39
I go to new room and have the following code.
everything happens in a blink though?
How can I slow it down and get a view of my character walking towards the spaceship, fade out and see the ship gently fly away...?

Code:
// room script file

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: Player enters screen (before fadein)
ObjectOn(0);
player.x = 163;
player.y = 135;
}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart room_b  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
  // script for Room: Player enters screen (after fadein)
character[EGO].SetWalkSpeed(1, 1);
character[EGO].Walk(163, 135, eBlock);

FadeOut(70);
ObjectOff(0);
ObjectOn(1);
player.x = 500;
player.y = 500;
FadeIn(100);
object[1].Move(239,37, 1, eBlock);

FadeOut(10);
NewRoom(16);
}
#sectionend room_b  // DO NOT EDIT OR REMOVE THIS LINE
#40
I worked with a little trick keeping track of inventory items in my inv box.
now I upgraded to ags27 and the following erro occurs after I pick up my second inv item in the game.

I get the error (which I never got in AGS256):

---------------------------
Adventure Game Studio
---------------------------
An internal error has occured. Please note down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.70.864)

Error: run_text_script1: error -6 running function 'repeatedly_execute':
Error: Array index out of bounds (index: -1, bounds: 0..300)
in Global script (line 51)
---------------------------
OK   
---------------------------


function repeatedly_execute() {
  // put anything you want to happen every game cycle here

   
  GetLocationName(mouse.x,mouse.y,location_name);
  get_gui = GetGUIAt(mouse.x,mouse.y);
  got_inv  = character[EGO].activeinv;

          if (hadgot_inv != got_inv){ // something changed in active inv
               if (got_inv != -1){
                         character[EGO].inv[got_inv] = 0;
*line51=>*       character[EGO].inv[hadgot_inv] = 1;
                         UpdateInventory();
               }
               hadgot_inv = character[EGO].activeinv;
         }
}

any suggestions??
SMF spam blocked by CleanTalk