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

#1241
The Rumpus Room / Re: *Guess the Movie Title*
Fri 03/02/2017 17:01:40
I dont know what movie either but I thought she looked more like Demi Moore.
#1242
The Rumpus Room / Re: *Guess the Movie Title*
Fri 03/02/2017 15:24:03
Flight 93?
#1243
Proper indention would help. but try this: (basically what your missing is an else condition to not check the second if.
Code: ags

function csarge_Talk()
{
  cEgo.Walk (75, 125, eBlock);
  cEgo.FaceCharacter (csarge);
  if(sargespoken == 0)
  {
    cEgo.Say ("You wanted to see me, sergeant?");
    csarge.Say ("Ah, Private Smith. That latrine needs cleaning. Hop to it.");
    sargespoken = 1;
  } else if (sargespoken == 1)
  {
    csarge.Say ("Have you cleaned that latrine yet?");
  }
  if (sargespoken == 3)
  {
    csarge.Say ("That explosion came from up the trench!");
  }
}
#1244
1) the variable has to be defined outside of the function because anything defined in the function will be reset when the function is called again. When you call a function you can pass in a variable, but the value that changes in the function has to be stored when the function returns. I dont know if that helps explain it.
2) The problem I think with that code is when you call GetViewportY the value is the same from the prior call since you set the view port. Therefore when you call the function again your moving even farther up. I believe what you want is to base the viewport on the current location of the player. something closer to:
Code: ags

int yCoord = (player.y - 100); 
SetViewport(GetViewportX(),yCoord);

not sure if 100 is too much or too little but you can play around with different values
#1245
My previous response was in reference to your #4 issue. In response to your #3 issue There is a command "SetViewPort" you can use. look it up in the manual and you can set it in the repeatedly_execute function. As far as issues #1 and #2, I don't know how to help with that.
#1246
My Mistake...

Calling BookPage with a parameter of (+= 1) always passes in a 1.
You need to have a variable to store the current setting then add 1 to it before passing the variable in.

Change the function to:

Code: ags

int bp;
function BookPage(){
 
 if (bp == 0){
   bBookPage.NormalGraphic = 33;
 }
 else if (bp == 1){
   bBookPage.NormalGraphic = 34;
 }
 else if (bp == 2){
   bBookPage.NormalGraphic = 35;
 }
 
 
}

function bTurnRight_OnClick(GUIControl *control, MouseButton button)
{
  if (bp<2) bp++;
  BookPage();
}

function bTurnLeft_OnClick(GUIControl *control, MouseButton button)
{
  if (bp>0) bp--;
  BookPage();
}

#1247
If you are asking for "best practice" then I would create a function in the global script called something like "ResetCharacters" that would set any setting that the game could change on any character back to a default setting Then in each room in the Load event just call that function. This will save you time in changing every rooms load just because some new character you set the scaling or transparency or whatever setting to something different.
#1248
Also, I remember reading in the manual even though I haven't used it myself, but if each game was a different room then there is a "ResetRoom" function that can reset all the variables that are in that rooms script.
#1249
Just an idea and not sure if this will work or not, but being a programmer for 30 years if I had a function that was being run and I didn't know where it was being called I would put a breakpoint in the function then step until it returns from the function to see what is calling it. The function may be called from a place you didn't know you were calling it from.
#1250
First off I want to say I would probably use arrays for controlling what you are asking for. But I basically wanted to reply because if you have an "enemy10" then you do the IndexOf for "enemy1" it will return true even though enemy1 was not in there. To fix that you can add a comma after the words and look for that comma in your querys.
Code: ags

if (eventPlace1.IndexOf("enemy1,")==-1) {
**code for encountering an enemy
eventPlace1 = eventPlace1.Append ("enemy1,");
}
#1251
Add the variable in the Global Variables section and you can reference it from anywhere, however it wont automatically update a label on a GUI.
What I would do is create a function that sets the global variable and updates the label on the GUI, then anytime the planet name needs to change call the function instead of just setting the variable.
#1252
Only way I can see to do that is create a different text window gui with each of the different colors you will use then switch between them.
#1253
Not totally sure why it works the way you have said and if someone knows better then correct me but you say that there should only be 3 sounds playing at any one time. There may be just 3 different sounds playing but the sounds are dynamically assigned to channels. If these sounds are in a walk loop and the sound has not completed when the walk cycle returns to the same frame it will start another copy of that sound so if the sounds however short they are are still playing when the cycle comes around again it will use another channel. This is just a guess but Perhaps the reason it stops if they skip the cutscene is because skipping the cutscene plays all of the commands really fast until it gets to the EndCutScene line. I do know for sure but one time i had problems with sounds within walking and cutscenes before, but i just decided to remove the sounds from the walking view.
#1254
This is just a guess...
What happens if you change the priority of that sound? Possibly it is playing the sounds from the walking and one of them starts to use the last channel available then when another sound comes in it unloads that sound. Try changing the line to:
  NightAmbience = aOutside_ambience.Play(eAudioPriorityHigh, eRepeat);
#1255
Kris, Just an FYI, you called your function UpdateMouseMode, but then when you called it you put UpdateMouseGraphic.
#1256
void just says the function does not return a value.

The correct export line would be:

export setCursorDirection(PointerDirection dir);

However I was looking at the code. the function setCursorDirection should be in your global script then in the header it should be:

void setCursorDirection(PointerDirection dir);

The function is not "exported".
#1257
That does not create 12 new characters. It creates an array to store Character pointers. Character pointers are nothing more than data that points to an existing character.
#1258
It is not a big deal either but it is not necessary to check to see if mouse mode is not eModePickUp before setting it to be that.

What I mean is:
    if (mouse.Mode != eModePickup)
    {
      mouse.Mode = eModePickup;
    }

could have been just written as:
    mouse.Mode = eModePickup;

since if it is already set then setting it again is not going to change things.

If you have animated cursor that would be the only reason to check first.
#1259
There is so many ways to do this. all of the above can work or you can make the room larger than resolution and place the character off screen beyond what would show up based on walkable areas. I did that once before. I had walkable areas on the entire left side and across the bottom then placed a character I wanted in the room but not to show up on the screen in the upper right corner.
#1260
Even though it might be possible to do a game with no scripting it might be necessary to do just a little scripting. I learned most of what I know by reading the manual and going through the tutorials provided densming
https://www.youtube.com/watch?v=1Ml_DR76Cl4
SMF spam blocked by CleanTalk