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

#1
After a long time with other issues I decided to pick up my old game (v2.72).
I downloaded the latest AGS engine and stumble immediately over the first error:

room0.asc(36): Error (line 36): Type mismatch: cannot convert 'const string' to 'string'

it is referring to the following line, calling the agsCreditz.dll

addCreditLine("Werknaam SpaceSpy");

Will this be the first error in a long long que and should I refer back to v2.72, or can these issues be solved easily?
(my game contains 35 rooms already and many many sprites and views.

Thanks in advance for your interest in my issue,

Martijn
#2
In my gam,e the player can move pistons of a lock by connecting a battery to some coils. I mcalculate the current through the coil, and move piston proportionally to this current.
A snip of the script is given below.
At startingpoint the A_dx  value equals -1. I do not understand that, since

I_PistonA = -240
A_DX = -70
MaxPistonCurrent = 10 000 000  (ten million!!)

So how can A_dx = A_DX * I_PistonA / MaxPistonCurrent equal -1??

That would mean that: -1 = 70*240/10000000 . It should read 0.00168!

can anyone help with a suggestion??


Code: ags

  //first set the max movement for full Piston Current
 
  int A_DX = -70;  // means 70 pixels for full movement outward of the disk at max current
  float Zero = IntToFloat(0); 
  float A_dx = Zero;  // because I need much more parameters to be set to Zero later on
 
  //now calculate the actual movement in x direction:
  
  A_dx = IntToFloat(A_DX) * (IntToFloat(I_PistonA) / IntToFloat(MaxPistonCurrent) );

 // and finally move
  
  object[2].SetPosition(36  + FloatToInt(A_dx), 113 );



#3
I am not sure if I am asking for dynamic array..

In my game I calculate currents between conenction points, using a matrix approach. Now I want to:
Code: ags

#define NUMCONNECTIONS 8

function MAX_WIRES(){
	int i;
	int maxwires_loc=1;
	while (i<NUMCONNECTIONS ){
		maxwires_loc = maxwires_loc + i;
		return  maxwires_loc;
	}
}


//NumCurrent = MAX_WIRES() - NUMCONNECTIONS + 1;

// Declare an array variable of type Connection

Connection 	Connections[MAX_WIRES()];
int                            current[NumCurrent];



This obviously does not work.

Is there a way to decalre arrays, depending on a defined value?
This way I can create a general roomscript, where I only need to change the number of connections to have all currents calculated. This is not really dynamic is it?

I am curious to read about any suggestions,

martijn
#4
In my game the player can create electrical circuits by drawing lines between terminals.
I would like to indicate the current flowing through the wire (drawline) by a dot-pattern that moves along the line.
It is a serious game for learning electricity, thats why I want the current to be "visible" in the lower levels.

Can anyone help me with a suggestion? Or would such a feature be too slow when I draw about 12 lines.

Thanks in advance for thinking along with me,

Martijn
#5
Maybe I am way off topic, but I'll try and see if anyone knows a solution, or some suggestions to start with,  for my programming problem.

In my educational game I create many puzzles with electrical circuits. Now I am up to something more generic and new. Off course to share with the community, once it works :D

The latest puzzles I designed allow the player to connect any two contacts out of a total of "IntMaxContacts" contacts. Goal is to adjust the current between some of the contacts in such a way that an electric lock can be opened.

Now I have to set up Kirchoffs equations for all possible connections between two points.

My question:

I am looking for an algoritm to list all the possible closed circuits (triangles, squares, pentagons etc) in my field of a number of "IntMaxContacts" contacts.

Example:

If I have 6 contact points, numbered 1 to 6, I can make the following circuits:

123                         1234                    12345   123456
124 234                  1235 2345           12346
125 235 345           1236 2346 3456
126 236 356 456                                12356
                               1245
134                         1246 2356           12456
135 245                                              13456
136 246 356           1256                   
                                                           23456
145                         1345
146 256                  1346 2456

156                         1456

These loops represent all the possible single circuits to be made in my 6 point contact field.

I am looking for a way to create this list dynamically, for a given set of contactpoints.
I am sure that the code can be very elegant (maybe with nested function?), but cannot see it; being a simple physics teacher rather than a programmer :-()


Does anyone have any suggestions how to program that?
I am not familiar with the arrays and dynamic looping...


From this I must create the matrix for the kirchoff equations. The equations will be somewhat like
Example:

for the 123 circuit:       I12*R12 +I23*R23 + I31*R31 = 0;
for the 2356 circuit:     I23*R23 + I35*R35 + I56*R56 - I62*R62 = 0;

Convention: current's positive way: from low contact to high contact.

so the equations become:

for the 123 circuit:       I12*R12 +I23*R23 - I13*R31 = 0;
for the 2356 circuit:     I23*R23 + I35*R35 + I56*R56 - I26*R62 = 0;

I will define all the R values (some may be changed by the player, creating new contacts) and calculate the currents using a Gauss Jordan algoritm in a dll.

Can anyone help me with some suggestiosn to start with?

Regards,

Martijn




#6
This may be a strange question on this forum. But after wotrking with AGS for years, I am starting a project in Flash.
Now I need to script a dialog module (Flash action script is OOP) and I am wondering whether it is possible to translate the AGS script to a flash action script. This would be must faster than setting up a dialog object from scratch :-P

Is the script for the dialog module available somewhere?
#7
Just wonder what you critics would suggest to improve my walkcycle for a kid on the beach.


What do you think of the style?

All suggestions are more than welcome,
Martijn
#8
I have a game that usdes the flashlight [plugin.
I noticed that when I save the game at a dimmed light level,
after reloading the game, all the lihgt is back at max level.

Is this a know bug? Can I solve it?
#9
For a special puzzle I need a character to move, but not always in the same "loop".

Sometimes I want my chatracter to kove to the right, but shown in the "up" loop.
I can do this with a locked view, but this feature freezes the view in a single frame.
Is the a way to choose the loop of the view, and still have the character animated?
#10
I want to hand all the inv items the players has colected over to another character.

I want to do something like:

for i = 0 to cEgo.InventoryItemCount{
Ã,  cSister.InventoryQuantity = cEgo.InventoryQuantity
next i

can this be done??
#11
I have a scriptline:

GetInvName(i,buffer) in a loop.
It is obsolete but by what code can I replace it?
InventoryItem.name cannot work, but what then???

Code: ags

function geefterug(String inv_item){
Ã,  
Ã,  int i ;
Ã,  String buffer;
Ã,  
Ã,  i=1;
Ã,  buffer = "NONE";
Ã,  
Ã,  while (i<14){Ã,  // do loop until inv item is returned or all inv_item slots (until 13) are checked
 
Ã,  Ã,  Ã,  Ã,  
			GetInvName(i,buffer);Ã,  Ã,  Ã,  Ã,  Ã, 		// check if it has the correct name
Ã,  Ã,  Ã,  Ã,  Ã, if (StrComp(inv_item,buffer)==0) {Ã,  Ã,  Ã,  Ã, 	//if so: 
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if (character[EGO].inv[i] == 0){Ã,  Ã, //and if EGO does not already carry this inv_item
		 AddInventory(i);		//add inv item

		 return i;			//output inv_numer returned
		 i=14;Ã,  Ã,  Ã,  Ã,  Ã,  		//stops while loop
	Ã,  Ã,  }
	 }
Ã,  i++;
Ã,  }
}
#12
II have a GUI which fills the whole screen (training game, exercise on simulated interface)
yet i want to display Speech, over the GUI.
Is there a way to do this?

Now, all I can manage is to display a message, but then I cannot set the textcolor.

Any suggestions?

Martijn
#13
I have created an intro using the Typeline functions as explained in the archive forum.

Everything works great, but now I want to make a skip intro button.
It is not possible however to click anything, as long as the typeline functions are running.

is there an easy workaround?

a snippet of my intro is shown below:


Code: ags

#sectionstart room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_b() {
Ã,  // script for Room: First time player enters room
Ã,  
gSimlektogui.Visible = false;
Ã,  
textoverlay0 = TypeLine("Your nameÃ,  Ã,  : Joanne Philps",10);
Wait(10);
textoverlay1 = TypeLine("Your jobÃ,  : Undercover Agent",20);
Wait(10);
textoverlay2 = TypeLine("Your coverÃ,  Ã, : Maintenance and installation engineer",30);
Wait(10);
textoverlay3 = TypeLine("LocationÃ,  Ã,  : Anton Medical Centre",40);
Wait(30);

textoverlay0.Remove();
textoverlay1.Remove();
textoverlay2.Remove();
textoverlay3.Remove();


any suggestions?


#14
For my simulation game I need a Gui that consists of six similar sections (screensize)
I need each of the sections to change color under certain conditions. So I need to have a function or property like

Gui[2].Textbox[3].BGColorÃ, 

so I can make a setting likeÃ, 
:

If (blue) then Gui[2].Textbox[3].BGColorÃ,  = 9;

Can this be done in AGS?

Thanks in advance for thinking along...,

Martijn
#15
I am making a game with many dialogs.
Comments from the players of the pilot game are that the text is:
- hard to read
-font is nice but often not clear against the background
-it is not clear who is talking to whom.

I have the dialog options diaplyed in a GUI at the bottom of my swcreen and the text of the oehter characters is displayed on the screen

Can anyone suggest a really neat way of displaying the dialog texts in a very clear way; that is: also clear to people a who are not used to gaming?

Maybe something with text balloons is possible? Or a really neat font exists which can be easily placed near the head of the talking character?


#16
For my game I created a translation file (.tra). Copied it into the compiled directory, and in the game editor I choose Setup.
There I pointed to the translation file, but the game is still in dutch.

next to that I cannot find a winsetup.exe file, for the user to setup the language as it used to be before.

any suggestions??
#17
In a room I have not touched since I moved to ags 2.72, I want to add a new object.
BUt once I open the room, I cannot save it anymore, because of the error:

"Cannot convert DEF_POSITION* into 'int'  "

it is generated on a line where I state:

return(position) 

at the end of a function:
Code: ags

function vehicle_position(int left_fwd,int right_fwd){
  //first call realtive function to calculate the relative positionchange
 relative_translation(left_fwd,right_fwd); //how much do left and right move

 fposition.x = 
     fadd ( fposition.x, 
       fadd(
	fcos_component(fpositionchange.x, fposition.orientation), 
        fsin_component(fpositionchange.y,fposition.orientation)
       )
     );
 fposition.y = 
     fadd(fposition.y,
       fadd( 
	fcos_component( fpositionchange.y, fposition.orientation ), 
        fsin_component( fpositionchange.x,fposition.orientation )
       )
     );
 fposition.orientation =
     fadd(fposition.orientation, fpositionchange.orientation);
     
 position.x = float_to_int(fposition.x);
 position.y = float_to_int(fposition.y);
 position.orientation = float_to_int(fposition.orientation);

 return(position);
 
}


I gues it has something to do with the function not being declared correctly. It was probably allowed in previous releases.
How should I declare my function as a DEF_POSITION type?


The game works fine, no errors or anything, exeprt when I try to edit this room.

In the beginning of the script, where I declare my variables I have:

Code: ags

struct DEF_POSITION{
  int x;
  int y;
  int orientation;
};


DEF_POSITION fpositionchange;
DEF_POSITION fposition;
DEF_POSITION position;



How can I solve this??
#18
In my game I use the following code:

Code: ags

function crash(){
 if (cCar.IsCollidingWithChar(cHole1) == 1)Ã,  Ã,  { 
		Display("You drove in an hole"); 
 }
}


The player is steering a car on a road (road passes by, car moves left and right). A cHole character comes from top to bottom, and moves under the cCar.
No collision is detected though?

Any suggestions??
#19
The final room in my game (no backgroud) is used for showing the credits.

Although I set the GUIs to be not visible, and do a QuitGame after the credits are finished, I do see the GUIs and the quit game sequence is not performed.

(I go to the final page using the transport debug ctrl-x)

Any suggestions?

the code of the room is:
Code: ags

// room script file



#sectionstart room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
Ã,  // script for Room: Player enters room (after fadein)
Ã,  
Ã,  Credits[1].CreditStyle=eCreditScrolling;
Ã,  Credits[1].DefaultCreditColour=60000;
Ã,  Credits[1].DefaultTitleColour=15;
Ã,  Credits[1].MinY =20;
Ã,  Credits[1].StartY = 250;
Ã,  
Ã,  
Ã,  Credits[1].AddTitle("Design and scripting by");
Ã,  Credits[1].AddCredit("Dr. M.C. Koops");
Ã,  //Credits[1].AddImage(2000, eCreditCentred, eCreditAlignBelow);
Ã,  Credits[1].AddTitle("Technical Advice by");
Ã,  Credits[1].AddCredit("Ing. H.P. Verbist");
Ã,  Credits[1].AddTitle("Produced by");
Ã,  Credits[1].AddCredit("Learning Games");
Ã,  Credits[1].AddTitle("using");
Ã,  Credits[1].AddCredit("AGS");
Ã,  Credits[1].AddCredit("");
Ã,  
Ã,  Credits[1].AddCredit("");
Ã,  Credits[1].AddCredit("www.learning-games.nl");
Ã,  
Ã,  Credits[1].Run();
	

}
#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: Repeatedly execute
Ã,  if (Credits[1].IsRunning() == eCreditFinished) {
Display("Game over"); 
QuitGame(1);
Ã,  Ã, }
}
#sectionend room_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart room_cÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
Ã,  // script for room: Player enters screen (before fadein)
gHeartbeat.Visible = false;
gSimlektogui.Visible = false;
mouse.Visible = false;
}
#sectionend room_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
#20
I use the following code:
Code: ags

#sectionstart room_cÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
Ã,  // script for room: Player enters screen (before fadein)

 gHeartbeat.Visible = false;


Yet the GUI gHeartbeat stays visible when I open the game with this room.
When I start in another room and transfer the character by the debug code to this room, the GUI is not visible...
How can I get rid of it?

Any suggestions?
SMF spam blocked by CleanTalk