Skip to content

Calling a method to change a value (that uses void and this)

Ask for help here ;)

Calling a method to change a value (that uses void and this)

Postby Young_Scott » 15 Jun 2012, 23:24

I'd like to say off the bat that Antares has already blown me away with how easily it intergrates with other Unity middle-wares. :)

But I've run into a small problem. I'm using the "ORK RPG Kit" with Antares for a project. After some tinkering, I managed to figure out how to retrieve RPG game data from the kit by calling an instance of the kit "DataHolder" class and then calling an ItemName method. I even managed to print off the results directly into another middle-ware, iGUI!

Now the problem: I've set up a battle with the kit (which uses a component/script on an object for the battle settings, such as enemy types), but I'm not sure how to get Antares to interact with those battle settings. When I try to call a method from the BattleArena class, it pops up as type Void (presumably because it pulls the info from the component box).

Hopefully the attached screenshot can clarify the issue.

Here's the ORK RPG Kit wiki: http://www.rpg-kit.com/wiki/index.php/Scripting

And here's some code from the BattleArena class.

Syntax:
Using csharp Syntax Highlighting
[AddComponentMenu("RPG Kit/Battles/Battle Arena")]
public class BattleArena : BaseInteraction
{

public void AddEnemy()
        {
                this.enemy = ArrayHelper.Add(0, this.enemy);
                this.enemySpot = ArrayHelper.Add(null, this.enemySpot);
                this.spawnEnemy = ArrayHelper.Add(true, this.spawnEnemy);
                this.enemyObject = ArrayHelper.Add(null, this.enemyObject);
        }
}
 
Parsed in 0.007 seconds, using GeSHi 1.0.8.4


I imagine the solution to this is a clever use of the amazing Antares wizards, but I haven't figured out yet!

Thanks,
- Scott
Attachments
battle.JPG
Young_Scott
 
Posts: 2
Joined: 15 Jun 2012, 22:53

Re: Calling a method to change a value (that uses void and t

Postby holyjewsus » 16 Jun 2012, 00:43

I've never used RPG kit, but maybe you want a set value wizard?
holyjewsus
 
Posts: 390
Joined: 08 Apr 2011, 00:58

Re: Calling a method to change a value (that uses void and t

Postby holyjewsus » 19 Jun 2012, 03:46

did you ever get this working?
holyjewsus
 
Posts: 390
Joined: 08 Apr 2011, 00:58

Re: Calling a method to change a value (that uses void and t

Postby Neodrop » 20 Jun 2012, 18:45

As I see, the method AddEnemy has no parameters. Just call it by Wizard and forget.
User avatar
Neodrop
Администратор
 
Posts: 1068
Joined: 15 Jan 2011, 13:18

Re: Calling a method to change a value (that uses void and t

Postby Young_Scott » 20 Jun 2012, 19:12

Hey holyjewsus, sorry, I was away at the weekend. :)

I actually tried a set value wizard (managed to pull out an enemy array from BattleArena Battle1), but it was empty and wouldn't let me pass in enemy types.

Neodrop, I can call the AddEnemy method by the method by wizard, but what do you mean "forget"?

Thanks for any help!

EDIT: Oh wait, do you mean some sort of For > Get loop iterator?
Young_Scott
 
Posts: 2
Joined: 15 Jun 2012, 22:53

Re: Calling a method to change a value (that uses void and t

Postby holyjewsus » 20 Jun 2012, 20:30

I'm still a bit confused about what you want to do and how this kit works but, maybe you need to create an instance of enemy and then use add enemy to add that instance?
holyjewsus
 
Posts: 390
Joined: 08 Apr 2011, 00:58

Re: Calling a method to change a value (that uses void and t

Postby beddnollop » 15 May 2015, 19:44

thanks for the list guys. it'll really help me.
beddnollop
 
Posts: 13
Joined: 15 May 2015, 09:33


Return to HELP!!!

Who is online

Registered users: No registered users