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

Topics - The creature

#1
As the post title says: is there a way to have no items selected when a listbox is displayed. By default, the first item is always selected.

I'm sure there is a way as it was asked in the forum a while a go, but I've made a forum search and found nothing and I can't find anything in the manual about having all items deselected.

If I set the selectedIndex to -1 (like it says in the manual) it works. But, in a repeatedly executed I'm selecting items via string names and when I do this I get a compile error

Any help would be great.

Chris.
#2
Hello all

I'm running into a problem that I usually do fine without much thought. I have a struct and I'm trying to display text from it in a label

The error I receive is: formatting argument 1 is expected to be a string, but it is a null pointer.

Interestingly enough if I switch it to display an entry that is a number rather than a string it is fine.

I've displayed text this way before in other projects and have never seen this error before.

My code is:

Code: ags

LStable1.Text=String.Format("%s", readyCreature[0].Name);


When I use other entries from the array I get no issues. Just when I use a text items. And again, I've done it this exact way before in other projects and it's been fine.

I tried modifying the label text using another Struct I made and that displayed correctly...so I have no idea what is going on with that other one...

Total loss.
#3
Hi everyone. I have a quetion and it might be a complicated one.

In one of my rooms I have 20 objects that are randomly being placed between 2 specified points:
Code: ags

  int Shallows_X = 960;
  int Shallows_Y = 960;
  object[1].SetPosition(Random(Shallows_X)+20, Random(Shallows_Y)+50);
  object[2].SetPosition(Random(Shallows_X)+20, Random(Shallows_Y)+50);
  etc.....


