Login  Register
 



Post new topicReply to topic
 
Author Message
 PostPosted: 06 Jun, 2009 
 
User avatar

Joined: 24 Jun, 2007
Posts: 1354
Location: Map
Offline
How do you find definitions for functions? And were they are used, and where they can be changed?

I'm trying to find this:
def.SubInventoryType

_________________
Quote:
It's prononce Aeon not Eon and thank you for me to have eye's of a halk.

- Gamer 8


Top
 Profile  
 PostPosted: 06 Jun, 2009 
 
User avatar

Joined: 15 Feb, 2007
Posts: 20036
Location: Presumably, at the time of posting, his computer.
Offline
Some of them are defined in C. If a function is defined in another place, there's no way to know which.

Try this:
for k, v in _G.moho do
LOG(repr(v))
end

That will list the C functions exposed to the lua state. For example, the Unit class is based off moho.entity_methods.

_________________
I'm watchin you!
Image


Top
 Profile  
 PostPosted: 06 Jun, 2009 
 
User avatar

Joined: 28 Feb, 2007
Posts: 4123
Location: Marysville, WA USA
Online
In ability and buff handling functions def is usually a variable to hold the information and functions defined in a buff or ability. So, you should be looking for the blueprint for the buff or ability you are working with and you will find the SubInventoryType defined there.

Example:
Code:
ItemBlueprint {
    DisplayName = '<LOC ITEM_Idol_0000>Minotaur Berserker Idol',
    Description = '<LOC ITEM_Idol_0024>Use: Summons [GetSummonCount] Minotaur Berserkers. Can have a maximum of [GetSummonMax] Minotaur Berserkers.',
    GetSummonCount = function(self) return Ability['Item_Minotaur_Captain_010'].SummonCount end,
    GetSummonMax = function(self) return Ability['Item_Minotaur_Captain_010'].MaxUnits end,
    GetEnergyCost = function(self) return Ability['Item_Minotaur_Captain_010'].EnergyCost end,
    GetCastTime = function(self) return Ability['Item_Minotaur_Captain_010'].CastingTime end,
    GetCooldown = function(self) return Ability['Item_Minotaur_Captain_010'].Cooldown end,
   Icon = 'NewIcons/Boots/Boot1',
    InventoryType = 'Generals',
    SubInventoryType = 'Soldiers',  <-----------------
    Mesh = '/meshes/items/chest/chest_mesh',
    Animation = '/meshes/items/chest/Animations/chest_Idle_anim.gr2',
    MeshScale = 0.10,
    Name = 'Item_Minotaur_Captain_010',


SubInventoryType just tells the game that the icon for that item goes in the button defined for Soldiers, Archers, or Priests.

_________________
Image


Top
 Profile  
 PostPosted: 06 Jun, 2009 
 
User avatar

Joined: 24 Jun, 2007
Posts: 1354
Location: Map
Offline
Code:
    if slot == 1 then
        tooltipid =  'button_minions_soldiers'
        img =  '/abilities/icons/NewIcons/SuperGruntIcons/MinotaurCaptain_dis.dds'
    elseif slot == 2 then
        tooltipid =  'button_minions_archers'
        img =  '/abilities/icons/NewIcons/SuperGruntIcons/SiegeArcher_dis.dds'
    elseif slot == 3 then
        tooltipid =  'button_minions_priests'
        img =  '/abilities/icons/NewIcons/SuperGruntIcons/HighPriest_dis.dds'
    end


Ok so this tells the game where to put buttons for the specific minions, I would want to remove this, but its only a UI change and I want to change the gameplay too.

Code:

            if def.SubInventoryType == 'Soldiers' then
                slot = 1
            elseif def.SubInventoryType == 'Archers' then
                slot = 2
            elseif def.SubInventoryType == 'Priests' then
                slot = 3
            end


Huh? This comes from the same Module_inventory.
If the buttons are defined by the idols, then what stop me from getting three minotaur idols?

I'm trying to give players the freedom to get two or three of the same idols, instead of getting idols for predefined slots.

_________________
Quote:
It's prononce Aeon not Eon and thank you for me to have eye's of a halk.

- Gamer 8


Top
 Profile  
 PostPosted: 10 Jun, 2009 
 
User avatar

Joined: 24 Jun, 2007
Posts: 1354
Location: Map
Offline
So, has anyone found a way to do this?

_________________
Quote:
It's prononce Aeon not Eon and thank you for me to have eye's of a halk.

- Gamer 8


Top
 Profile  
 PostPosted: 10 Jun, 2009 
 

Joined: 05 Oct, 2007
Posts: 16449
Location: camping near the biggest power-up
Offline
DeadMG gave you the way to list the functions. that's all well and good but it doesn't give you the arguments to them. to get those, you need any half-arsed text editor (Crimson Editor does the job, but if you're a student you can get a big gun called Visual Studio 2008 for free via dreamspark.com) that has a search-in-files option.

it's a simple matter of seatching for your desired function.

_________________
Nephylim wrote:
But, an FA army in an FA environment just looks... right.
help wrote:
Does anyone know how to use air transports? I cant get them to pick up troops.


Top
 Profile  
 PostPosted: 10 Jun, 2009 
 
User avatar

Joined: 15 Feb, 2007
Posts: 20036
Location: Presumably, at the time of posting, his computer.
Offline
Just pass in 'lol', 'lol'. The game will reject your args and tell you what the args should be along with their names as given in the prototype.

_________________
I'm watchin you!
Image


Top
 Profile  
 PostPosted: 10 Jun, 2009 
 

Joined: 05 Oct, 2007
Posts: 16449
Location: camping near the biggest power-up
Offline
oh, that's brilliant.

well, to automate that a step further;

Code:
for id, m in _G.moho do
   LOG(repr(m))
   
   for ik, fn in m do
      fn('ROFL', 'LMAO')
   end
end

_________________
Nephylim wrote:
But, an FA army in an FA environment just looks... right.
help wrote:
Does anyone know how to use air transports? I cant get them to pick up troops.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic



Quick Tools

Search for:
Jump to:  

© 2002-2010 Gas Powered Games Corp. All Rights Reserved. Gas Powered Games is the exclusive trademark of Gas Powered Games Corp.
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
 
Home| Games | Company | News & Press | Support
  Terms of Use   |    Copyright Information   |    Privacy Policy