Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MuwuM

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 18
176
Feature requests / Re: giveMorphCommand
« on: 16 May 2012, 15:06:26 »
my bad, sorry

177
Feature requests / [done] giveMorphCommand
« on: 16 May 2012, 15:01:11 »
I'd like to have a Lua-method to give a unit the command to morph into another unit.

Patch for SVN head:
Code: [Select]
Index: source/glest_game/game/script_manager.cpp
===================================================================
--- source/glest_game/game/script_manager.cpp   (revision 3326)
+++ source/glest_game/game/script_manager.cpp   (working copy)
@@ -265,6 +265,7 @@
    luaScript.registerFunction(giveResource, "giveResource");
    luaScript.registerFunction(givePositionCommand, "givePositionCommand");
    luaScript.registerFunction(giveProductionCommand, "giveProductionCommand");
+   luaScript.registerFunction(giveMorphCommand, "giveMorphCommand");
    luaScript.registerFunction(giveAttackCommand, "giveAttackCommand");
    luaScript.registerFunction(giveUpgradeCommand, "giveUpgradeCommand");
    luaScript.registerFunction(giveAttackStoppedCommand, "giveAttackStoppedCommand");
@@ -925,7 +926,11 @@
    ScriptManager_STREFLOP_Wrapper streflopWrapper;
    world->giveUpgradeCommand(unitId, producedName);
 }
-
+void ScriptManager::giveMorphCommand(int unitId, const string &producedName){
+   if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
+   ScriptManager_STREFLOP_Wrapper streflopWrapper;
+   world->giveMorphCommand(unitId, producedName);
+}
 void ScriptManager::giveAttackStoppedCommand(int unitId, const string &itemName,int ignoreRequirements) {
    if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
    ScriptManager_STREFLOP_Wrapper streflopWrapper;
@@ -1578,6 +1583,13 @@
       luaArguments.getString(-1));
    return luaArguments.getReturnCount();
 }
+int ScriptManager::giveMorphCommand(LuaHandle* luaHandle){
+   LuaArguments luaArguments(luaHandle);
+   thisScriptManager->giveMorphCommand(
+      luaArguments.getInt(-2),
+      luaArguments.getString(-1));
+   return luaArguments.getReturnCount();
+}
 
 int ScriptManager::giveUpgradeCommand(LuaHandle* luaHandle){
    LuaArguments luaArguments(luaHandle);
Index: source/glest_game/game/script_manager.h
===================================================================
--- source/glest_game/game/script_manager.h   (revision 3326)
+++ source/glest_game/game/script_manager.h   (working copy)
@@ -261,6 +261,7 @@
    void giveProductionCommand(int unitId, const string &producedName);
    void giveAttackCommand(int unitId, int unitToAttackId);
    void giveUpgradeCommand(int unitId, const string &upgradeName);
+   void giveMorphCommand(int unitId, const string &producedName);
 
    void disableAi(int factionIndex);
    void enableAi(int factionIndex);
@@ -363,6 +364,7 @@
    static int giveResource(LuaHandle* luaHandle);
    static int givePositionCommand(LuaHandle* luaHandle);
    static int giveProductionCommand(LuaHandle* luaHandle);
+   static int giveMorphCommand(LuaHandle* luaHandle);
    static int giveAttackCommand(LuaHandle* luaHandle);
    static int giveUpgradeCommand(LuaHandle* luaHandle);
 
Index: source/glest_game/world/world.cpp
===================================================================
--- source/glest_game/world/world.cpp   (revision 3326)
+++ source/glest_game/world/world.cpp   (working copy)
@@ -1076,7 +1076,32 @@
       throw megaglest_runtime_error("Invalid unitId index in giveProductionCommand: " + intToStr(unitId) + " producedName = " + producedName);
    }
 }