This is fine but there are areas within my environment (like walls and other solid objects I'd ideally not want these objects to be placed on. Is there a way to code in a check that places each object randomly on a walkable area. I am using regions for another game system and use multiple regions but I am only using one walkable area per room (at the moment at least).

Any help is appreciated as it would make such a big visual difference.
#4
Hello everyone.

I'm looking for some advice. I have a lot of underwater environments in the project I'm working but at the moment it's very bare and lacking sea life. My question is what would be the best/simplest way (I'm a medium level coder with AGS and wouldn't call myself advanced) to achieve shoals of fish that randomly swim about the room? Not neseceraly in groups.

I did think about just creating a lot of fish characters and have them move to a random x, y from 0 to the max room size, but creating all those characters seems like an awful lot of work, and I don't really want my project cluttered with an army of fish characters. I did look at the steering behaviour plugin but I couldn't really understand it although it sounded perfect for what I want to do (no example project files). So I pose the question? How would you approach this problem?

Any help would be appreciated.
#5
Hi Everyone

I know this is an issue that has come up time and time again but for the life of me I cant find anything about this problem (although I'm sure I have seen posts about this in the past). But I'm trying to display character names in a GUI on mouse over. I need to display a custom text property though as I need to change some character names at runtime.

my script is as follows:
 
Code: ags

// Display character names.
  Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
  if (ch != null)
  {
    String npcName = character.GetTextProperty("NPC Name");
    gDetailsBox.Visible=true;
    lPointerOver.Text=String.Format("%s", npcName);
  }


At the moment it gives me a compile error saying it's requiring a [  doesn't make a lot of sense to me. I just cant seem to figure it out although on paper it should be pretty simple. Does anyone have any thoughts?

The help would be appreciated as it's really bugged me for a long time.

The C



*************
** Update
*************

I am very sorry, I figured it out but here is my code for future ref:

Code: ags
  
  //*******
  // Display character names.
  Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
  if (ch != null)
  {
    String npcName;
    if (ch) npcName = ch.GetTextProperty("NPC Name");
    gDetailsBox.Visible=true;
    lPointerOver.Text=String.Format("%s", npcName);
  }


again, very sorry.
#6
Hi

I'm having an issue with Listboxes. I have a listbox that can have multiples duplicate items. The issue is I want to remove a selected item from the listbox, but as expected it's removing all duplicates of that name.

Is there a way to just remove a single duplicate entry?

My code follows:

Code: ags
String EquipTool1 = ListBox_Toolbox.Items[ListBox_Toolbox.SelectedIndex];
    if (EquipTool1 == "Crowbar")
    {
      int i = 0;
        while (i < ListBox_Toolbox.ItemCount)
        {
          if (ListBox_Toolbox.Items[i] == "Crowbar")
          {
            bD0_Tool1.NormalGraphic=439;
            diver0_tool1=2; // Crowbar
            ListBox_Toolbox.RemoveItem(i);
            ListBox_Toolbox.InsertItemAt(0, "Unequip");
          }
        i++;
        }
      return;
    }


As described in my question, if there are multiple Crowbar items in the list it obviously removes all crowbar items.

Any help would be greatly appreciated in this matter.

C
#7
AGS Games in Production / Blue Odyssey
Sat 08/08/2020 21:14:54





I'd like to announce Blue Odyssey. A story driven adventure game set around the tropical paradise of Angel Bay! Search the reefs for hidden salvage, artefacts and the wonderful creatures of the deep. Help the locals in their tasks and unravel the dark mystery of the island fathoms deep.

Angel Bay is filled with colourful NPCs, all with their own story, secrets, and tasks to complete. Visit the 'Drowning Sailor Bar' for jobs, gossip or to hire local divers to aid you in your search for treasure.

Explore sunken wrecks and long forgotten temples and raid them for their artefacts and loot!

















  • Donate artefacts to the Angel Bay museum and unlock the secrets of history.
  • Search up to 13 large dive locations all with their own distinctive look filled with wrecks, sunken caves and lost temples.
  • Upgrade your vessel at the shipyard: increase crew capacity, larger fuel tanks, even a diving bell!
  • Hire and fire local divers to help you scour the depths for treasure, all with their own stats, and special traits!
  • A deep main story line + loads and loads of side quests you can gain from the local islanders.
  • Buy tools and better diving gear to get deeper into the crushing depths.
  • In-Game Achievements


I hope to keep this up to date with features and screenshots as it develops.

Thank you.
#8
Hi all

I'm wanting NPC characters to walk around in the background, wait for a little while and then move to a new point. I was wandering if there is Wait(#) but a wait that doesn't block. Or would I require timers? I'm just asking because I can't find anything in the manual but could just be searching for the wrong thing...

Would would be the best practice??
#9
Hi

I'm a bit stuck with something that I know is probably easy. I want an object to become visible when the players gets within a set distance of it. Googling it, someone did ask a similar question and presented their code:

Code: ags
  if (player.x - oTest.X <30 && player.y - oTest.Y <30)
  {
    oTest.Visible=true;
  }
  else oTest.Visible=false;


The problem is it doesn't really work, if he player is obviously approaching from the left side of the object it will be visible. Is there something simple I'm missing, or is this more complicated?

Kind Regards
C
#10
I've noticed that non of the walkebhinds work on android (at least my build) I was wondering if anyone else has had any issues with this? They work perfectly fine when the exe is just run from the PC.

I may add, when I run the game files through the AGS android emulator it's fine. The walkbehind issue is only when it runs as a stand alone apk game.

C
#11
Hi I was wondering  - like the post title says - if you can change the color text mid sentence to highlight keywords.

For example:
if (Parser.Said("navigation"))lDetails.Text=("Command Example:[['navigate b1 to r2'[Moves bot1 to Room1");

The text is set to white, is it possible to change "navigate b1 to r2'[Moves bot1 to Room1" to say green?

Kind regards
C
#12
Hi

I've been looking around for a while now for a solution (not wanting to really post) but I've struggled to find any information on how to do this.

Is there a way to stack items in an inventory? I know in the general settings you can set it to allow duplicates, but a stacking option would be amazing. I did find this post: Forum Post on Stacking but it doesn's sound very robust - e.i if you take a stacked item do you take the whole stack or just one from it, ect).

I was wondering if there were any modules or plugins that I've missed that achieve this? Something like this would probably help me in a number of projects, and I can't be alone :)

Currently I have an Inventory GUI and a Font for the stack number display - the GUI inventory doesn't need to scroll as shifiting stack numbers up and down with the items would be complicated - I imagine.

Any help would be really fantastic on such a matter

Kind Regards.
C
#13
Hi

I've googled for an answer but haven't had much luck. I'm working on a little project and the bottom of the screen is taken up by a GUI bar that is always visible (that is about 50px tall). Is there a way to manually set the dead-zone of the room scroll in code? So, basically, the player character doesn't have to walk behind the GUI to scroll the screen down in Y?

I've searched the manual too for a simple bit of code (with SetViewPort, etc). Any help would be great because it would be cool to have larger rooms in the Y.

Kind Regards
C.
#14
Hi

I have a button on my main menu that I want to load a new AGS game (essentially a duplicate of the base game but will have new art).

I'm just using the simple:
RunAGSGame("AgonyMA.exe", 0, 0); in my script.

I always thoroughly google and look at the AGS bible but I cant figure this out. When I click on the button the game room fades out and seems to load the original game.exe. There seems to be some subtle differences but it seems to be the same as the base game with no change. There is no crash and both exe's are in the compiled folder. It is very odd...

Any help would be appreciated.
#15
I'm just looking for a little help with initializing the plugin.

I am running AGS Editor 2.4.0.16 and downloaded both the AGSteam-disjoint.dll and steam_api dll files. I have both files situated in my editor directory and both files in my debug and compiled directories.

My problem is when I load up the editor and right-click on the Plugin icon there is no import option.

I'm just wondering if someone could shine a little light on what I'm doing wrong. The dll files I'm assuming are the latest from the:
Steam Thread

Any help would be appreciated.

Thank you!
#16

It is said, an evil entity lurks within the confines of Castle Yadrin, it casts an evil shadow on all that surrounds it. For the setting sun only brings fear and death.
- A Castlevania story
- In a Resident Evil envionment
- With final Fantasy style combat


You have been chosen by your village to slay the demonic beast that resides within the castle. Travelling with a local priest and your faithful companion you are whisked away to the cursed hunting grounds of Yadrin. Filled with unspeakable monsters and creatures of the night hell bent on serving the master you must solve puzzles, avoid traps and fight your way to the vampire's hidden tomb.



Features:
- Sprawling castle and grounds, in beautiful NES colors and sound.
- A complex crafting system for making potions and combat items.
- Turn-based, action-point combat system.
- Switch to your animal companion to reach secret locations.
- Luck system used for picking some locks.
- Secret artifacts to help you survive this harsh environment.

Estimated Release: January 2018

(Section of animated intro sequence)

(Loot chests and other objects!)

(Find cursed artifacts and exchange them with the priest for better tools!)

(Picking locks spends LUCK)

(Many weapons have different attack options...or you could just throw a holy-water bomb)

The game is making excellent progress with all the systems coded up and good chunk of game finished. I plan on producing a little gameplay video soon that hopefully wont give too much away.
SMF spam blocked by CleanTalk