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

#121
To set up a character's default views, double click them (under Characters) in the editor and assign the view numbers you want in the little Properties box (bottom-right of the screen).
You can set view numbers for 'Normal' (standing/walking), 'Speech' (looped while talking), 'Idle' (played after a little while of not moving) and 'Blink' (which makes characters blink, but only if you're using Sierra style speech).

To change a character's view in a script during the game, it depends on whether you want it to be temporary (like for a one-off animation) or permanent (like for a change of clothes).

To temporarily change view, you use something like this:
Code: AGS

cYourChar.LockView(10); // Lock YourChar's view to view number 10
cYourChar.Animate(0, 3, eBlock); // Animate YourChar using loop 0 of the locked view, at a speed of 3.
cYourChar.UnlockView(); // Returns YourChar's view to the 'Normal' one you set in the editor.


To make a more permanent change, like a change of costume, you can do this instead:
Code: AGS

cYourChar.ChangeView(10); // Change YourChar's 'Normal' view to view 10
cYourChar.SpeechView = 11; // Change YourChar's 'Speech' view to view 11
#122
Woo! New pictures!





There's a trailer coming soon - we're just waiting for some boring administrative stuff before we release it!
#123
Thanks - I removed the overlay fiddling in game_start and added "invOverlayX!= null" conditions to all the functions which modify them instead, and it seems to be working A-OK. No more null pointer errors!
#124
How the devil do you get the flag down from the pole?
#125
Quote from: Crimson Wizard on Mon 12/11/2012 13:13:00
A note.
Overlay creation functions are static. That's why you do not have to use object's name:
Code: ags

invOverlay1.CreateTextual(20, 20, 400, Game.SpeechFont, 10, "");

You may write just:
Code: ags

Overlay.CreateTextual(20, 20, 400, Game.SpeechFont, 10, "");



But unless I assign it to an Overlay* variable, I can't move it around in rep_exec_always - unless I'm missing something?

Quote from: geork on Mon 12/11/2012 12:48:06
Doesn't this:
Code: AGS
invOverlay1 = invOverlay1.CreateTextual(20, 20, 400, Game.SpeechFont, 10, "");
invOverlay2 = invOverlay2.CreateTextual(20, 40, 400, Game.SpeechFont, 12, "");

validate both overlays? This would explain why your first two conditions when adding an inventory item don't execute.

Hope this solves it! :)

I dropped a couple of lines in afterwards (invOverlay1.Remove();) and that seems to have cleared the problem up. Not sure how it worked before, though?!
To anyone thinking that I'm insane to create two overlays in game_start and then immediately remove them, I was getting null pointer errors if I didn't do it.
#126
I've got some random problems with on-screen overlays that are really confusing me!

Whenever a player character gets a new inventory item, I display the name of the item as an overlay (which is then shown for a few seconds and then shuffled off-screen). This was working fine, but in a newer build I'm testing, the overlay doesn't display. I should stress that I haven't touched any script to do with the overlays - it just stopped working today.

The overlays are created initially in game_start() to avoid null pointer errors:

Code: AGS

// invOverlay1 and 2 have already been declared at the top of globalscript.asc
invOverlay1 = invOverlay1.CreateTextual(20, 20, 400, Game.SpeechFont, 10, "");
invOverlay2 = invOverlay2.CreateTextual(20, 40, 400, Game.SpeechFont, 12, "");


Here's my event handler function from the global script:
Code: AGS

function on_event(EventType event, int data){
	if(event==eEventAddInventory){
		if(!invOverlay1.Valid){ // Check if the first overlay is free or not
			Display("Setting overlay 1");
			invOverlay1 = invOverlay1.CreateTextual(20, 20, 400, Game.SpeechFont, 10, "+ %s", inventory[data].Name);
			SetTimer(19, 120);
		}else if(!invOverlay2.Valid){
			Display("Setting overlay 2");
			invOverlay2 = invOverlay2.CreateTextual(20, 40, 400, Game.SpeechFont, 10, "+ %s", inventory[data].Name);
			SetTimer(19, 120);
		}/*else{ // Force overlay 1 to be used, even if it's already in use (overwrites existing text)
			invOverlay1 = invOverlay1.CreateTextual(20, 20, 400, Game.SpeechFont, 10, "+ %s", inventory[data].Name);
			SetTimer(19, 120);
		}*/
	}
}


The overlays are then modified by repeatedly_execute_always thusly:
Code: AGS

if(IsTimerExpired(19)){ // Initial timer has expired - start moving the overlay off-screen
	if(invOverlay1.Valid && invOverlay1.X == 20){
		invOverlay1.X --;
	}
	
	if(invOverlay2.Valid  && invOverlay2.X == 20){
		invOverlay2.X --;
	}
}

if(invOverlay1.Valid && invOverlay1.X < 20){ // Overlay is valid and has started moving off-screen
	if(invOverlay1.X > -100){
		invOverlay1.X -=2; // Not off-screen yet - keep moving
	}else{
		invOverlay1.Remove(); // Overlay.X is <= -100, so remove it
	}
}

if(invOverlay2.Valid && invOverlay2.X < 20){
	if(invOverlay2.X > -100){
		invOverlay2.X -=2;
	}else{
		invOverlay2.Remove();
	}
}


With the above code, the overlay does not appear at all when picking up an item.
If, however, I un-comment the 'else' condition in on_event ('// Force overlay 1 to be used'), it shows up.

It works, then, but I have no idea why it suddenly didn't until I added the else condition. As I said, it was working absolutely fine when I started the game in an earlier build, and I hadn't touched the overlay code until it stopped working today.

Any ideas to set my mind at ease?
#127
Quote from: Revae on Sat 10/11/2012 03:29:51
That's some mighty fine pixel art you got there.

Thanks! As you may know from subAtomic and Plan M, we love it so much that we scale it by up to 800% on-screen. Just so you can really appreciate those pixels.

I mean what's the point of spending an hour putting a pixel in the right place if you aren't going to have it be 3 inches across on-screen?

Quote from: CaptainD on Sat 10/11/2012 13:07:43
Didn't this guy appear in LEGO Pirates of the Caribbean?

I've been told by our lawyers to say "absolutely not" and then wink.
#128
Thanks for the replies! I'll check 'em all out.

As a reward, here's the top half of one of our characters enjoying a spinny-office-chair.



It's best not to ask where his legs went.
#129
Quote from: Ghost on Wed 07/11/2012 15:44:25
I once vowed to play every game where there is a fuel station in the desert with a loo next to it. (Long story) Since not even Borderlands 2 delivered, you are my last hope, Murray! Looks great so far!
I'm both intrigued and a little scared about the long story that created that vow, but I'm glad we can help!

Update: I'm busying myself putting together the last few scenes of the game before we move on to some full testing sessions next week. We're also still sorting out the sounds and music, but it's getting close!

Does anyone have any particular 'favourite' places to buy downloadable games? I want to make sure we're getting in touch with everywhere we can.
#130
Aha - excellent. That's what I wanted to know, thanks guys!
#131
Is there any easy/quick way to cast a boolean variable as an integer (0 or 1)?

I've got a series of hotspots that can be switched on/off, and I'd like to be able to use their state to also modify their sprite number (hotspot.Graphic -= hotspotState).

I could just store their state as a 0/1 integer, but it seems more efficient to store it as a boolean if possible.
#132
Glad to hear it's working.

Quote from: slasher on Mon 05/11/2012 14:46:21
Quotewhy are you setting Larrowsprice.Text in the cancel button click event?
Because it's a Cancel last order and it is done via a button. Once pressed it takes away 6 elfins from the total and lowers the quantity by 1. The cancel button now stops at 0.

My query was more about how your script looks like it's doing some unnecessary work.

Your cancel button does this when it's clicked:
Code: AGS
Larrowsprice.Text = String.Format("%d", arrows -6);


