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

#1
Sorry for the incredibly late reply, but thank you so much Khris, I was able to get it to work perfectly with your help!! You're the best, man!! :D
#2
Hello, I am implementing my game to have two playable characters, which I have the character switching portion of the code working fine. But I want them to follow each other, particularly in a Hiveswap act 2 manner, (a more classic, but not as accurate to my scenario, example might be how Sam & Max: Hit the Road do it) where the non-active player follows the active player, until switched.

my code so far is this:
Code: ags
     else if (keycode == eKeyF1)
    if (player == cEgo) {
      cRoger.SetAsPlayer();
      cEgo.FollowCharacter(cRoger, 0, 20);
    }
    else if (player == cRoger){
      cEgo.SetAsPlayer();
      cRoger.FollowCharacter(cEgo, 0, 20);
    }
I have two problems:

1. They do not start to follow each other until F1 is actually pressed, which yeah, duh, its on function on_key_press, so no surprises there. I tried putting the (FollowCharacter portion of the) code into the function repeatedly_execute(), which did work, but I did not think this was code that needed to be ran repeatedly. What would be the proper way to make the character automatically start following each other when the game starts?

2. When they do follow each other, they get get a bad case of rubberbanding. As in, the active player character will move, the non-active player character will follow behind, and then the active player character in front will course correct, and move backwards to follow the non-playable character, even though they shouldnt be following them since the non-playable character should be the only one following anybody.

Any help is greatly appreciated, thank you so much for your help!!!! :D
#3
Quote from: Crimson Wizard on Tue 05/03/2024 17:49:01have you put cEgo_AnyClick function to corresponding AnyClick event in the events table?
Oh my gosh, you were right... I just overlooked the "AnyClick" event on Ego... My biggest problem with anything is that I always overlook the simplest of things!!!! Thank you so much for your time and wisdom!!! :D
#4
Quote from: Crimson Wizard on Tue 05/03/2024 16:00:13This error usually means that you have some function name inserted into events table of this given hotspot, but the actual function does not exist, so engine cannot run it.
Oh my gosh, ok. I finally understand how events work, I guess it just wasn't clicking in my head until just now. I was able to stop that error, and also able to get the Sniff action to work with Ego after realizing this too, sorry for my ignorance ^^"

Quote from: Crimson Wizard on Tue 05/03/2024 16:00:13You don't, like I mentioned, in the case of any more verbs you will have to use "AnyClick" event and check active mode using "mouse.Mode".
So, I have tried this. I made a dummy cursor just to test having more cursors, and called it "Bark", inspired by your example in your first reply. However, when I use this code in the globalscript:
Code: ags
function cEgo_AnyClick()
{
    if (mouse.Mode == eModeSniff)
    {
      Display("Smells like... Blueberries?");
    }
    else if (mouse.Mode == eModeBark)
    {
      Display("Don't yap your mouth!");
    }
}
absolutely nothing happens.
The Sniff action will still work if I use the code I posted last time now that I have properly set up the event, but not when I try to use it using AnyClick. And like you said, AGS only supports events up to that 2nd usermode, so I cant just create an event in Ego with the Bark action. I feel like its super simple in the same way I misunderstood how events worked, but am just too ignorant.
You have been such a great wealth of knowledge, thank you so much for your time and for being patient with me!!
#5
Thank you so much for your response!! I have a few follow up questions, but I think I am getting the hang of this.
Quote from: Crimson Wizard on Tue 05/03/2024 11:41:39As you may notice, there are 2 extra interactions there, called Usermode1 and Usermode2. These are 2 reserved events for custom actions. If you rename an existing cursor type, then these events will be renamed automatically.
So, before I had just created an entirely new cursor, and it wouldn't work. When I used your advice and made a carbon copy of the new cursor onto Usermode1, it worked, and showed up in the events of the hotspot! Does this mean I can only have two extra verbs? How can I get a newly created cursor to show up in events when I use up both Usermodes?

Secondly, when I sniff the walkable area hotspot, the game crashes with Error:
Code: ags
RunScriptFunction: error -18 ()trying to run 'hHotspot0_Mode8'  (Room 1)
I have not defined Sniff to do anything when interacting with the walkable area, or defined it to interact with whatever 'hHotspot0' is, do I need to include something just so it doesn't crash like this? Is it because I have Standard Mode enabled on the edited Usermode1 cursor that I made into Sniff?

