Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] quick, stupid question

Status
Not open for further replies.

Aran

Member

what would i loop through to gain the id of all the items in the Database?

i'm a little rusty...

EDIT: one more question. when do we use modules? and if they're not initialized does that mean they're running the entire time?
 

Mac

Member

I'm actually trying to figure this out now, i never thought about it before but these are the lines that choose what you get, so i need a way to apply to all in the selected database

Code:
$game_party.gain_item(@item.id, 1)
$game_party.gain_weapon(@item.id, 1)
$game_party.gain_armor(@item.id, 1)

Bear with me lol
 

Aran

Member

you had a post glitch, b/c u posted the same thing twice.

but i know those lines already. they're the lines in Game_Party. but, i need to find out what @item = ?
 

Mac

Member

Oh yeah i know, thats what i'm trying to suss out now, i would expect it to be @item + n but nothing...hmm i hate when the simplest things cause trouble.
 

Mac

Member

What he want's to know is instead of trying to just ask for one specific item, weapon and armour e.g.

Code:
$game_party.gain_item(7, 1)
$game_party.gain_weapon(11, 1)
$game_party.gain_armor(4, 1)

He wants to gain all of the items, armours and weapons all at once.
 

Aran

Member

No, like this:

BEFORE:
Code:
for i in $data_items.size
    $game_party.gain_item(i, 1)
end

AFTER:
Code:
for i in [color=red]0...[/color]$data_items.size
    $game_party.gain_item(i, 1)
end
 

Anonymous

Guest

Aran, I am truly shocked you can get any help at all when you insult people that way. "Not much of a scripter" my left foot.

This topic has been resolved. If Aran or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top