+void World::giveMorphCommand(int unitId, const string &producedName) {
+   Unit *unit= findUnitById(unitId);
+   if(unit != NULL) {
+      const UnitType *ut= unit->getType();
 
+      //Search for a command that can produce the unit
+      for(int i= 0; i< ut->getCommandTypeCount(); ++i) {
+         const CommandType* ct= ut->getCommandType(i);
+         if(ct != NULL && ct->getClass() == ccMorph) {
+            const MorphCommandType* pct= static_cast<const MorphCommandType*>(ct);
+            if(pct != NULL && pct->getMorphUnit()->getName() == producedName) {
+               if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
+
+               unit->giveCommand(new Command(pct));
+
+               if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
+               break;
+            }
+         }
+      }
+   }
+   else {
+      throw megaglest_runtime_error("Invalid unitId index in giveProductionCommand: " + intToStr(unitId) + " producedName = " + producedName);
+   }
+}
+
 void World::giveAttackStoppedCommand(int unitId, const string &itemName, bool ignoreRequirements) {
    Unit *unit= findUnitById(unitId);
    if(unit != NULL) {
Index: source/glest_game/world/world.h
===================================================================
--- source/glest_game/world/world.h   (revision 3326)
+++ source/glest_game/world/world.h   (working copy)
@@ -230,6 +230,7 @@
    bool getIsUnitAlive(int unitId);
    void giveAttackCommand(int unitId, int unitToAttackId);
    void giveProductionCommand(int unitId, const string &producedName);
+   void giveMorphCommand(int unitId, const string &producedName);
    void giveUpgradeCommand(int unitId, const string &upgradeName);
    void giveAttackStoppedCommand(int unitId, const string &itemName,bool ignoreRequirements);
    void playStaticSound(const string &playSound);

178
Feature requests / Re: environment variable
« on: 9 May 2012, 20:43:52 »
I assume that would not be so easy, because you would need different xml types, a work-arround would be to set a variable to 1 in the <globals> tag of megaglest and ask in startup, wether it's set, or not.
That wouldn't work well, though, as it would only stop MG-only scenarios from playing on GAE, but not the other way around. Not sure what you mean by "you would need different xml types".
in Globals:
Code: [Select]
megaglest = 1
in startup:
Code: [Select]
megaglest = megaglest or  0

if megaglest == 1 then
     -- do something for MG
else
     -- do something for GAE
end

179
Feature requests / Re: environment variable
« on: 9 May 2012, 17:37:28 »
I assume that would not be so easy, because you would need different xml types, a work-arround would be to set a variable to 1 in the <globals> tag of megaglest and ask in startup, wether it's set, or not.

180
in your heal-circle area is a shop

the men at the desk

181
Ok, how to play BattleGlest:

  • You have a single hero instead of a whole army
  • Your target is to defeat the base of your opponent
  • To reach this you got support by different weak units called creeps
  • The creeps follow fixed paths to the base called lanes
  • On each lane are several towers stopping creeps and heros from reaching the base
  • Usually you got 3 different steps to win:
    1. You kill the heroes of the other team.
    2. You kill the towers of the other team.
    3. You kill the base of the other team.
  • You can also kill special creeps in the forest (disabled in v.0003-001) to get additional gold
  • You can buy items in a shop, that makes your hero stronger.
  • You can use teleportation-shires to be much more mobile. (not yet implemented)
  • Your hero gains experence for killing creeps and heros, which leads to leveling up (disabled in v.0003-001)

182
New release: v.0003-001

Code: [Select]
[URL=http://imageshack.us/photo/my-images/338/screen95.jpg/][IMG]http://img338.imageshack.us/img338/3549/screen95.th.jpg[/img][/URL] [URL=http://imageshack.us/photo/my-images/29/screen96r.jpg/][IMG]http://img29.imageshack.us/img29/6170/screen96r.th.jpg[/img][/URL] [URL=http://imageshack.us/photo/my-images/402/screen97u.jpg/][IMG]http://img402.imageshack.us/img402/2978/screen97u.th.jpg[/img][/URL] [URL=http://imageshack.us/photo/my-images/195/screen98n.jpg/][IMG]http://img195.imageshack.us/img195/4129/screen98n.th.jpg[/img][/URL] [URL=http://imageshack.us/photo/my-images/821/screen99.jpg/][IMG]http://img821.imageshack.us/img821/305/screen99.th.jpg[/img][/URL]

183
Feature requests / Re: return-particles and lifesteal
« on: 7 May 2012, 16:04:08 »
Man 25 minutes on my school wifi to download the MG source. Ugh.

Also, you would have to do the particles yourself. I am not familiar enough with the particle code to modify it.

I presume you want something like the blood lines in hon that symbolize lifesteal?

Yes something like this

184
Feature requests / Re: return-particles and lifesteal
« on: 7 May 2012, 15:47:34 »
ok, then it was my fault

185
Feature requests / Re: return-particles and lifesteal
« on: 7 May 2012, 15:44:42 »
I assume that we would need more than 8 lines of code.

186
Feature requests / Re: return-particles and lifesteal
« on: 7 May 2012, 15:35:33 »
Yes I've posted some, I really mean is that we have many things to do in megaglest yet. It's amazing that nobody understands programming here but softcoder!, You see has many taxpayers tilesetes mods maps ... ,
I think first before everything we search more developers to megaglest, not to fall all this weight on the back of softcoder.

I'm sorry to tell, but titi is also a developer, and I have done some smaller stuff for MG, too (I have not always the enthusiasm to programm more than 12 hours a day... so it is nothing that big). And I usually try to develop my feature requests on my own, but I don't want to forget them so I post them. When I got problems I usually ask the other developer, but this would be a quite big change so I'd like to get the opinion of the others, before I start to programm.

GAE supports life steal and ep steal and ep burn already with effects, and my own personal version supports it in the source code. Since the effect in the source code was directly modeled on the damage functions, it shouldn't produce any weird errors in multiplayer. I will look at the MG source code to see if it is similar enough to just copy the changes. It only affects 8 files.

It would be great, but I'm afraid, that you need a bit more, but it could help a lot.

187
Feature requests / return-particles and lifesteal
« on: 7 May 2012, 11:28:30 »
I think it would be nice to have 2 new features for attacking, the first is return-particles, which are particles from the attacked unit to the attacking unit (should start after the start of the splash). In addition to that I'd like to have the possibility to add lifesteal to the return-particles, which means, that the attacking unit got healed by X% of Damage dealed.

An example for return-particles could be a boomerang.

188
Maps, tilesets and scenarios / Re: BattleGlest PreAlpha
« on: 6 May 2012, 18:09:17 »
If MegaGlest (or you, since you're using a custom engine, right?)
No, I'm not using anything different from SVN-head.

If MegaGlest were to implement GAE's effects, you could very easily have "life steal" and "mana burn" (assuming the former just absorbs health and gives it to the attacker while the latter simply damages EP).
I think softcoder would not be sooo happy to use GAE-code without much testing in multiplayer, And I can't use code, that might cause problem in multiplayer and I don't want to use anything else than MG-SVN (or the corresponding release that supports, everything I need for my mod)

189
Maps, tilesets and scenarios / Re: BattleGlest PreAlpha
« on: 6 May 2012, 17:30:10 »
What sort of spell effects do you have?

Burning, poison, healing, slowing, snaring, damage-reduction

In the commercial versions they have:
lifesteal
manaburn
stuns
snares
roots
slows
immobilize
silence

etc.

I'd like to have lifesteal, but it is not possible, stunning is not really possible, maybe a workarround with reducing all speed-parameters (attack-speed, move-speed, build-speed, morph-speed), mana-burn is not possible (but I think it's not so important at the moment...

190
Maps, tilesets and scenarios / Re: AI
« on: 3 May 2012, 06:24:11 »
I assume it was somehow missed to load the globals in the <unitCreated> tag. That should be fixable within a few minutes, but I'm not familar with the GAE-sourcecode.

maybe another thing to test could be
buildings = buildings or {}
on top of each <unitCreated>. Then you should try to print the result to the console and check whether it works or not.

191
MegaGlest / Re: Translatable techtrees
« on: 2 May 2012, 22:36:46 »
Does that also mean that now special letters like "ä","ö" and "ü" could be used?

192
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 22:34:42 »
well it seems, like you don't have access to your global variables in the <unitCreated> tag. Megaglest had this problem on some older releases ,too, but now it has a special <global> tag which avoids such errors.

193
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 22:02:35 »
yes, it would

try
table.insert(buildings, buildingid)
instead of
buildings[record] = buildingid
record = record + 1

194
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 21:53:24 »
try to put
Code: [Select]
buildings = {}
record = 1

on the top of the unitCreated. I know that, would not be what you'd like to have, but it could be the bug.

195
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 20:09:45 »
Yes it should be because or means in Lua (left side or if false or nil then look on the right side if thats false, return false, else the value of the right side which is as String and not a boolean)

196
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 19:37:03 »
Ok, let's start with the basics: Lua array is started at 1    arr[1], arr[2], arr[3], ...
but that's not the problem.

You should try this: if buildingcheck == 'buildning name' or buildingcheck == ' building name' or buildingcheck == ' building name' or buildingcheck == ' building name' ...  then


197
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 17:42:04 »
I don't understand what you mean. Do you mean create some new orders in C++ which modders can then call with Lua?
Yes, that what I thought about, and did in my mod.

How are you doing it? (I had about 100 ndex a global which is a nil value's in BattleGlest before but it's hard to give advices without seeing any code)

198
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 17:19:46 »
Maybe it would help do build some new Lua-methods in c++ (for selecting attacking, standing, moving units) because it's quite easy, compared to the rest and build the real AI in Lua?

199
Maps, tilesets and scenarios / Re: AI
« on: 2 May 2012, 12:50:16 »
well the first step for custom AI is disableAi(factionIndex).

The second step is converting Units to LuaOO - objects

The third step is implementing the reactions (what it should do) of a unit.

And the last step is to implement event-handler and action-triggering.



ok, that was obviously not your question....

I'd say it this way: for really changing the AI without performance-problems you need to build the changes in C++, Lua gets very slow with multiple loops.

MG got a couple of better support-methods for this during the last month, but it is still not, perfect. So far it seems to me, GAE can even handle less AI control.

200
Mods / Re: Glest Community Development Monthly - Issue 52
« on: 26 April 2012, 06:39:10 »
slight edit to include a link to the previous GDC's posting, as per tradition.
Oh, it seems I forgot it ... thanks

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 18
anything