Inventory
im working on a point and click style game. My goal is to pick up items and have them put into and inventory. Because the game involves multiple rooms, i have the rooms set in different frames. Any way in which if i pick up and item in 1 frame, when i go to a different frame, the item will stay in the inventory going into that frame?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 05-20-2007, 04:55 AM
View Complete Forum Thread with Replies
Sponsored Links:
Inventory
Im pretty much known at the SFDT forms and Image Gear Studios Forums.
Well, i want to know how to make an inventory in a Flash 5 game.
Lets say when i click on "item" it should show up in my inventory.
How do i do that?
any help would be accepted.
View Replies !
View Related
Inventory For RPG
I am currently working on an RPG and I need a inventory system that works. I need to be able to get the item from a shop and be able to use them later in the game. If anyone can help with this please email me at shiny_89@hotmail.com or post through this.
Thank you for your help
~Trent~
View Replies !
View Related
Inventory
i've done a search on this subject and its been posted a million times but i think i'm even more confused!!
basically i'm new to flash and i'm making a simple game, i've created about 6 different scenes (not sure if that the best way to go about it) and in each scene are items (mc's) i need to collect (keys for doors, etc).
i need some kind of inventory that keeps the stuff in throughout the game and obviously the items disappear from scene when collected and dissappear from inventory when used.
any help would be greatly appreciated.
View Replies !
View Related
Inventory
I have seen someone make one of these inventorys before-exept theirs worked. Whats wrong with mine:
[code}
if (loop != 1) {
loop = 0;//assign the
}
///////////////inventory///////////
if (loop == 0) {
items = new Array();
items[0] = 0;// items in inventory
items[1] = 0;//blank slots
items[2] = 0;
openslot = 0;
loop++;//no more this again
}
///////////////////////////////////
_global.additem = function(itemFrame) {
items[openslot]=itemFrame;//assign the array's openslot the item's number
_root.inventory.slot0._currentframe=items[0];//check the
_root.inventory.slot1._currentframe=items[1];//slots to see if there
_root.inventory.slot2._currentframe=items[2];//is a change in the items
};
[code]
View Replies !
View Related
Inventory...
Anybody know how to make something like an inventory?
i use some mc symbols which i drag n' drop on the stage but if i want to have more than 1 of the same symbol i have to make lots of them (copy-paste) as a stock. Is there anyway that a movie clip can be reproduced "infinitely"? THanks
View Replies !
View Related
Inventory
Right I'll keep this brief because I've been searching on forums for an answer to
this for hours now, and had several shots of doing this myself, but for the life of me I can't figure out how to build a CLICK activated INVENTORY not a HITTEST one.
(by click I'm mean as in an inventory you might find in a point "n" click game)
Heres my most recent attempt...
Any help on how to build an inventory would be much appreciated
View Replies !
View Related
RPG Inventory-Help
I've been making an RPG with Flash Pro 8. It's one of the ones that you walk around, work etc. The insides of the buildings are on different frames to the main one. Inside a school, you can pick up some books for a mission. I made the inventory, and when I click the books they go to the inventory, but when I go back outside to the other frame, the books aren't in the inventory anymore. Can someone please help me?
View Replies !
View Related
Inventory
Hello! I have a question!
How would i make an inventory? Like for example.
I press i, then a inventory window takes place of the screen.
I can press up and down to chose what item, and from their i can equip it and such.
I know its not much to work with, but could i get some help?
I use flash mx professional 2004
View Replies !
View Related
Inventory On My Game Needs Some Help
Hey everyone - for anyone thats following along Ive made some progress on my inventory for my game but Im only half way there - when you click on the bubblegum it wont go to the box because its inside of an mc and the _x and _y gets messed up - how do I fix this? also the inventory box moves around on screen so how can I get my bubblegum to get dragged with the box?? I would also like to thank xdrunkcowx for all the help and not getting pissed off when I asked lots of questions - I would be no where without him! so someone please help me solve this mysterious puzzle and get it to work- ive attached the file so you know what Im talking about
View Replies !
View Related
Inventory Code
Hi, I've followed the tutorial here for an inventory:
http://www.flashkit.com/tutorials/Ga...-805/index.php
And it works fine.
Except, when you move to another frame, the item gets dropped again.
Any ideas how to fix it?
View Replies !
View Related
Array Inventory
I am currently working on an rpg, and I need to know how to display objects on an array. I have knowledge of how to use an array (push, pop, shift, etc.) and it is the easiest to use when you want to save a file. And when I remove an item from the inventory how can I make it so it updates objects.
inventory: knife, apple, potion.
I remove apple
inventory: knife, potion.
Apple is removed from slot 2 and potion is moved to slot 2.
How can I do this?
View Replies !
View Related
[CS3] Inventory System Help
Hello,
I've wanted to try making an inventory for a game I'm planning. Kinda got stuck a little. I'm trying to make the items get attached to some containers, following which items you clicked first. Here's a flash movie to better illustrate what I'm trying to achive :^)
I've already gotten until making the inventory window to pop up when you click on the items in the stage. Then attaching the movieclips to the item slots was too confusing for me. Most of the scripts are undoubtedly wrong...
There's also the .fla file! Please help :^O
View Replies !
View Related
Game Inventory
With the help of a more actionscript literate friend I have created a simple inventory window. That is, a movieclip with an invisible button overlaid, which when clicked leads to the inventory window opening. I'm now stuck on a way to move an item somewhere else in my game to the inventory window, once clicked on. One way I tried was to create a movieclip in my inventory window. The first frame is invisible, the second is an icon of the inventory item, and the third an enlarged version of the item. When the actual item is clicked on in another location( it is a movieclip designed to disappear once clicked, with an invisible button overlaid), i added actionscript that, on release, it should go into _root, then my inventory movieclip (called invent) then the item movieclip (called paper1)
the coding for the button is thus:
on (release) { gotoAndStop (2);
this._parent.invent.paper1.gotoAndStop(2);
}
I've gone through this many times and the item just does not appear in the inventory window, any hel pwould be much appreciated!!
View Replies !
View Related
Inventory System
Ok Im making a RPG game: (Here it is in development) (arrow keys to move)
http://www.imgupload.co.uk/uploads/b...d95764a4ef.swf
In the frame I have:
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval ("itemSlot" + currentslotnum)._x;
item._y = eval ("itemSlot" + currentslotnum)._y;
item.found = true;
currentslotnum++;
}
Among other stuff - and on items which can be picked up I have:
onClipEvent (enterFrame) {
if (_root.character.hitTest (this)) {
_root.addToslot (this);
}
}
- Yay that works fine. But now when I try to Have it so you click a "Inventory" button the inventory pops up - I get this:
http://www.imgupload.co.uk/uploads/e...5d05bdde1e.swf
Code on the Items:
onClipEvent (enterFrame) {
if (_root.character.hitTest (this)) {
_root.inventory.addToslot (this);
}
}
Code on the two frames of the inventory MC:
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval ("itemSlot" + currentslotnum)._x;
item._y = eval ("itemSlot" + currentslotnum)._y;
item.found = true;
currentslotnum++;
}
}
I now longer have that script on the main page. And the two Items are inside the inventory MC
What should happen?
Upon touching the two items - they should both go into inventory whenever its popped up or closed. (and you can turn the inventory off and on without it messing up)
What Happens:
Touching the two items with the invent closed does nothing - if you turn it on then and touch them - nothing happens.
But if you touch the items for the first time with the inventory open - they go into the invent - but they dont close when the inventory closes.
I think part of it is to do with the mc inventory having two frames - with the script on both frames - presumably I could use attachMC which Im new at.
Making the items disspear with the inventory when closed could be solve (i think_ with just _root.item = false; or something.
Help please?
View Replies !
View Related
Inventory In Rpg In Flash
Hello all,
I'm a newby in flash, and I wish to create an adventuregame (Rpg, first person view) similar to many others, just for testing my drawing abilities.
The general coding of the game is clear enough to me, but I need an inventory in which to keep useful objects during the game.
To store items inside the inventory, I used the simple tutorial suggested here in kirupa. I attached this code over the item-mc:
on (release) {
_root.addToSlot (this)
this code call the addToSlot function
function addToSlot (item) {
if (!item.found) {
item._x = eval ("itemSlot) + currentslotnum)._x;
item._y = eval ("itemSlot) + currentslotnum)._y;
item.found = true;
...and then one is added to currentslotnum (with currentslotnum++), a variable set to one in the beginning
With this code the inventory is actually functioning, the item goes to the first free slot in the inventory. But obviously I need to use later this item in the game (i.e. a key inside a hole). How can I do this? I tried with a Mc containing a button: with StartDrag and StopDrag method coded with hitTest or _droptarget nothing happens, that is the Mc don't come out of the inventory - the drag command seems to be ignored.
anyone knows how to do?
I need something similar to skutnik's Daymare town
http://www.daymaretown.com/dmt1.html
o something similar...
http://www.minijuegos.com/juegos/jugar.php?id=6821
tankhing you all in advance
View Replies !
View Related
Game: Inventory
I was just wondering If someone could explain to me ho to make an inventory for the RPG I'm making. Also if you could uplaod some examples that would be really good also.
View Replies !
View Related
Massive Inventory
I am doing a site for a hockey company and they want (i think they are crazy) me to make an index for about 1500 hockey sticks. They want teams, players, coaches ect ect to be able to check out there stick via internet. Please justify me in reality they will look once and never go back. Anyways were do I start. Maybe one of you guys have a different solution.
i was thinking of having it broken into east midwest west and canada.
please help!!
View Replies !
View Related
Inventory : Load Swf Instead Of Attach MC's
Hey guys,
For this problem I've included a download of the fla file so you can check out the code.
<a href="http://www.geocities.com/emtaolovesanhtao/my_controlbox.fla">http://www.geocities.com/emtaolovesanhtao/my_controlbox.fla</a>
I've managed to create an inventory, by collecting the object from 4 different scenes which are 4 separate MC's. What I want to do instead, is collect it from 4 separate swf files. For instance:
These are the 4 movie clips in the game:
MC1 = scBeach
MC2 = scSand
MC3 = scStreet
MC4 = scWater
The user has a map which uses the attachmovie function and removeMovieclip to load up the selected scene. I've created 4 swf files:
scBeach = beach.swf
scSand = sand.swf
scStreet = street.swf
scWater = water.swf
Instead of loading the MC, I want the swf to load as the scene, but I still want the inventory to work. Can I also create a separate control panel (the inventory bar which is the "frame" symbol in the fla) as a swf file too still??
Sorry if its a lil confusing . . . I'll try explain a lil more if its needed. If you can help I'd appreciate you droppin a message! thanks (:
View Replies !
View Related
Inventory: Load Swfs Instead Of Mc
Hey guys,
For this problem I've included a download of the fla file so you can check out the code.
<a href="http://www.geocities.com/emtaolovesanhtao/my_controlbox.fla">http://www.geocities.com/emtaolovesanhtao/my_controlbox.fla</a>
I've managed to create an inventory, by collecting the object from 4 different scenes which are 4 separate MC's. What I want to do instead, is collect it from 4 separate swf files. For instance:
These are the 4 movie clips in the game:
MC1 = scBeach
MC2 = scSand
MC3 = scStreet
MC4 = scWater
The user has a map which uses the attachmovie function and removeMovieclip to load up the selected scene. I've created 4 swf files:
scBeach = beach.swf
scSand = sand.swf
scStreet = street.swf
scWater = water.swf
Instead of loading the MC, I want the swf to load as the scene, but I still want the inventory to work. Can I also create a separate control panel (the inventory bar which is the "frame" symbol in the fla) as a swf file too still??
Sorry if its a lil confusing . . . I'll try explain a lil more if its needed. If you can help I'd appreciate you droppin a message! thanks (:
View Replies !
View Related
Attachmovieclip Inventory System?
I am attempting to generate an inventory system. When you roll over an item and press "o" for obtain, it disappears from the stage and goes into your inventory (press "i" to view"), to show the item in the inventory, I cant use the simple _x and _y, I have to create "spots" to hold the items. NEbody know how this can be done?
Here is my attempt:
View Replies !
View Related
Making An Inventory List
How could I make an inventory list. Such as clicking a button and have it add itself to the inventory, then click a "clear" button to remove it.
I am pretty good with actionscript, but have never tried this before.
Thanks,
Blaine
View Replies !
View Related
Computer Inventory In Floorplan
I currently keep a floor inventory of the computers in my department in Illustrator. I was thinking of importing the floorplan into Flash and create movie clips for each "computer" record from my inventory database and place them on the floorplan background.
So my question is..... is this a Flash CS3 project or more of a Flex application?
I'm not sure which development environment to use.
Has anyone ever done a Flash Inventory system before?
View Replies !
View Related
[CS3] Game Inventory Problems
Hello,
I've wanted to try making an inventory for a game I'm planning. Kinda got stuck a little. I'm trying to make the items get attached to some containers, following which items you clicked first. Here's a flash movie to better illustrate what I'm trying to achive :^)
test movie
I've already gotten until making the inventory window to pop up when you click on the items in the stage. Then attaching the movieclips to the item slots was too confusing for me. Most of the scripts are undoubtedly wrong...
Here's the .fla file! Please help
View Replies !
View Related
Inventory Point And Click
Hi
I'm in the midst of writing a point and click game and i'm trying to get my head round how I will make my inventory. I understand that I need to store the objects into an array but I'm struggling a bit. Does anyone know how I would do this using Actionscript 3.0. BTW I'm not using frames in my game I'm doing it in seperate classes (loads of different .as files)
Cheers
Prooster
View Replies !
View Related
Why Won't Inventory Work Inside A Mc?
Hi, I made an inventory and it works, the problem is that I need it to be inside a movieclip (menu) but it won't work. Here's how I made it:
I made movieclips that are squares with no fill and gave the instance "itemSlot" + number (I made 16). Then I added this code to the main actions frame:
ActionScript Code:
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval ("itemSlot" + currentslotnum)._x;
item._y = eval ("itemSlot" + currentslotnum)._y;
item.found = true;
currentslotnum++;
}
}
And items are movieclips smaller than the slots with instance "item" + number with this code:
ActionScript Code:
onClipEvent (enterFrame) {
if (_root.player.hitTest (this)) {
_root.addToslot (this);
}
}
("player" is the user)
It works, I've tested it, but only when it is out of the movieclip. Can anyone tell me how to make this work inside the movieclip?
Thanks in advance
View Replies !
View Related
Items, Inventory, Suggestions
I have implemented an item and inventory system for my little game, but I feel this is problaby not the best aproach I've taken.. How would you go about making that?
First I have a main class called Items. With properties like Name, Cost and dDescription.
And some subclasses of Item, like Weapon with properties like damage, range, etc.
Armor with defence-property, etc, etc.
So far it feels at least like i've taken a good aproach.
now in my main-script, i create a weapon-array, and populate it with all the weapons in the game. im not sure what the best way of populating it would be? maybe i should put all of that code in a AS-file and include it in the main-script instead?
ActionScript Code:
var weapons:Array=[];
weapons.push(new weapon);
with (weapons[weapons.length-1]) {
Name="Dagger";
Cost=150;
info="This is a tiny little dagger with low strength.";
dmg=5;
range=2;
}
weapons.push(new weapon);
with (weapons[weapons.length-1]) {
Name="Longsword";
Cost=400;
info="Nice longsword";
dmg=15;
range=8;
}
well, something like that.
now i create an inventory-array, and if i want to add a dagger to it for example, i'd do inventory.push(weapons[0]); that way i put a reference to the dagger in the inventory-array
maybe there's some better and more organized way of doing all that?
and for example if i have 2 daggers in the inventory, they are identical, because they're really just 2 references to an instance of the weapon-class.
but now i'd like to add another property to them, which they would not share. for example durabilty, which would decrease everytime its used and make it break when it reaches 0.
i did this by changing the inventory-array.
now it has subarrays in it instead, the first element of the subarray is a reference to an item, and if it's a weapon, the second element is a value for durability.
sorry if all of this doesn't really make sense. any comments are welcome, i'd like to know if you would do it differently.. if there's some other way that is definitely better in some way..
Thanks
edit:
Maybe i should have an inventory-object instead of an array? and if i put a dagger into the inventory i'd do inventory.push(weapons.dagger) instead?
that way, if i ever decide i'd want to remove one of the weapons from the game it wouldn't disturb all the other weapons by changing the element-number of them..
View Replies !
View Related
Personality Inventory With Flash
hello group, i am trying to make a simple poll that asks the user a series of questions. the responses will be given a numerical value and calculated with script found on a submit button. this code runs doesn't do anything but i can get it error free. please help
on each radio button goes this script:
on (click){
rButton=new Object();
rButton.click = function(eventObj){
var q1answer=eventObj.target.selection.data;
trace(q1answer);
}
rGroup1.addEventListener("click" , rbutton);
}
and a submit button to count it all has this script:
on(click) {
var count:Number = 0;
var myRadioListener.Object = new Object();
myRadioListener.click = function(evt){
_root.count = _root.count + evt.target.selection.data;
if _root.count = >7
then trace("good job");
trace(_root.count);
radioGroup.addEventListener("click",myRadioListene r);
}}
this runs without errors but doesn't do anything.
View Replies !
View Related
Flash Inventory System
Hello! New to the forums here :D
I've been programming for a while in AS 2, hate AS 3 too complicated... and im currently making an RPG Zelda style game. I've setup the boundaries, movement and such, but im stumped on how to make an inventory system that can transfer to different frames. Ex: if you pick up the burger in one frame, allow you to see it in another frame that you picked it up and can use it. Since every place is a different KeyFrame i have no clue how to transfer it over. Could you guys help me out?
P.
View Replies !
View Related
Ideas On Creating An Inventory?
Hi, I'm trying to create an inventory for a very basic flash site that I'm making, but I'm still learning how to use flash more creatively.
I have a couple of scenes that I have made in photoshop and I'm now trying to use flash to tie it all together. I'll attach some pictures.
In the first picture is a frame layer with a selection of coloured mushrooms. I want to be able to pick them up and store them in an inventory.
In the second picture, I want to be able to move the mushrooms from the inventory into a cauldron in a predetermined order - e.g. blue, red, green, orange, yellow etc. In order to create a potion.
I've been told that it's possible to make something like this using an array.
Any advice, tips, links, suggestions would be greatfully received...even just a gentle nudge in the right direction
Cheers!!
View Replies !
View Related
Storing Items In An Inventory
Hi and happy new year, I'm trying to create an inventory for a point and click style game. I want to click and drag an object into a inventory box to be stored until it's required (however the object is also bigger than the box and so I think it needs to be re-scaled).
I've sort of nearly got it working but it's still not right.
here's the code I'm currently using:
mc1.onPress = function(){
this.startDrag();
};
mc1.onRelease = function(){
if (this.hitTest(box1) == true){
this._xscale = 40;
this._yscale = 40;
this.stopDrag();
}else{
if (this.hitTest(box1) == false){
this._xscale = 100;
this._yscale = 100;
this.stopDrag();
I've also tried replacing the lines with _xscale/_yscale with:
this._x = box1._x;
this._y = box1._y;
Any help would be appreciated
View Replies !
View Related
ActionScript3 Inventory System
Hi all, I am trying to edit the traditional AS2 inventory system to AS3, this is how i have done it so far. The only problem is in AS3 it doesn't seem to allow the use of x/y with strings any more. Any solutions?
Thanks,
Gnoll
var currentslotnum:Number = 1
var itemfound:Boolean = false
mclip.addEventListener(Event.ENTER_FRAME, itemchecker);
function itemchecker(Event:Event):void;
{
if (mclip.char.hitTestObject(item1) == true) {
addToslot(item1);
}
}
function addToslot (item) {
if (!itemfound) {
item.x = ("itemSlot"+currentslotnum).x
item.y = ("itemSlot"+currentslotnum).y
itemfound = true;
currentslotnum += 1;
}
}
(Not sure if it should belong only in the Gaming section, but the problem is with AS3, not AS2 etc)
View Replies !
View Related
Playing Up Inventory System
I have designed a basic inventory system for a point and click game I'm working on. Its pretty straight forward atm, see below:
Code:
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.*;
public class InventoryAccess extends MovieClip {
private var _inventoryI = new Interface();
private var _itemsInDisplay:Array;
private var _fishPaste = new FishPasteInv();
public function InventoryAccess() {
_itemsInDisplay = new Array();
addChild(_inventoryI);
}
public function updater(MC:String) {
switch(MC) {
case "fish paste" :
_itemsInDisplay.push(_fishPaste);
updating(_itemsInDisplay);
break;
}
}
private function updating(arrayOfItems:Array) {
for (var i:int=0;i<arrayOfItems.length;i++) {
addChild(arrayOfItems[i]);
}
}
}
}
'updater' is a function that can be accessed from outside the AS file, i.e. when object is picked up file.updater... through tracing i have found out that all the functions are being executed but the object just isn't being added to the screen :S Any help would be greatly appreciated, thanks.
View Replies !
View Related
Why Won't Inventory Work Inside A Mc?
Hi, I made an inventory and it works, the problem is that I need it to be inside a movieclip (menu) but it won't work. Here's how I made it:
I made movieclips that are squares with no fill and gave the instance "itemSlot" + number (I made 16). Then I added this code to the main actions frame:
Code:
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval ("itemSlot" + currentslotnum)._x;
item._y = eval ("itemSlot" + currentslotnum)._y;
item.found = true;
currentslotnum++;
}
}
And items are movieclips smaller than the slots with instance "item" + number with this code:
Code:
onClipEvent (enterFrame) {
if (_root.player.hitTest (this)) {
_root.addToslot (this);
}
}
("player" is the user)
It works, I've tested it, but only when it is out of the movieclip. Can anyone tell me how to make this work inside the movieclip?
Thanks in advance
View Replies !
View Related
Inventory Variable Check Problem
Im creating an item inventory for a game. In the game you will be able to click on an item and it will be placed in the next available slot in the inventory.
When you click on an item it sets '_root.item' to whatever item the user had clicked on. It also tellstarget "inventory" (the movieclip which does all the clever work) to gotoandplay "add_item" so it can start checking where there is an avaiable space. This is part of the coding on the movieclip "inventory"
---------------------------------------
if (this["_root.inventory"+_root.n] == "empty") {
this["_root.inventory"+_root.n] = _root.item;
gotoAndStop("stop_item");
} else if (this["_root.inventory"+_root.n] != "empty") {
nextFrame();
}
---------------------------------------
The actionscript above is looped and the variable 'n' has 1 added in each loop. So it checks all 10 inventory variables which are;
inventory1
inventory2
inventory3
inventory4
..etc
All the way up to 10. Once 'n' is more than 10 (it checks wether it is more than 10 on adifferent frame) it stops the loop and goes to a frame called 'stop_item'.
Now it all seems to work fine apart from this bit of the code
if (this["_root.inventory"+_root.n] == "empty") {
All of the inventory1, inventory2, inventory3 etc are set to "empty" yet it still doesn't change the inventory variable to '_root.item'. Why is this?
Thanks alot for your time hope you understand my babble.
Cheers
Jim
View Replies !
View Related
How Do I Make Inventory In My Game Work
Hi,
Im making a game and I need some help with the inventory part of it what I have is a movie clip where I want to be able to store "items" of my inventory. Those items would be other movie clips. How this works is lets say on Scene 1 there is a fork that needs to be put in the inventory - when the fork is clicked I want it to appear in the inventory - also I need the items to stay in this way from scene to scene. Like after the fork is in my inventory when I go to Scene 2 I need it to stay in my inventory - how do I do this - please help me- Its driving me nuts!
Alex
View Replies !
View Related
How Do I Make Inventory In My Game Work
Hi,
Im making a game and I need some help with the inventory part of it what I have is a movie clip where I want to be able to store "items" of my inventory. Those items would be other movie clips. How this works is lets say on Scene 1 there is a fork that needs to be put in the inventory - when the fork is clicked I want it to appear in the inventory - also I need the items to stay in this way from scene to scene. Like after the fork is in my inventory when I go to Scene 2 I need it to stay in my inventory - how do I do this - please help me- Its driving me nuts!
Alex
View Replies !
View Related
Scrolling Inventory With Draggable Items
how would i make a scrolling inventory from which I can drag and drop objects that snap back to the same pos in the inventory even tho the inventory has moved on the y axis? You can see the inventory on the right-side of the attached jpeg.
I know how to get an object to snap back to its original position from a drag, but how would you get it to snap back to its original position onto another object that has moved? ie. Onto a scrolling menu?
View Replies !
View Related
My Inventory System Needs Some :rolleyes: 'touchups'
Suppose I have an inventory system. And I create a new movieclip. Could I set that movieclips acions with a "with" statement? Here is what we are looking at:
framecode::
Code:
var newname;
var libname;
var itemname;
var cursoritem = "";
var thisname;
function addtocursor (libname,newname){
_root.cursor.attachmovieclip(libname,newname,11)
cursoritem = newname;
}
function addtoinventory(libname,newname) {
_root.inventory.attachMovie(libname,newname, 10);
//_root.inventory.newname._xscale = root.inventory.newname._yscale = 100*30/Math.max(_root.inventory.newname._width,_root.inventory.newname._height);
thisname._visible = 0;
if(_root.inventory.slot.newname.hitTest(_xmouse,_ymouse,true)){
_root.inventory.newname._visible=0;
_root.inventory.newname.addtocursor(libname,newname);
}
}
and here is my movieclip code ( I designed it so that I could use the funtion on anything)
Code:
onClipEvent (keyDown) {
newname = itemc;
libname = itemletterc;
thisname = this;
if (this.hitTest(_root._xmouse, _root._ymouse, true) && Key.isDown(79)) {
this.addtoinventory(libname, newname,thisname);
trace("added to inventory");
}
}
If that isn't enough, I have attached the file.
Thankyou!
View Replies !
View Related
Problems With Creating Inventory For A Game
With the help of a more actionscript literate friend I have created a simple inventory window. That is, a movieclip with an invisible button overlaid, which when clicked leads to the inventory window opening. I'm now stuck on a way to move an item somewhere else in my game to the inventory window, once clicked on. One way I tried was to create a movieclip in my inventory window. The first frame is invisible, the second is an icon of the inventory item, and the third an enlarged version of the item. When the actual item is clicked on in another location( it is a movieclip designed to disappear once clicked, with an invisible button overlaid), i added actionscript that, on release, it should go into _root, then my inventory movieclip (called invent) then the item movieclip (called paper1)
the coding for the button is thus:
on (release) { gotoAndStop (2);
this._parent.invent.paper1.gotoAndStop(2);
}
have tried both relative and absolute targeting, neither works
I've gone through this many times and the item just does not appear in the inventory window, any hel pwould be much appreciated!!
View Replies !
View Related
Action Script 2.0 Inventory Question
I'm making one of those flash adventure games and need some help. I know enough actionscript to get by but I need some help. first I'm working on a in game inventory. And I've created a script thats working so far
on (press) {
_root.inventory.gotoAndStop(framenumber);
}
So basically I've got a movieclip thats a box with the instance name of inventory. I create several different frames inside of it and have an image of every object the players going to pick up. Than I create a button on the main screen with the action script above. And then "BAM" the image appears in the inventory box, But I need some simple help. How can I get the player to use the item in the inventory. My Idea was that when the player were to click on the object it would say on the screen "use ___ with" and then when the player scrolls over another object it would say "use ___ with ___" but I can't figure out how to do this. Please help!!
View Replies !
View Related
Point And Click Inventory System
OK i am half way through an elaborate point and click game i am making and i am using variables for my items and i was wondering if anyone know how i can make an inventory system around that?
Maybe like that when i click the the inventory button it checks for my variables like :
if(key eq 1){
//show the image of it
} else {
//dont show the image
View Replies !
View Related
Inventory Check ---> Checking For Certain Items
Okay I have the following Inventory code.
This adds it your inventory slots
ActionScript Code:
currentslotnum = 1;stop();function addToslot(item) { if (!item.found) { item._x = eval("itemSlot"+currentslotnum)._x; item._y = eval("itemSlot"+currentslotnum)._y; item.found = true; currentslotnum++; }}
so that's good...
And this allows you to pick it up
ActionScript Code:
onClipEvent (enterFrame) { if (_root.character.hitTest(this)) { _root.addToslot(this); }}
Great so that all works perfectly. But Say If want to check if a user has a certain item if so...such an such happens...etc. But I can't figure out how I would do this with an If statement. No matter what I can't get it to work( That is what you'd use right?). Can anyone tell me the best way to do a "check" for this type of thing. Thanks in advance .
View Replies !
View Related
|