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

#1
hello everyone, sorry and can I change the background with gray colors? I'm trying to create a vignette effect, only if I create the full screen gui after the character does not move, then I created 2 gui on the sides with a vignette effect, but I would like to create a background effect on the gray, and then put the hidden objects yellow, which will then become visible in that mode, I hope it is a tint type command or similar, thanks
#2
yes you are right, because the first modification was made by Cassiebsg, then since he only had to modify one thing I gave him the file you took, while before I sent him the one with the rooms but I had not calculated your intervention, however just remove that line and put 4 backgrounds (in case of error) always in each room and AdvanceClock (2, 0) also works; , but if in the future I would like a script in hours with a map can I do it? my idea was to make the map as in the photo divided into 4 time slots imagine (which I will then have to fix), from the left 0 hours, center + 1 hour, right + 2 hours, off the map 4 hours, travel to London in NY etc. the time it takes for train and ship, you can create a script where I insert the rooms change time (each room) all the time differences, of course then I create the detailed list but asked if I could do a thing of the kind, in the meantime thank you very much again

#3
hi guys, sorry with this plugin can I create a log dialogue to insert in my diary? thank you

#4
the backgrounds in the other rooms don't go, what command do I have to use? thanks

Code: ags
// new module script

#define CLOCK_CENTER_X 40
#define CLOCK_CENTER_Y 40
#define CLOCK_RADIUS_H 25
#define CLOCK_SPRITE_H 29
#define CLOCK_RADIUS_M 30
#define CLOCK_SPRITE_M 30

enum BGFrame {
  eBGNight = 1, eBGDawn = 2, eBGDay = 3, eBGDusk = 4
};

int seconds, minutes;
int hour, minute;

void DrawImageAA(this DrawingSurface*, int x, int y, int slot) {
  this.DrawImage(x - 1, y, slot, 80);
  this.DrawImage(x, y + 1, slot, 80);
  this.DrawImage(x + 1, y, slot, 80);
  this.DrawImage(x, y - 1, slot, 80);
  this.DrawImage(x, y, slot); 
}

DynamicSprite* clockFace;

void DrawClock()
{
  clockFace = DynamicSprite.CreateFromExistingSprite(28, true);
  DrawingSurface* ds = clockFace.GetDrawingSurface();
  int a;
  
  // hour hand
  DynamicSprite* hourHand = DynamicSprite.CreateFromExistingSprite(CLOCK_SPRITE_H, true);
  a = minutes / 2;
  while (a > 359) a -= 360;
  if (a > 0 && a < 360) hourHand.Rotate(a, hourHand.Width, hourHand.Height);
  hourHand.Resize(CLOCK_RADIUS_H * 2, CLOCK_RADIUS_H * 2);
  ds.DrawImageAA(CLOCK_CENTER_X - hourHand.Width / 2, CLOCK_CENTER_Y - hourHand.Height / 2, hourHand.Graphic);
  
  // minute hand
  DynamicSprite* minuteHand = DynamicSprite.CreateFromExistingSprite(CLOCK_SPRITE_M, true);
  a = minutes * 6;
  while (a > 359) a -= 360;
  if (a > 0 && a < 360) minuteHand.Rotate(a, minuteHand.Width, minuteHand.Height);
  minuteHand.Resize(CLOCK_RADIUS_M * 2, CLOCK_RADIUS_M * 2);
  ds.DrawImageAA(CLOCK_CENTER_X - minuteHand.Width / 2, CLOCK_CENTER_Y - minuteHand.Height / 2, minuteHand.Graphic);
  
  ds.Release();
  gClock.BackgroundGraphic = clockFace.Graphic;
}

DrawingSurface* roomDS;
DynamicSprite* roomBG;

