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

#1
AGS Games in Production / Re: Zid Journey
Wed 16/11/2022 05:01:56
Quote from: CrashPL on Thu 10/11/2022 14:25:20Yep! The demo is available on GOG as well! :-D
Good on that but I was hoping you could make a link that doesn't require signing up.If you don't mind doing that I would appreciate it very much. :smiley:
#2
AGS Games in Production / Re: Zid Journey
Thu 27/10/2022 19:12:55
Could you please make a link to the demo using somewhere other than steam?
#3
Is there a way to change the pitch of a sound in AGS through script?
#4
I have  some script that runs if an object exists in the room but I get a "invalid object specified" error.
Code: ags

function on_event (EventType event, int data)
{
	if(event==eEventEnterRoomBeforeFadein)
	{
		if(version==0)
		{
			Room.SetProperty("versionnumber", 0);
		}

		
		

		
	}	
}	
int remtime;
// called on every game cycle, even when the game is blocked
function repeatedly_execute_always()
{	
	if(Room.GetProperty("versionnumber")==0)
	{
		if(object[0]!=null&&object[1]!=null)
		{
			object[0].Visible=true;
			object[1].Visible=true;
		}	
		if(object[2]!=null&&object[3]!=null)
		{
			object[2].Visible=false;
			object[3].Visible=false;
		}			
		
	}	
	if(Room.GetProperty("versionnumber")==1)
	{
		if(object[0]!=null&&object[1]!=null)
		{
			object[0].Visible=false;
			object[1].Visible=false;
		}	
		if(object[2]!=null&&object[3]!=null)
		{
			object[2].Visible=true;
			object[3].Visible=true;
		}			
	}	
	
	
	
	
	
	
	
	
	
	
	
	
	
	Object* o=Object.GetAtScreenXY(mouse.x, mouse.y);
	if(o!=null&&mouse.IsButtonDown(eMouseLeft))
	{
		o.Graphic=15;
		o.Graphic=16;
		GiveScore(-1);
	}	
	
}

How can I check if an object exists in the room?
#5
I don't understand how to export a variable to all room scripts.
#6
I just put them in the header as this exactly without import or export.

int timer[10];

Is there something wrong with doing it like this?

EDIT:ok I just read the link you showed me and I understand that I was doing it wrong.Thanks again.
#7
That didn't work.Are you sure you understood my post entirely.I am wondering if this is maybe an error with ags because I have not had this problem before 3.6.0.I have had many other problems with global integers not being recognized as changed even when they are in the top of a script list.So to put it simply:I have a script at the top of the list and in that I have repeatedly execute always copied from global script and global integers in there adding up every game loop.I'm sure that they are adding up because I had it display the integer by placing Display() right next to the adding integer and it did show to be adding up .But if I place Display in a room script and try to display the integer from there nothing happens.The integer stays the same.I hope i've made this clearly understood.

This displays the global integers value.
Code: ags

// new module script
function repeatedly_execute_always()
{
  test+=1;
  String s=String.Format("%d",test);
  Display(s);
}
// new module header
int test;

If the above script doesn't have display this in room script doesn't display integer.It always displays zero.
Code: ags

function room_RepExec()
{

  
  String s=String.Format("%d",test);
  Display(s);
}

#8
Thanks for the tip but I already made what I think is a very useful way of making tiles.By using overlays I can access the particular position of any tile existing.I have looked at tile modules before but they don't give you interactivity with any singular tile.With being able to interact with a particular tile I can have an object on top and detect what tile its on.In the editor the position of an overlay is based on the tileguide but in the game of which I load the tiles to can detect what tile is under the mouse and where.Thanks anyways. :)
#9
Just a tip.If you are using a camera to convert your paintings to digital art I would suggest setting your camera at a very low resolution so that you don't have to scale down the painting digitally.Scaling from a large camera resolution down to a reasonable scale that ags can handle can get a bit messy.
#10
Oh. Well then yes that definitely explains why it wasn't working.I didn't know that it starts at the beggining everytime you reopen the file.Thanks for clearing that up. :)
#11
Here is the code that writes to the txt file.
Code: ags

	pt=Screen.ScreenToRoomPoint(tileguide.X, tileguide.Y); 

	if(beforetilenum<100000)
	{
		beforetilenum+=1;
	}	
	if(beforetilenum==100000)
	{
		beforetilenum=0;
	}	
	if(tile[beforetilenum]==null)
	{
		tilenum=beforetilenum;
	}	
	
	
	
	
	
	if(tileguide.Y<mouse.y&ileguide.X<mouse.x)
  {
    //bottom right
		
    tileguide.X+=60;
    tileguide.Y+=30;
  }  
  if(tileguide.Y>mouse.y&ileguide.X>mouse.x)
  {
    //topleft
    tileguide.X-=60;
    tileguide.Y-=30;
  }  
  
  if(tileguide.Y<mouse.y&ileguide.X>mouse.x)
  {
    //bottomleft
    tileguide.X-=60;
    tileguide.Y+=30;
		
  }    

  if(tileguide.Y>mouse.y&ileguide.X<mouse.x)
  {
    //top right
    tileguide.X+=60;
    tileguide.Y-=30;
		
  }  
	int dfg=3;
	if(mouse.IsButtonDown(eMouseLeft))
	{
		if(pt!=null)
		{
			tile[tilenum]=Overlay.CreateRoomGraphical(pt.x, pt.y, dfg);
			File* tilemap;
			tilemap=File.Open("tilemap.txt", eFileAppend);
			tilemap.WriteInt(pt.x);
			tilemap.WriteInt(pt.y);
			tilemap.WriteInt(dfg);
			//String s;
			//s=String.Format("tile[tilenum]=Overlay.CreateRoomGraphical(%d,%d,%d);",pt.x, pt.y, dfg);
			//tilemap.WriteRawLine(s);
			tilemap.Close();
		}	
		

	}	

Reading the code does work in the write order but the next integers after the first three aren't accessed by the reading script.
What is meant to be is that the three integers load from the txt file then in the next game loop the same integers load from the next three that are after that in the txt file.
So to put it simply.I want to read the first three integers then read the next three integers and continue reading the next three integers.
#12
I'm having trouble getting the integers to change to the next values in the text file.
Code: ags
  
        File* loadmap = File.Open("$INSTALLDIR$/tilemap.txt",eFileRead);
	tilex=loadmap.ReadInt();
	tiley=loadmap.ReadInt();
	tilesprite=loadmap.ReadInt();

The txt file has just the three integers but with several different values(in order).I need to have those integers equal the next values that are written.

The first few lines of the text file:
Code: ags

I  Iº  I   I  Iº  I   IÃŒ  IØ  I   IÃŒ  IØ  I   IÃŒ  IØ  I   I  Iö  I   I  Iö  I   I  Iö  I   IT  I  I   I  I2  I   IÜ  IP  I   IÜ  IP  I   IÜ  IP  I   I   In  I   Id  IP  I   I   I2  I   Id  I  I   Id  IØ  I   Id  IÅ"  I   Id  I`  I   I(  IB  I   Id  I$  I   I   I  I   IÜ  Iè  I   IÜ  Iè  I   IT  Iè  I   IT  Iè  I   IT  Iè  I   I  I  I   I  IB  I   IÃŒ  I`  I   IÃŒ  IÅ"  I   IÃŒ  IØ  I   IÃŒ  I  I   

I've tried using seek to choose the next line but that doesn't seem to work either. I probably am using seek wrong so if you could please show me how I would appreciate it.
#13
I have  a little tile drawing system made up that creates a room overlay in a grid space as a tile .This part already works fine but my problem is getting the information of what tiles were drawn used by another game.
I have this get written to file everytime a tile is drawn.
Code: ags

	if(mouse.IsButtonDown(eMouseLeft))
	{
		if(pt!=null)
		{
			tile[tilenum]=Overlay.CreateRoomGraphical(pt.x, pt.y, dfg);
			File* tilemap;
			tilemap=File.Open("tilemap.txt", eFileAppend);
			String s;
			s=String.Format("tile[tilenum]=Overlay.CreateRoomGraphical(%d,%d,%d);",pt.x, pt.y, dfg);
			tilemap.WriteRawLine(s);
			tilemap.Close();
		}	
		

	}	

