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.

change actor by pressing a key

Okay,
is there a script anywhere ( i cant find one )

to change actors quickly (with an animation aswell)
just at the push of a button in game
not on the menu and maybe in battle

(eg. pressing 'x' would cause the 'darkness1' animation over player and he would switch actor.)
and the actor is not in the party ( NOT seen when on Esc menu)

I thinks its really simple script, but as i am a noob, i need a little help.
:S

Thank you in advance :)

Recap:
One person in the party, but two actors in the data base, and being able to press a key to switch between them
(in-game) and maybe in battle.

and not from the menu.

Maybe you can do this with common events,
just that i really dont understand script to easily, and i dont want to learn just yet. (exams :( )
(thank you very much in advance )
 
I'm not a scripter, but this probably can be done with a common event.  Create a common event with a conditional branch that specifies that the "A" button is being pressed (I think A = X).  If the button is pressed, display the darkness animation.  At the same time, remove the current character from the party, and add the other one.  Add a Wait command (one frame) right after the swap.  Make sure the common event is on parallel process btw.  You may need to make two common events (one for each character), or you can use more conditional branches.  I'd explain this better, but I have to go to class now.  Good luck!
 
Thank you :)

But.. :down:
can you explain in more detail, becuase my character to change from Dead from to Human,
But not viceversa,
i've been tring to change it around,
it might have somthing to do with the switchs
but i cant use them in the write way :/

I've confused myself now..
when you've finished class, can you explain please?
Thank you in advance.
 
No, i want the 'human' form not being able to fight and not being able to weild weapons
But fighting isnt a big thnig in my project, it more story, (based on my graphic novel)
but no not the same stats,
 
Ok, so this should serve your purposes as long as you want the player to be able to change between actors at the beginning of the game.  Just remember: Common Event-->Parallel Process.  Make sure that the switch that you use to activate this common event is a different one than you use in the event.  Also, if you do not want the actor to be able to be changed at the beginning of the game, just turn the Common Event's switch off at the beginning.  That's about it.

Here is how you should set it up:

@Conditonal Branch: "A" button pressed
    @Conditional Branch: [insert switch] = on   #this switch should be activated at the beginning of the game
    @remove actor from party [insert whatever actor you want to remove]
    @Show animation [darkness01]
    @add actor to party [insert the actor you want to add]
    @Wait[1 frame(s)]
    @[insert the switch I mentioned earlier] = off
    else
    @Conditional Branch: [insert said switch] = off
    @remove actor from party [insert the actor you would like removed] #the one that was added above 
    @Show animation [darkness01]
    @add actor to party [insert the actor you want to add] #the character that was removed last time 
    @Wait[1 frame(s)]
    @[insert the switch I mentioned earlier] = on
    else
    @
      Branch End

If you have any questions, feel free to ask!
 
Okay, I've done that.
Great! it works! but...

When i press the button, it doesn't change actor 100% of the time
it like swaps and swaps back in one button press.

and i also dont understand how does it work? ( the switch )
I worked on the map that had an event turning my switch on,
but not on the next, how do i keep it on all the time

(expect for when the common event turns it off)

apart from that,  :wink: Thank you, again!
 
Ok, both of those problems are occuring for the same reason.  I had this type of problem in one of my three games.  Hold on, and I'll revise the event.

EDIT: Try this:
@Conditonal Branch: "A" button pressed
    @Conditional Branch: [insert switch] = on    #this switch should be activated at the beginning of the game
    @remove actor from party [insert whatever actor you want to remove]
    @Show animation [darkness01]
    @add actor to party [insert the actor you want to add]
    @Wait[5 frame(s)]
    @[insert the switch I mentioned earlier] = off
    else
    @Conditional Branch: "A" Button pressed
    @Conditional Branch: [insert said switch] = off
    @remove actor from party [insert the actor you would like removed] #the one that was added above 
    @Show animation [darkness01]
    @add actor to party [insert the actor you want to add] #the character that was removed last time 
    @Wait[5 frame(s)]
    @[insert the switch I mentioned earlier] = on
    else
    @
    else
    @
      Branch End

Once you change actors, there will be a .25 second wait before you can change again.  If this doesn't work, I'll go back to my house (still at school right now) and try it out on RPG Maker.  I think this will work though (Don't hold the "X" button fro too long or it will keep switching).
 
I cant explain it,
but with 5f it smoother, lol

In my game You start 'Dead' and you turn human (thats fine)
But when you tap Human to 'Dead', it stays human, you have to hold it down
so it change human - stay human - to 'Dead'

can you help that?
and, i might get your reply in the morning as its about 10 here and i'm getting tired :)
 
It's about 4:30 PM here, and I'm heading home now...I'll check it out for you.

EDIT: I just encountered a small problem, but I know how to fix it.  I'll tell you exactly how to make the event later.
 
Ok, I got it working, but I had to change a decent bit of it.  What you have to do is replace my characters with your own.  Also, when you add characters to the party, DO NOT check the box that says "Initialize."  It will revert your actor to level one.  Make sure that you activate the switch that activates the common event as well (I trust you know that already).  Other than that, you can see for yourself.  Hopefully it works this time.

Here's the event:

http://i94.photobucket.com/albums/l119/Dark_Paladin_2006/switchactor.jpg[/img]

If that did not work, let me know.
 
Thats perfect!

One more question
if i put a wait 50 frames
at the end of the change

will it stop you from being able to hold the button down and lagg,
and only be able to change every like 1 every 5/10 seconds?

Thank you in advance
(in my game, do i have permission to give credit to AbyssalLord?)
 
Hahahaha Nice,
just one more glitcht though.

if you press it just about/going through a 'transfer player' event, you 'come out the other end' with no graphic.


:S


But apart from that, awesome! Ty!
 

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