void CheckRoomBackground()
{
  if (player.Room < 40) return; 
  
  int newBottom = eBGDay; // day
  int newTop = 0; // no second layer yet
  int t;
  
  // is it night?
  if (hour < 6 || hour > 18) newBottom = eBGNight;
  // dawn? 
  if (hour ==  6 && minute < 30) newBottom = eBGDawn;
  // dusk?
  if (hour == 19 && minute < 30) newBottom = eBGDusk;

  // fading for 20 minutes each

  // night -> dawn
  if (hour == 5 && minute > 40) {
    newTop = eBGDawn;
    t = (60 - minute) * 5;
  }
  // dawn -> day
  if (hour == 6 && minute > 10 && minute < 30) {
    newTop = eBGDay;
    t = (30 - minute) * 5;
  }
  // day -> dusk
  if (hour == 18 && minute > 40) {
    newTop = eBGDusk;
    t = (60 - minute) * 5;
  }
  // dusk -> night
  if (hour == 19 && minute > 10 && minute < 30) {
    newTop = eBGNight;
    t = (30 - minute) * 5;
  }
  
  roomDS = Room.GetDrawingSurfaceForBackground();
  roomBG = DynamicSprite.CreateFromBackground(newBottom);
  roomDS.DrawImage(0, 0, roomBG.Graphic);
  if (newTop > 0) {
    roomBG = DynamicSprite.CreateFromBackground(newTop);
    roomDS.DrawImage(0, 0, roomBG.Graphic, t);
  }
  roomDS.Release();
  roomBG.Delete();
} 

void Update() {
  if (seconds > 24 * 3600) seconds -= 24 * 3600;
  minutes = seconds / 60;
  hour = minutes / 60;
  minute = minutes - hour * 60;
  CheckRoomBackground();
  DrawClock();  
}

void SetClock(int h, int m) {
  seconds = h * 3600 + m * 60;
  Update();
}

void AdvanceClock(int h, int m) {
  seconds += h *3600 + m * 60;
  Update();
}

int frameCount = 0;
void repeatedly_execute_always() {
  
  if (game.debug_mode && IsKeyPressed(eKeySpace)) {
    AdvanceClock(0, 1);
  }
  else {
    frameCount++;
    if (frameCount >= GetGameSpeed()) {
      frameCount -= GetGameSpeed();
      seconds += 3; // 1 second passes IRL => 3 seconds pass in game
    }
  }
  
  Update();
}

void on_event(EventType event, int data) {
  if (event == eEventEnterRoomBeforeFadein) SetBackgroundFrame(0);
}
#5
hello, thanks for the work, wow and fantastic, ok I understand how to set the clock, thanks,
but unfortunately for this modification I have not given the full version, and I was wondering, is it possible in my map function, yes because the game uses my invention of the map, where you select a place, the carriage comes and takes you to your destination, it is possible to do a time calculation on the map? eg if I leave the office at 9 in the morning and arrive in the place at 11, then I go back to the office, do I always leave from 9? or at 13? thanks, in case of this modification I will send you the whole file, thanks again

I created a new room but it doesn't change the background, do I have to add some commands in fade in, or in the script? thanks, theoretically I asked this works to change the background in each room of the game to have a time effect as you have seen, what command should I use to change the background in each room?
#6
hello I'm trying the clock and it makes me a strange thing, if I start the room at 6 pm, when it arrives at 9 pm, it sets the background during the day like 9 am, then at 10 pm the night starts again, maybe it doesn't calculate the 24 hours , then I tried to add another 12 sprites but he doesn't see them, if now I want to make a 24 sprite watch (which I think is more precise) what should I do ?, I did the test again now, if I start at 21 it comes always during the day, then it passes at night but at 10 pm it is day again, I send you a new file with 24 sprites already set from 100 to 123, another thing if in the script you want to make a list of the 24 sprites to associate, go ahead, that then I fix them, (always if possible of course) we set the clock to 24 hours with 24 sprites at least we are sure that it counts those, thank you very much

https://drive.google.com/file/d/14Z4nh9mb9oQGnl7RuGgSjnD8QolYjuvY/view
#7
OMG WOOOW, I set at 9 and the day came * _ * fantastic, thank you very much you do me doing school, before I took a cue from your script so I created one for the deduction room, because I practically have a nice long code and global script it bothered me because it still needed space, so I took a cue from your script and I created mine, I'm too happy, I still created a simple thing, in the deduction room I created the inventory, there are words and you have to drag these words on the suspect, the wrong ones turn red and then the display text says "does not match etc" instead for the right one of each category, the label is displayed, the categories that I invented are 5
opportunity
weapon
test
motive
conclusion