But then, in 'repeatedly_execute_always', you're also running this line every frame:
Code: AGS
Larrowsprice.Text = String.Format("%d", arrows *6);


There's no need to set the Text property of the label when you click the cancel button, because it's going to be set to the correct value by the line in repeatedly_execute_always on the very next frame.
#133
I'm not entirely sure what your code is doing here - in particular, why are you setting Larrowsprice.Text in the cancel button click event? It's set in repeatedly_execute_always, so it'll just get overwritten again next frame.

In any case, you can easily stop a number from going below zero like this:

Code: AGS

function Bcancel1_OnClick(GUIControl *control, MouseButton button)
{
    if(arrows>0){
        arrows = (arrows-1); // This could also be done with 'arrows--;' or 'arrows-=1;'
        Larrowsprice.Text = String.Format("%d", arrows -6);
    }
}
#134
Quote from: selmiak on Fri 02/11/2012 22:20:36
So do all these games and steam have open source code then?

Not in the slightest. I'd be very surprised if Valve open-sourced any of their software.
#135
I'm guessing what you want is to set the cursor mode back to 'Interact' after combining two inventory items?

It's a bit hacky, but you could do this in your global script:

Code: AGS

function on_event(EventType event, int data)
{
 if(event == eEventAddInventory && mouse.Mode == eModeWalk)
 {
  mouse.Mode = eModeInteract;
  mouse.UseModeGraphic(eModePointer);
 }
}


That way if you gain an inventory item, it sets the mouse pointer back to interact mode.

The check for 'walk' mouse mode is in case the player gains inventory items using a different cursor mode - I'm guessing that at no point in your game do you get an inventory item while using the walk cursor, so it should work fine like this.
#136
Quote from: Ali on Mon 15/10/2012 13:16:34
there's a clip somewhere with Tim Schafer and Ron Gilbert (I think) talking about the fact that verbatim' dialogue allowed them to do four jokes really, as the player is presented with four different punchlines.

It also allows for a type of fourth-wall breaking joke that the other types don't! I really enjoyed it in the LucasArts games (I don't remember exactly which one(s) did it, but I'm guessing at least Monkey Island) when the player chooses some kind of badass response, but the character is too chicken to say it, and uses a different response instead.
#137
I've been playing The Longest Journey lately (this is actually my first play-through!) and I've noticed a lot of people saying it has 'amazing' or 'excellent' voice acting, and that the voice-over work is one of the key things that make it such a great game. What I haven't seen, though, is anyone explaining why it's so excellent. No-one goes into any detail about what makes it brilliant, they just say that it is.

We're shooting for a fully-voiced release of Astroloco: Worst Contact when it comes out (see our In Development thread here), and I want to know what you think makes voice-acting great.

If you've done VO for adventure games before, what are the major pitfalls, and things to aim for?
#138
Quote from: ThreeOhFour on Tue 30/10/2012 17:55:16
I will play the trousers off of this game.

Now that's the kind of borderline-creepy enthusiasm I like to hear!

I'll keep the thread updated as we move closer to release. Not sure about the demo content yet, but it'd be crazy not to have one.
#139
Quote from: CaptainD on Tue 30/10/2012 10:43:39
Looking forward to seeing this at Adventure-X!  8-)

Thanks! I actually felt bad seeing the impending release of Captain Disaster - I was worried you might think we decided to jump onto a sci-fi point & click bandwagon. Then I realised Captain Disaster doesn't have trains in, and I felt okay again.

Great looking game, by the way - the demo was awesome. Definitely a must-buy! But it doesn't have trains in it. Unless that's going to be a secret reveal at Adventure-X.

I hope not.
#140
Quote from: selmiak on Tue 30/10/2012 01:06:02
I like that the hammer is selected to plug in the Gary Gamebox :D
looking very great already!

I think this might be the first game I've made where a hammer isn't used for fire suppression.
SMF spam blocked by CleanTalk