And lastly, the Sniff action still does not do anything when trying to use it on ego! I followed suit in the global script with this code:

Code: ags
function cEgo_Talk()
{ //this code isnt mine, but I am including it to show that this action works as intended when trying to talk to Ego...
  Display("Talking to yourself is a sign of madness!");
}

function cEgo_Sniff()
{ //And this is my code, which does not produce the same expected dialogue box as using the other actions on ego, and also sniffing the orb works, so I am not sure why this doesn't
  Display("Smells like... Blueberries?");
}

I even tried to use the code you provided, and attempted this:
Code: ags
function cEgo_AnyClick()
{
    if (mouse.Mode == eModeSniff)
    {
      Display("Smells like... Blueberries?");
    }
}
Which also did not work! What am I doing wrong?

And again, thank you so much for your help!! :D
#6
Hello, I have begun work on a new game, and most of my endeavors in the past were with Thumbleweed, so I am like a fish out of water in this Sierra environment.

I am wanting to add a few custom verbs for this game, not sure about all of them just yet, but one I have thought of is a "Sniff" verb, basically allowing the character to smell things (this isnt just useless flavor text, i have thought of several puzzle ideas for it, i do know excessive verbs like this get a bad rep). So far, I have created a little nose icon for the cursor, and the mouse detects it when scrolling through all of the cursor types, which is a good sign so far. However, when I click on anything with the Smell verb active, nothing happens!

I have the cursor named "Sniff", and the room code for a test is as follows:

Code: ags
function cEgo_Sniff()
{ 
Display("Smells like... Blueberries?");
}
and
Code: ags
function hGlowingOrb_Sniff()
{ 
Display("Smells a bit burnt...");
}

I cannot for the life of my find out where in the scripts verbs/actions are handled, so I cant even cross reference my new cursor with one that already works, like say "LookAt". Any help at ALL would be greatly appreciated, thank you so much!!!!
#7
Quote from: Khris on Mon 04/03/2024 17:20:15Unfortunately, while that template does have some options, adding a 5th verb isn't one of them.
I was rewriting it for somebody else who wanted six buttons, and it was a lot of work, since it is hard-coded for four buttons almost everywhere in its script.
Ah ok. Thank you for your input! Would the Sierra style template be better for implementing more actions like what I'm wanting?
#8
Hello, I am tinkering with AGS again after a few years. I was wanting to make a Verbcoin system with a few special actions, not just the default "Look, talk, Pickup, Interact". I specifically wanted to use a "Sniff" action, and have created a simple nose icon in which I want to use in the Verbcoin. In the room hotspots, I used Usermode 1 to act as a Sniff command (From what I read, the usermodes are how you utilize unique actions, but please correct me if I am wrong.) with the room code being:

Code: ags
function hGlowingOrb_Sniff()
{
  player.Say("It has a sort of burnt smell to it.");
}

I could not find much documentation regarding Verbcoin GUI in the manual, and even less for the Usermodes. What do I need to do to add my custom Sniff graphic to the Verbcoin? Is Usermodes even the correct way to add custom actions like what I'm wanting? Where in the scripts is the Verbcoin handling so I can modify it?

Thank you so much for your time!
#9
Quote from: Crimson Wizard on Sat 05/09/2020 23:42:54
I could try exe too, maybe something comes up... but game sources are the files that lie in the project root folder: *ash/*asc, *.agf, *.crm files and so on.
Alright, what would be the best of of going about that?
Would compressing them into a .zip file, and uploading it to something like Mediafire, and then sending the link here be fine with you, or does the AGS Forum not allow links to downloads like that?
#10
Quote from: Crimson Wizard on Sat 05/09/2020 22:52:25
If it's just a test game, could you upload it somewhere for us to look in?
How should I go about doing that?
I would doubt that the EXE would suffice, unless AGS is able to decompile games.
#11
Quote from: Crimson Wizard on Sat 05/09/2020 14:36:16
In above script examples you keep alterating between "cDummy", "cRoger" and "player". You have to be consistent there. Who is "cDummy" and "cRoger"? is anyone of these a player character? who is a character that has a pillow in inventory? Who is a character whose inventory is displayed by inventory window?
Ok, this is my bad for not clarifying earlier.
When I started out, I made my own character (cDummy), since this game I'm making is just a test to test all all various kinds of things in AGS before I start making ACTUAL games, so I wanted to try making my own character.
But between the first post, and my next post with code with the inconsistency, I decided to change back to cRoger, due to him looking better than the character I made. (And yes, I also changed any and all code with "cDummy" to "cRoger")
There are no other playable characters, just me switching between the character I wanted to use for the game is all.
I'll go back and edit previous posts to make it consistent to how it is in my code currently, sorry for the confusion.


Quote from: Cassiebsg on Sat 05/09/2020 12:20:28
You sure the player isn't starting with a pillow already in inventory? Maybe you gave him one to test some other code and forgot to remove it?

EDIT: Only other thing I can think of, is try to use player.LoseInventory instead for cRoger or cDummy.... if they're the player doesn't matter, but if their not, it does matter.
Nope, the pillow isn't in the starting inventory, I just checked.
and sadly, changing the code to player.LoseInventory didn't do anything :(
#12
Quote from: Cassiebsg on Sat 05/09/2020 10:17:52
Can you show the pick up code?

Yeah sure!
(this is in the middle of the function "oPillow_AnyClick()" with other verbs on it, so that's why it might come off as a bit disjointed on here)
Code: ags
    // PICKUP
    else if(Verbs.UsedAction(eGA_PickUp)) {
      player.Say("Fine, its really comfy.");
      oPillow.Visible = false;
      oKey.Visible = true;
      player.AddInventory(iPillow);
    }


I'm going to sleep after posting this, so I'll try stuff out later when I wake up.
Good night, and thank you guys for the help!!!! :D
#13
Quote from: Slasher on Sat 05/09/2020 08:30:49
Maybe it's the Tumbleweed template coding..

Yeah, that's what I'm starting to think... :/

Oh well.  :(
#14
Adding that sort of elif to the bed wouldn't do much, since the inv pillow is the only inventory item in this "game". (Really more of a test adventure for me to learn AGS.)
Trust me, before making this thread, I more than triple checked spelling of it everywhere, and did again before posting this.

Are there any alternate ways to lose an inventory item that I could try out?
#15
Nope, it doesnt work. The pillow stays in the inventory.
When the pillow USEd on the bed, the pillow on the bed becomes visible, and the text "Fine, I'll fix my bed!" appear, but iPillow doesnt leave the players inventory.
I even tested, you can repeat the dialogue sequence if you attempt to USE the pillow on the bed once more, even after the pillow on the bed is visible again.
#16
Nope, it didn't work. :(
The pillow is still in the inventory after I USE it on the bed. However, the other parts of the code work (Making the pillow visible again, and the dialogue).
And when Dummy does that, he walks down a few steps and then says "That won't do any good." and I'm still not sure why that happens.  ???

The code now looks like this (It didn't change much from before, but just in case it helps at all, I decided to post it again.):

Code: ags
function oBed_UseInv()
{
  
  if(player.ActiveInventory==iPillow){
   player.Say("Fine, I'll make my bed!");
   oPillow.Visible=true;
   player.LoseInventory(iPillow);
  }
}


I'm honestly stumped!  ???
#17
Hello! I'm a TOTAL newbie with AGS, I downloaded it earlier today, so I'm sorry if this is a stupid question I'm asking lol.

So, in my game, what I'm trying to do is make my character pick up a pillow on their bed and add it to their inventory (I got that working) and then be able to USE the pillow on the bed to put it back and remove it from the inventory.
The problem is that it wont leave the inventory when I USE it on the bed!
(I'm using the TumbleWeed template, if that helps any.)
Code: ags
function oBed_UseInv()
{
 if (player.ActiveInventory == iPillow) {
   player.Say("Fine, I'll make my bed!"); 
   player.LoseInventory(InventoryItem iPillow);
   oPillow.Visible = true;
   }
 }


He also says "That won't do any good." after trying to USE the pillow on the bed as well, and I'm not sure how to fix that either.

I've been able to Google search previous problems, but I've been having trouble finding a solution to this. I'm also not the best at coding lol.

Thank you!!!!  ;-D
SMF spam blocked by CleanTalk