Main Menu
  • Welcome to The RPG Maker Resource Kit.

Actor (Name) may not = Actor #

Started by Dyew, January 08, 2008, 11:27:14 PM

0 Members and 1 Guest are viewing this topic.

Dyew

I am trying to get the code to recognize which actor is in which slot.  I am trying to create a game in which the hero summons her allies.  Her beneficial spells can affect them but not herself and visa versa.  RPG maker does not give me a field to input what type of summoned creature is in which Actor slot.  Is there any way to define this or move them to a preset arrangement with coding?

An example:

The primary character is in slot 1.  He/She Casts a healing spell that is single cast and can only be used to heal one of her minions, not herself.  The minions have corresponding elements.  I want the animation to correspond to their element.  I can do this through a show choices command but it seems clunky.  Is there any way I can get the code to regognize that a certain elemental is not in the party and if it is that it is in a specific slot? 
What are you looking at?

Falcon


Dyew

What are you looking at?

Falcon

Try this in an if statement:
$game_party.actors[POS WITH 0 AS 1ST POSITION] == $game_actors[ACTOR YOU WANT]

Dyew

Thank you Falcon.  I will try it out.
What are you looking at?

Dyew

I had no luck with it.  Is there any way to word it into a conditional statement.  Such as:

If the target is [Actor Name]

Else

End Branch
What are you looking at?

Dyew

#6
Any help?  Perhaps I am placing your code wrong Falcon.
What are you looking at?

Falcon

If you don't even know events then I'm wasting my time trying to help you.

Dyew

 know what an event is.  I am a damn good Qbasic programmer.  Unfortunately this is not Qbasic.  I ask that you have some patience with me and give me some guidance here.  Obviously you know your shit and I am in the dark.  I do know the majority of the basic commands(events) and what they do.

Before you say anything, I know Qbasic is stone age.
What are you looking at?

Brady

If he doesn't know events, you're wasting yur time?  Isn't this a help forum...to help people who need help because they don't know [whatever]

Falcon

I gave you the code, I'm not going to walk you through every damn step of the process, if someone else wants to, they're welcome to.

Kokowam

Quote from: Dyew on January 09, 2008, 03:29:31 AM
I had no luck with it.  Is there any way to word it into a conditional statement.  Such as:

If the target is [Actor Name]

Else

End Branch
LOLOL

Brady

Was there.....any point to that, Moo?  Might as well have just not said anythin'...laughin' at a question in a help thread seems to defeat the entire purpose  :-\

Dyew

Been reading all the events in Zorn's Rm2K tools.  Even if it is a Rm2K assist I thought I would be able to pull something.  I got nothing.  Searching this forum, others, an any other information I can dig up online.  Still looking but I have nothing and it is a day later.
What are you looking at?

Dyew

#14
Quote from: Falcon on January 08, 2008, 11:59:26 PM
Try this in an if statement:
$game_party.actors[POS WITH 0 AS 1ST POSITION] == $game_actors[ACTOR YOU WANT]

The problem here I think is that I do not understand the meaning of the code.

For instance:

Quote<Message:> Man: You have the scroll!
1. <Message:> \n[1]: Yes, it was hard to find but I have it now.
2. <Message:> Man: Well, here is your reward.
3. <Message:> Found 150 gold!
4. <Change money:> 150, increase
5. <message:> You now have \$ gold altogether!
6. <change items:> Scroll, decrease, 1

Translates into:
1.  Show Text: Man: You have the scroll!
2.  Show Text: [Character in Hero Slot]: Yes, it was hard to find but I have it now.
3.  Show Text: Found 150 gold!
4.  Increase current currency amount by 150.
5.  Show Text: You now have [Current Currency Amount] altogether!
6.  Remove one Scroll from inventory.

I also know the conditional branch needed to lead up to this through an event and how to make that work.  I just need alittle help understanding the code Falcon gave me so I can try to make sense of it and in turn try to use it to solve my problem.  Can anyone show me which way the light switch is?  I am just starting out on RPGMaker XP from a long break between now and RPGMaker2k and am trying to tackle a problem that is byond my understanding with my current knowledge.
What are you looking at?

Dyew

#15
Umm...

Would this work?


QuoteConditional Branch: Script: \n[Actor Position] = [Actor Name]

Meaning:  If the character's name was in slot [A] was equal to the character name I input...

If that was so then that would mean that Falcon's Script was meant to be in a conditional statement and would read.

QuoteConditional Branch: $game_party.actors[Character Postion in Party] == $game_actors[Actor Name]

Meaning:  If the actor is the party, in a position I present is not equal to a actor's name I present...

Or as a statment to move a actor around in the party while in battle?  Which is how I tried to get it to work and it failed.

QuoteConditional Branch: If actor is in party
$game_party.actors[Actor Postion in Party] = $game_actors[Actor Name]

Which should set a actor who is a party member in a position I present as being a actor in the hame that I present.  I must be wrong here because when I tried to use the script as part of a conditional statement yet not making it the condition it would not switch the position of the members of the party for me.

Is that correct or am I still very lost?
What are you looking at?

Falcon

You have it pretty right, you need to use == instead of =

Dyew

What are you looking at?