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

#101
Is it possible to create a custom inventory where, if the player character has a stick of dynamite in his hand, the player can click on it, select a rock (for example) and the character will detonate the dynamite in front of the rock?
#102
Ah, cheers, Khris. I didn't think of that. Everything works well now, thank you very much. You know, with the amount you've done for me, I'll have to give you a credit in the finished game huh?
#103
Another minor issue here. I'm trying to get it so that the character spawns over the area icon (cactus for the desert etc (the ones I've drawn the regions over and I haven't set anything in the 'While standing on function' so nothing should trigger there). The issue is that I keep being sent back to the starting room.

Here is the code currently;

Code: ags

if (keycode == eKeyM) {
    if (player.Room != 1) {
      if (player.Room ==2) player.ChangeRoom(1, 160, 120);
      if (player.Room ==3) player.ChangeRoom(1, 312, 173);
      if (player.Room ==4) player.ChangeRoom(1, 275, 119);
    }
    else player.ChangeRoom(player.PreviousRoom);


I assume that the error occurs from the 'else' statement, but how do I go about fixing it?
#104
Thanks, Cassie, you fixed it for me. Khris, they are both there. I just didn't paste them in.
#105
Ok, I've another issue now. My current code for another character is the following:

Code: ags

Jackson: Excuse me, sir?
MarketStall: G'day, mate.
MarketStall: What can I do ya for?
Jackson: Well, you see.
Jackson: I was wondering if you'd be so kind
Jackson: As to allow me to buy a stick of dynamite?
MarketStall: Hehehe...
Jackson: Yeah, I know.
Jackson: That sort of thing
Jackson: Would only happen in video games.
MarketStall: Hehehe...
MarketStall: I'll tell you what, my good mate.
Jackson: Yes?
MarketStall: As this is only a demo,
MarketStall: I'll let you have one on the house.
  cJackson.AddInventory(iKey);
Jackson: Thank you very much.
[\code]

And this is the function:

[code=ags]
function cMarketStall_Talk()
{
  dMarketDynamite.Start ();
}
[\code]

The issue is when I click the character in Talk mode, the conversation doesn't start.
#106
Cheers. I always seem to have issues with the minor stuff, strangely.
#107
I have changed the code to the following:

Code: ags


function cWiseSage_Talk()
{
  if (player.Room = 2) dCrystals.Start();
  if (player.Room = 3) dMPTutorial.Start();
}

[\code]

I also get the following error.

GlobalScript.asc(535): Error (line 535): Parse error in expr near 'player'

What am I doing wrong here?
#108
How do I get it so that dCrystals DOES activate in Room 2?
#109
I am having an issue getting a character to say different dialogues in different rooms.

Here is what the code looks like at the minute;

Code: ags

function cWiseSage_Talk()
{
  if (player.Room != 2)  dCrystals.Start();

  if (player.Room != 3) dMPTutorial.Start();
}
{/code]

The game will run but bMPTutorial will run in room 2, skipping dCrystals entirely.
#110
Oh, right. Sorry for the misunderstanding. Thanks for all your help though :smiley:.

I'll be sure to keep your advice in mind.
#111
I've put in the script to get the room to change to the desired location. Now, I just need the character to spawn on the walkable area.

These are the character's X and Y coordinates when he spawns when the game starts up (in the desert area).

StartX: 238
StartY: 224
#112
How do I get the region selector out of erasor mode and into a mode where i can select what region i want?
#113
At what point does the tutorial tell you how to do regions? I can see hotspots but no reasons.
#114
All fixed now thanks. :grin: By the way, Khris, what should the 'Player walks onto' event look like if it is set to go to Room 2 (both in the bottom right Events window and in the Global or Room Script (depending on what's better to use for this)?

Hopefully I make sense there.
#115
The code is adapted. Another issue has arisen with a code i haven't touched.

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

Here's what the code looks like

[code/ags]
if (keycode == eKeyM || keycode == eKeyTab) {
    if (player.Room != 1) player.ChangeRoom(1);
    // uncomment the following to make M also go back
    // else player.ChangeRoom(player.PreviousRoom);
  }


function on_mouse_click(MouseButton button) {
  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
[code/ags]

Also, how do I make it so that, for example, if the player walks onto the palm tree object on the map, it takes him to the desert. Does that make any sense?

EDIT: I changed 'keycode' to 'eKeyCode'
#116
Thanks. I've added Khris' code and I get this error message.

GlobalScript.asc(213): Error (line 213): static non-property access: internal error

Hopefully it's just a silly mistake, but hey.

Also, would I be able to have the Tab button as a second Map key, so if you were playing on a laptop, you'd use the Tab key instead of the M key?
#117
I have hit a dead end in coding my Map Screen in-game. I want to be able to bring up the Map Screen when the M key is pressed. But I keep getting error messages when I try and run the game. Here's what the code currently looks like;

Code: ags

function MapScreen;

if ((keycode == eKeyM) 
{
  cJack.ChangeRoom(1)
}


Would I also need to move said script away from the Global Script or is it ok where it is?

Finally, can somebody please demonstrate a way of stopping the script from working in the Map Screen itself?
SMF spam blocked by CleanTalk