when you have these 5 elements you can incriminate the suspect, also if a category of the type (occasion) if it is correct automatically removes you those are not exact

for each category I created 4 wrong elements

does not seem, but I'm very happy that I created a small script (obviously not at the levels of the master XD) but thanks anyway, and if you want to put your script in the downloads, which by the way is a fantastic thing because it makes the game more openworld if we want, put it well maybe other people need it, thanks again for everything

#8
I did the test, if I set the global at 9 it makes me the background cycle, if instead I put at 6, nothing happens
#9
yes I noticed, but how come if I set it to 9 in global variabiles, the backgrounds cycle me? and then I was weighing if instead of the script with the background change, they put something like if sprite 109 changes bacground 1, can we do it? do you think so we can solve the problem, because it is fantastic but my office in the game opens at 9 am XD, as always thank you very much, another thing I noticed that I no longer see the dark around the icons (before it was gray if I went to hotspots etc, what command did you use or setting to make sure that you don't see the grayness between the icons, thanks



#10
ok if I put 9 in global variabiles, the backgrounds go to me like the XD disco strobe effect, they cycle, if I set sprite 109 in the script and the gclock button disappears, because obviously the sprite sequence has changed, so what should I change to to start the game at 9? if I change the sprites the sequence is correct because it is set to 12 sprites, and those remain, the sprite 00 becomes 9 etc., and continues the cycle, the problem and the backgrounds change, now in this script the 6 is set as a time, or number of sprites? because in this way I could change it just tell him where the sprite 6 is located etc, thanks anyway I really like the script

Code: ags
if ((intHour <6) || (intHour> = 19 && intMinute> = 1)) SetBackgroundFrame (0); // Night Background
else if (intHour == 6 && intMinute == 0) SetBackgroundFrame (1); // Dawn Background
else if (intHour> = 6 && intMinute> = 1) SetBackgroundFrame (2); // Day Backgrund
else if (intHour == 19 && intMinute == 0) SetBackgroundFrame (3); // Sunset Background
#11
OMG WOW, when I go to the map to go to the police, you see the background, fantastic * _ *, I made you create a wonderful script, thanks it was what I wanted, but now the game starts at 9 am, so I just have to change it sprites from 00 to 9, and then the change background script that corresponds to the time, thanks again
#12
wowww :) thank you, I'm glad you did it, congratulations
#13
https://drive.google.com/file/d/1jjhytBxb6M14_FVlywSWh7Bsm7HL4Jf3/view

hello, I tried again but nothing, it does not stop continue with all the images, I prepared a copy so at least you can understand, maybe you need a reset or stop variable, I don't know, any frame that I put (even not clock) starts always with 4 frames first, so if in the first frame it says 77, I have to put 74 to start it, and then it does not stop it continues always, thanks again

push inizia, caso 1 to play
sorry for the graphic :)

I also did the test to set the 1 sprite to 12, but it does not stop always continues

        intMinute=0;
        intHour++;
        Bclock24.NormalGraphic=1+intHour; // 88 is sprite number that corresponds your clock at 00:00 (note that this only works if 89 is hour 01:00, and 90 is 02:00, etc)
        if (intHour==12 && intHour==24)
        {
          Bclock24.NormalGraphic=12; // this resets the clock image to 00:00
          if (intHour==24)
          {
          intHour=0;
          intDay++;

#14
ok it works but I notice two problems
if (intMinute == 1) // Because you wish to change the hour at every 20 minutes and not real time (every 60 minutes).

1. is there a second, not a minute, that is normal, or do I have to calculate the seconds by minutes?

2. no it resets to the frame continues indefinitely showing me other images of the game, as if there was no stop despite putting the start frame. and the final frame, it seems that it does not find it

Code: ags
 intMinute=0;
        intHour++;
        Bclock24.NormalGraphic=77+intHour;
        if (intHour==12 && intHour==24) 
        {
          Bclock24.NormalGraphic=80; // this resets the clock image to 00:00
          if (intHour==0)
          {
          intHour=0;
          intDay++; 


I also did the test to put only 4 frames
from 77 to 80, but it does not stop it continues showing me all the images of the game

other strange thing, if I put any frame like 77 and in the button is set 77, he starts from 80, so I have to put 75 if I want to see frame 77, strange as what

as always thank you
#15

function repeatedly_execute_always()
{
  //intSecunds++;
  if (intSecunds*GetGameSpeed()==2400)
  {
    intSecunds=0;
    intMinute++;
    if (intMinute==1) // Because you wish to change the hour at every 20 minutes and not real time (every 60 minutes).
    {
        intMinute=0;
        intHour++;
        Bclock24.NormalGraphic=88+intHour;
        if (intHour==12 && intHour==24)
        {
          Bclock24.NormalGraphic=00; // this resets the clock image to 00:00
          if (intHour==0)
          {
          intHour=0;
          intDay++;
          }
        }
    }
  }
 
}
#16
ok I tried with delays, and I did some tests
40 = 1 sec
2400 = 1 min
12000 = 5 min
36000 = 15 min
48000 = 20 min
unfortunately though if I put 33000 delay, the clock goes crazy it runs very fast, so I assume there is a limit also in the delay
32000 = 13 min> the maximum limit of 13 minutes
#17
ok I solved your script, it just doesn't move, I even changed the number of frames, seconds, minutes, but nothing doesn't change, what escapes me to make it work? is not that maybe you have to set the script on the view for it to work?
Bclock24.NormalGraphic intHour + = 77;
77 and to test if it moves because with 88 it stays still
Bclock.Animate (CLOCK24, 0, 30, eRepeat);
with this command animation works but with other AGS, I always make a test copy to try the functions, but unfortunately I see that by mistake if I insert the view, anyway thank you so much with the normalgraphic command (which I didn't know how to use) I can also create the pages for dialogue and much more, thanks again
#18
yeep, small steps, the clock works, how do i calculate the delays? is there by chance a delay converter for seconds or minutes? , now that it finally works I can interact, now if from this animation I would like to make a similar sequence,

gClock.Visible = true;
    Bclock.Animate (CLOCK24, 0, 10, eRepeat);
10 speed = I want to change it in 20 minutes

after I try again your script, thank you very much
#19
for those who want to try I put the procedure, my result in photos (forget the graphics)

first you create a new gui, inside this gui1 we put a slide and button, second thing we create a gui2 and inside we put a label, now we need to create a txt text file to be inserted in the "Compiled \ Windows" folder of the your AGS,
for the button we put this command

Code: ags
File*output = File.Open("Readme.txt", eFileRead); // reads the file under the Compiled folder
	String readmetxt = "";
	if (output != null) {
		String temp;
		while (!output.EOF) { // make sure there's a "Readme.txt" in the Compiled folder
			temp = output.ReadRawLineBack();
			readmetxt = readmetxt.Append(temp);
			readmetxt = readmetxt.Append("[");
		}
		output.Close();
	}
	lblReadme.Text = readmetxt;


in the slide that we will call sldReadme, this command must be inserted
Code: ags
lblReadme.Y = sldReadme.Value;


the label should be called lblReadme

we must position the gui2 above the gui with the same number Z ORDER, so that then the text does not come out, after using slide values, label height, and font size, we can create our text to scroll in the photo I put
sldReadme min value -1000
lblReadme h 6000
font 18pt

if someone wants to make some changes, go ahead



I forgot, for each button we put the same code, but we change the name of the text file, so that more buttons are created and each button reads the text in the label

bye bye

#20
hello, thanks for the answer, then let's start over, a simple thing for you, use the animated command that from how as you can see in the picture does not work because I'm wrong something,
gclock = gui
bclock = button gui gclock
clock24 is view animated
what am i wrong with this command ?, what should i write exactly, then first i was trying your script but by mistake i then send you the photo, of your script i created 4 int in global variabiles and copied your script, on function repeatedly_execute_always ()
only that later he gave me an error at this point

GlobalScript.asc(128): Error (line 128): Nested functions not supported (you may have forgotten a closing brace)

// Called when a dialog script line "run-script" is processed
function dialog_request (int param)
{
}

thanks anyway :)





SMF spam blocked by CleanTalk