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

#1
Quick question here:

I'm trying to make this:

Code: ags

function iMemCrct1_OtherClick()
{
if (mouse.Mode == eModeMemorycur)
{
  Display("Memory circuit is plugged");
  cInv.LoseInventory(iMemCrct1);
  cMem.AddInventory(iMemCrct1);
  mouse.Mode = eModeInteract;
	mouse.UseModeGraphic(eModeInteract);
}
}


..into this:

Code: ags

function InventoryItem_OtherClick()
{
  if (mouse.Mode == eModeMemorycur)
  {
    if (InventoryItem == iMemCrct1)
  {
  Display("Memory circuit is plugged");
  cInv.LoseInventory(iMemCrct1);
  cMem.AddInventory(iMemCrct1);
  mouse.Mode = eModeInteract;
	mouse.UseModeGraphic(eModeInteract);
  }
}
}


First code is working but instead of making function for every item I'm trying to make one long function of which items can be moved into memory inventory. cMem is the character whose inventory is the memory inventory and cInv is the character who has the basic inventory. 5th line of second code is the one I'm having problems with.
#2
Quote from: Cassiebsg on Mon 06/07/2015 19:15:47
Yes, you can do all that you are asking for. ;)

EDIT:
I've done something similar to what you wish for one of my games (in production), where the character has his "normal" inventory that are basically 2 pockets and 2 hands, and then he can extend his inventory using a backpack. I've divided my items in 3 categories: small, medium and big. And any object that is big can only be carried on his hands, never on the backpack... and his pockets can only carry small objects.

Pretty neat. How does that work? I mean do you have multiple pick up options or do the items go to hands by default?

Quote from: Cassiebsg on Mon 06/07/2015 19:15:47
The "main" inventory is using a blue background and the "secondary" a red one. And then I just added the possibility of "moving" stuff from the main inventory to the backpack and vise-versa (I think).

So yeah, you can pretty much do anything you can set your mind to. :-D

I'm having Iconbar (similiar to one in default game) with icons for both inventories, inventory and memory. When the iconbar appears cursor goes to default pointer mode. I was planning that you could move stuff to appropriate inventory, but I don't know if it's possible because cursor goes to pointer mode. Do you have somekind of button in inventory for "moving" the items or how did you manage to do it?

Thanks for the response, both of you.. I'm starting to have a clue on this :smiley:
#3
Thing is that memory circuits are big part of my games theme. The main character stumbles upon them during his jorney. Later on his options and lines depend on what memory circuits are active. I need one extra GUI-window for memory circuits.

So, I have GUI scripting problem that is beoynd my limits for now. I think I need multiple inventories for my main character to make it work. I've dug couple of threads that discussed about the topic and having (invisible) secondary character is the way multiple inventories have been made. Before I venture into world of GUI scripting I'd like to ask couple of things:

Is it possible to make the two inventories graphically different?
Can items be traded between inventories and is there a way to limit which items can be added to secondary inventory?

If these conditions fill up I should try an invisible second character.
#4
Thank you again for help.

dialog.SetOptionState is the way I got my code working.
Haven't tried with "option-on" without indentation.
#5
I hope there is some simple way to make dialog options appear when certain global variables are true. I watched densmings video tutorials about dialogs, but they didn't cover this topic. I also tried to search forums but didn't find answer to my problems.

Last thing that I have tried is this

Code: ags

// Dialog script file
@S// Dialog startup entry point
  if (EMPquestion == true)
  {
  option-on 5
  }
  if (Siloquestion == true)
  {
  option-on 7
  }
  if (Billseen == true)
  {
  option-on 4
  }
return 


Option seems to be undefinied token in normal ags code. There must be some easy way to do this, but I can't find.
Thank's for help in advance
#6
Thank you to both of you. :)

I'm going to succeed with these instructions

#7
Quote from: slasher on Thu 25/06/2015 15:35:41
yes, you could do it by cutscene in another room but it could depend on what is supposed to happen in that dark room...and does he go back?

When he not in proximity EMP guardian and some time have passed he should return to the original screen. Still the problem remains: how can I make character to change room and keep his coordinates?
#8
I've been expecting some problems when I reach this point. Shortly put:

I have a room with EMP guardian in the middle of the room (It's animated with multiple backround images). Soon as the player character reaches middle of the room he is hit by EMP and looses his sight (cyber eyes). At this point I wanted to make screen black while character is visible.

I haven't find a way to blacken the screen 'cause I'm using animated backround.

So is there a way either to reserve one of the 5 backround images for darkening the room without hurting the room animation

OR

to use cutscene room and make the character appear to same coordinates where he was hit by AMP?
#9
Thanks a lot.
The problem was in one of the functions before this. (I thought I had checked those good as well).
72th was line 13. in my excerpt.

Also thank you Snarky for your examble.
#10
I've managed to get UseInv() working elsewhere. But now I made a little bit longer code which returns following error message:
"room6.asc(72): Error (line 72): buffer exceeded: you probably have a missing closing bracket on a previous line"

Now I've checked this code for atleast ten times and even slept on it but couldn't find what's wrong.
Code: ags

function oCyborgeadUp_UseInv(){
  if (cDoe.ActiveInventory == iHoe){
          if (SkullDown > 0){
          cDoe.Say("I need something bit longer");}
          else if (SkullDown == 0){
            cDoe.Walk(266, 550, eBlock, eWalkableAreas);
            Wait(20);
            cDoe.Say("This is too short to grab on anything");
            SkullDown = 1;}}
  else if (cDoe.ActiveInventory == iHockeystick){
          if (SkullDown == 2) {
          cDoe.Say("How can I find something little bit longer?");}
          else if (SkullDown != 2){
            cDoe.Walk(266, 550, eBlock, eWalkableAreas);
            Wait(20);
            cDoe.Say("Just an inch or so and I could grab that chain");
            SkullDown = 2;}}
  else if (cDoe.ActiveInventory == iGrablinghook){
          cDoe.Walk(266, 550, eBlock, eWalkableAreas);
          Wait(20);
          cDoe.Say("Ok let's grab that chain");
          Wait(20);
          cDoe.Say("It's working and something is coming down with that chain");
          oChainUp.Visible = false;
          oCyborgeadUp.Visible = false;
          oChainDown.Visible = true;
          oCyborgeadDwn.Visible = true;
  SkullDown = 3;}
else {}}


Thanks before hand for help
SMF spam blocked by CleanTalk