i need help=with equiping items

Game Editor comments and discussion.

i need help=with equiping items

Postby Lexcondran » Tue Jan 26, 2010 9:51 am

in my game i have this thing where i want to click on the image
and then it turns red = its equipped and then adds its stats to the players stats
unfortunately my issue is it wont work or do anyhting thats on create actor
when i put the scirpt into draw actor it jsut keeps adding to the stats infinitely and wont stop.
... very confusing and another stump in my road to make my dang Rpg awesome
=My rpg is basically a huge compilation playground for new people to figure stuff out to make their own rpgs
http://www.mediafire.com/?e4zzycilztdm1qm =My RPG APP FILE V. 3.0 {7/15/2010}
http://www.mediafire.com/?tjjmmmkzyga =My editable demo of my Rpg for people V2.3
viewtopic.php?f=6&t=10247 =Link to my RPG's (4.0) Topic =]
User avatar
Lexcondran
 
Posts: 230
Joined: Thu Jul 31, 2008 6:09 pm
Location: Tucson, Arizona, USA
Score: 8 Give a positive score

Re: i need help=with equiping items

Postby Leif » Tue Jan 26, 2010 7:55 pm

Add new actor variable "Equipped" (integer, for example). It will be 1 if item is equipped and 0 - if not.

On item's CreateActor Event

Code: Select all
Equipped=0;


On item's MouseDown Event

Code: Select all
if (Equipped==0)
{
Equipped=1;
// add parameters
hero.attack=hero.attack+item.attack;
...
//make item red
ChangeAnimation("item", "red", FORWARD);
}

else

{
Equipped=0;
// subtract  parameters
hero.attack=hero.attack-item.attack;
...
//make item normal
ChangeAnimation("item", "normal", FORWARD);
}
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron