combining inventory items (NOTE: outdated thread)

Started by wOoDz, Thu 08/05/2003 09:52:10

Previous topic - Next topic

wOoDz

i'm at the "that doesn't look right, start again" stage of my game, i'm on version 5 now!  in another post someone sed 3D lacks character, i can see what they mean now. i'm using "BluGui" (i still might go for a modified version of Lucas's GUI, oh Decisions,Decisions! )
how do i combine two invenory items? ie..a gun + some bullets = loaded gun

also, why do i get  red pixels on my intro, i'm using run flic0 on my intro, 640-400 rez, hi color, but it does it on 320-200,256 too, the animation is mainly red on black, if i use another color first ie yellow fading out first that stops it, but makes the file bigger :(
thx woodz

scotch

To combine inventory you make the two inventory items you want to combine, and another inventory item of them combined, then when the player combines them you just take the two original items away and give the player the combined one.

Don't know about the flc problem though.

Barcik

I think Scotch missed the real question here...  ;D

You have to go to the "use inventory item on" interaction of the item you want to combine, and there do the regular
if (character[GetPlayerCharacter()].activeinv==X) {
LoseInventory(A);
LoseInventory(B);
AddInventory(C); }
And do the same for the second item, just change the X.
Currently Working On: Monkey Island 1.5

wOoDz

#3
TY Barcik & scotch ;D i tryed for ages last night but couldn't get my head round it, aint this forum great?! ;)


thanks again woodz

and it worked thanks ;D

Ophidic

I've been trying to do this and I am getting "Error: undefined symbol 'GetPlayerCharacter'"

I don't understand what that means, and I'm not finding anything helpful regarding the issue.

Snarky

Well, that's because this thread is twenty years old, and AGS scripting has changed a lot since then.

Today, you would do:

Code: ags
  if(player.ActiveInventory == X)
  {
    player.LoseInventory(A);
    player.LoseInventory(B);
    player.AddInventory(C);
  }

Ophidic

#6
Thank you very much, that worked perfectly!

Yeah, this thread was about as good as I could find in terms of answers tbh, and I was kinda nervous posting on an old post... sometimes mods hate that.

Thanks again for the quick response and hopefully my question helps someone else with the same thing sometime, I get a lot of questions resolved that way. :)

Snarky

Glad you got it to work!

Quote from: Ophidic on Sat 11/03/2023 07:38:06Yeah, this thread was about as good as I could find in terms of answers tbh, and I was kinda nervous posting on an old post... sometimes mods hate that.

It's fine when the question is still relevant to the thread topic, but code from that long ago is often incompatible with today's AGS. I recommend you browse through the Script API section of the manual to get a sense of what commands are available.

Also, we've had an influx of spambots that sometimes dig up old threads, so I was half suspicious that your post was one of them. (Often they'll then steal the text of some other old post to make it seem relevant; the fact that doing a search on your question didn't bring up any previous hits convinced me it was real.)

Gilbert

Since the info. in this thread is outdated (unless you're using a very old version of AGS for some reasons), I think it is fair to lock it, so that spammers couldn't bump it to include spam links, and legit users who found it in a search would realise it's outdated.

Snarky

Quote from: Gilbert on Sat 11/03/2023 11:36:51Since the info. in this thread is outdated (unless you're using a very old version of AGS for some reasons), I think it is fair to lock it, so that spammers couldn't bump it to include spam links, and legit users who found it in a search would realise it's outdated.

Though now it has the up-to-date answer as well...

Gilbert

Quote from: Snarky on Sat 11/03/2023 15:01:26Though now it has the up-to-date answer as well...
I know, but I'd rather people start a new topic next time instead of having through the whole thing.
I've thought of splitting the thread, but too lazy didn't want to edit the thing to make it make sense as a new thread.

SMF spam blocked by CleanTalk