It would be nice if I could run the script that was put into a txt file but I suppose the only way is to move the numbers to integers in the other game and place them in a loop that runs tile[tilenum]=Overlay.CreateRoomGraphical(x,y,dfg); till it reaches the end of the txt file.
#14
No this is not related to that.Its ags script.I just don't know how to run the ags script that was written to the text file.
#15
Thankyou very much! :smiley:
Actually I just realized that theres Screen.screentoroompoint.
I don't know how I never saw that before.
#16
I have a script that places tiles on the room at the mouse pos when you click but it gets off set because the screen coordinates are different than room coordinates.How would you get the xy position of the room underneath the cursor?
Code: ags

function game_start()
{
	tileguide=Overlay.CreateGraphical(player.x, player.y,3);
}
function repeatedly_execute_always()
{

	
	
	if(beforetilenum<100000)
	{
		beforetilenum+=1;
	}	
	if(beforetilenum==100000)
	{
		beforetilenum=0;
	}	
	if(tile[beforetilenum]==null)
	{
		tilenum=beforetilenum;
	}	
	
	
	
	
	
	if(tileguide.Y<mouse.y&ileguide.X<mouse.x)
  {
    //bottom right
		
    tileguide.X+=60;
    tileguide.Y+=30;
  }  
  if(tileguide.Y>mouse.y&ileguide.X>mouse.x)
  {
    //topleft
    tileguide.X-=60;
    tileguide.Y-=30;
  }  
  
  if(tileguide.Y<mouse.y&ileguide.X>mouse.x)
  {
    //bottomleft
    tileguide.X-=60;
    tileguide.Y+=30;
		
  }    

  if(tileguide.Y>mouse.y&ileguide.X<mouse.x)
  {
    //top right
    tileguide.X+=60;
    tileguide.Y-=30;
		
  }  
	int dfg=3;
	if(mouse.IsButtonDown(eMouseLeft))
	{
	
		tile[tilenum]=Overlay.CreateRoomGraphical(tileguide.X, tileguide.Y, dfg);
		File* tilemap;
		tilemap=File.Open("tilemap.txt", eFileAppend);
		String s;
		s=String.Format("tile[tilenum]=Overlay.CreateRoomGraphical(%d,%d,%d);",tileguide.X, tileguide.Y, dfg);
		tilemap.WriteRawLine(s);
		tilemap.Close();
	}	
	
	
	
	
	
	
 if(IsKeyPressed(eKeyRightArrow))
  {
    Game.Camera.X+=13;
  }  
  if(IsKeyPressed(eKeyLeftArrow))
  {
    Game.Camera.X-=13;
  }  
  if(IsKeyPressed(eKeyUpArrow))
  {
    Game.Camera.Y-=13;
  }  
  if(IsKeyPressed(eKeyDownArrow))
  {
    Game.Camera.Y+=13;
  }  
}	

The tileguide should be in the same place as the cursor but it should be able to send xy room position of tileguide to tile[tilenum].
Any thoughts on how to do this?
#17
Another example of adventure games made in paintings is several of "Humongous Entertainment's" games.Although it was more work for them to do physical art it had a certain quality texture to it that was great.As for the layers.They made the backgrounds as paintings and drew the things that move and animate in pencil and colored the animations in digitally .You could make the paintings as backgrounds and draw the things that move as digital art if its any easier.
#18
I have raw script that I put into a txt file for opening in another ags game and I need to run that script or move it to somewhere in the game script to be run.Can this be done?
#19
I have this global integer array  that I want to add to each always but whenever I place this in any other repeatedly execute that is not in a room it doesn't do anything.I have tried putting it in a script at the top of the script list.
    timer[0]+=1;
  timer[1]+=1;
  timer[2]+=1;
  timer[3]+=1;
  timer[4]+=1;
  timer[5]+=1;
  timer[6]+=1;
  timer[7]+=1;
  timer[8]+=1;
  timer[9]+=1;
#20
It seems like i've heard somewhere of how to to this but I can't remember where.All I need is to allow showing the quotes in this.
output.WriteRawLine("script1="king01.txt" run=1");
SMF spam blocked by CleanTalk