Author Topic: Glest tower defense  (Read 45291 times)

me5

  • Guest
Re: Glest tower defense
« Reply #125 on: 15 November 2009, 18:06:27 »
I already tried this workaround but wanted to make it work with "patrolfuncions" (this is my emergency solution  ;)).

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #126 on: 20 November 2009, 03:28:44 »
Ok... thats a lot of code to do not much  :'(

I think it was interesting to try to do something so ambitious with the limitations of glest 3.2s scripting interface, but its time to put that experiment aside, and move this project on to a GAE mod.

I will unfortunately have to ask you to be a little bit patient, the lua additions have been added in a 'branch' that was separated from the 'trunk' some time ago, so it would be pointless building an experimental executable atm, because it would be very buggy.  We have been very busy hunting and killing bugs though, and 0.2.12b should be ready soon (hopefully on the weekend), after that is all wrapped up, I'll merge the lua extensions and bug-fixes and get you an experimental GAE to continue with.

I went through your script, grabbed the 'idea' of what you were doing, then rewrote it using timers and triggers...
This is much nicer to look at, I'm sure you'll agree ;)
NB: probably best to start reading under the 'startup' comment header, the createAttackers() function probably wont make sense until you've seen the registerRegion() and registerEvent() calls further down.
Code: [Select]
<?xml version="1.0" standalone="yes" ?>
<scenario>

<difficulty value="0"/>
<players>
<player control="human" faction="defence" team="1"/>
<player control="cpu" faction="attack" team="2"/>
<player control="closed"/>
<player control="closed"/>
</players>
<map value="glestTD_1"/>
<tileset value="forest"/>
<tech-tree value="td_1"/>
<default-resources value="false"/>
<default-units value="false"/>
<default-victory-conditions value="false"/>
 
<scripts>
 
<startup>
----------------------------------------------------------------------------
--                Unit Creation and Group Management                      --
----------------------------------------------------------------------------

-- create an attack group
function createAttackers()
  for i=1,attackers.number do
    createUnit(attackers.type, 1, attackers.startPoint);
    local id = lastCreatedUnit();
    --debugLog("created a "..attackers.type.." id = "..id);
    attackers.units[#attackers.units+1] = id;
    givePositionCommand(id, "move", attackers.waypoints[1]);
    setUnitTrigger(id, "waypoint_reached");
    setUnitTrigger(id, "in_finish_area");
  end
end

-- takes an array of type and position pairs, creates units for faction
function createStartingUnits(typeAndPosition, faction)
  for i=1,#typeAndPosition do
    createUnit(typeAndPosition[i][1], faction, typeAndPosition[i][2])
  end
end       

-- remove a unit id from a group, returns true if removed, false if unit wasn't in the group
function removeFromGroup(group, unitId)
  for i= 1,#group do
  if group[i] == unitId then
    table.remove(group, i);
    return true;
  end
  end
  return false;
end

----------------------------------------------------------------------------
--                             Utilities                                  --
----------------------------------------------------------------------------

-- returns a rectangle around the point 'pos'
function areaAround(pos)
  return { pos[1]-5, pos[2]-5, pos[1]+5, pos[2]+5 };
end

-- takes an array of type and amount pairs, gives resources to faction
function giveResources(typeAndAmount, faction)
  for i=1, #typeAndAmount do
    giveResource(typeAndAmount[i][1], faction, typeAndAmount[i][2]);
  end
end

----------------------------------------------------------------------------
--                             Start-Up                                   --
----------------------------------------------------------------------------

attackers = {};
attackers.startPoint = {49,81};
attackers.waypoints = {{49,30}, {5,30}};
attackers.units = {}
attackers.type = "daemon";
attackers.number = 6;

registerRegion("waypoint", areaAround(attackers.waypoints[1]));
registerEvent("waypoint_reached", "region=waypoint");

finish = areaAround({15,30});
registerRegion("finish", finish);
registerEvent("in_finish_area", "region=finish");

disableAi (1);

player_units = {
  { "worker",   {30,40} },
  { "worker",   {15,20} },
  { "worker",   {20,20} },
--  { "ground1",  {40,60} },
--  { "ground1",   {60,60} },
  { "castle2",  { 5,30} }
}
player_resources = {
  { "gold",  2000 },
  { "stone",  300 },
  { "wood",  2000 },
  { "food",   500 }
}
createStartingUnits(player_units, 0);
giveResources(player_resources, 0);
setCameraPosition(startLocation(0));
showMessage('Welcome', 'welcome')

reward_resources = {
  { "gold",  2000 },
  { "stone",  300 },
  { "wood",  2000 },
  { "food",   500 }
}

lives=100;
wave=0;
no_bonus = {}

setTimer("start_wave", "game", 40 * 5, false);
</startup>
 
<unitEvent name="waypoint_reached">
  -- when a attacker reaches way-point 1...
  givePositionCommand(unit_id, "move", attackers.waypoints[2]);
</unitEvent>

<unitEvent name="in_finish_area">
  -- triggers when a bad guy enters finish area...
  lives = lives - 1;
  no_bonus[#no_bonus+1] = unit_id;
  setDisplayText("Amount of lives: "..lives);
if lives == 0 then --we lost
clearDisplayText()
setPlayerAsWinner(1)
endGame()
end
</unitEvent>

<timer name="start_wave">
  if wave == 19 and lives > 0 then -- victory?
  setPlayerAsWinner(0);
  endGame();
  end
  if wave == 5 then -- after 5 waves of daemons, switch to guards
    attackers.type = "guard";
    attackers.number = 6;
  elseif wave == 10 then -- after 5 waves of gaurds, switch to horsemen
    attackers.type = "horseman";
    attackers.number = 3;
  end
  -- create a wave and start them on their way
  createAttackers();
  wave = wave + 1;
</timer>
 
<unitDied>
local deadId = lastDeadUnit();
--debugLog("unit death "..lastDeadUnitName().." id = "..deadId);

if unitFaction(deadId) == 0 then -- human unit, do nothing
  return;
end

if not removeFromGroup(no_bonus, deadId) then -- if not in finish area
  --debugLog("giving reward");
  giveResources(reward_resources, 0);         -- give player reward
--else
  --debugLog("no reward");
end

if removeFromGroup(attackers.units, deadId) then   -- remove from attackers
  if #attackers.units == 0 then                    -- if attackers now empty, set timer for next wave
    setTimer("start_wave", "game", 40 * 5, false); -- 5 seconds (at normal game speed)
    if wave == 19 then
      setDisplayText("This was the last wave");
    end
  end
end
</unitDied>

</scripts>
</scenario>

If you have any queries, fire away :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #127 on: 23 November 2009, 14:24:13 »
It looks really neat! :)

some questions on porting to GAE:

can I use units from 3.2.2 in GAE or are there things I have to add like new tabs in the xml file or such?

is this how this awesome eventtriggeringthing works? :
" registerEvent("name_of_my_event", "look_for_this_condition"); "

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #128 on: 24 November 2009, 05:43:04 »
It looks really neat! :)

some questions on porting to GAE:

can I use units from 3.2.2 in GAE or are there things I have to add like new tabs in the xml file or such?

If it works for 3.2.2 it will work on GAE... there are new features you may want to make use of...
see,
XML Specs.
XML Ref.

and I started documented the new Lua functions, but this is incomplete (no triggers yet) and some of it may be wrong ;)
Lua Ref.

Quote
is this how this awesome eventtriggeringthing works? :
" registerEvent("name_of_my_event", "look_for_this_condition"); "

In essence, yes.  I've actually been pulling together a scenario to make sure everything is sensible... the system has had to be changed a bit.  You register a 'unitEvent' by providing a name, you then have handler in your XML that looks like <unitEvent name="myEvent">--some lua</unitEvent>, or if you are in an external Lua file, you define a function called unitEvent_myEvent, which takes one parameter, the unit id of the unit triggering the event, so it would look like function unitEvent_myEvent(unit_id) --[[ code ]] end

If you use the XML event handler, the unit id is always called unit_id, if you define the function in a lua file, you can call it whatever you like.

You then set up triggers on units, with 'condition' strings that I did have in registerEvent, now done in setUnitTrigger()
So the process now is like this...
Code: [Select]
registerEvent("waypoint_reached");  -- register the event
function unitEvent_waypoint_reached(unit_id) -- define the event
-- set another waypoint, attack, run-away... ?
givePositionCommand(unit_id, "attack", startLocation(0));
end

waypoint = { 50,50 } -- our waypoint
registerRegion("waypoint", area_around(waypoint)); -- register the 'region' around the waypoint
-- and set a trigger, supplying the unit id, a condition string, and the event to fire when the condition is met
setUnitTrigger(some_unit_id, "region=waypoint", "waypoint_reached");

givePositionCommand(some_unit_id, "move", waypoint)

The only accepted conditions for triggers that I have so far are, region=registeredRegion and command_callback
but a couple of others, attacked and hp-below=threshold will probably be in soon.
« Last Edit: 18 June 2016, 17:56:41 by filux »
Glest Advanced Engine - Code Monkey

Timeline | Downloads

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #129 on: 29 November 2009, 03:52:09 »
An experimental build of GAE, with all the new Lua, is out, please refer to this topic,
https://forum.megaglest.org/index.php?topic=4841.0

and I've been busy documenting it all, see
https://sourceforge.net/apps/trac/glestae/wiki/LuaReference

The code I posted of the re-write using the new stuff will need to have the registerEvent() and setUnitTrigger() function calls changed to suit the new system, the 'conditions' will need to be moved from registerEvent() to setUnitTrigger(). Let me know if you have any problems.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #130 on: 29 November 2009, 13:57:00 »
Thx for letting me know!
btw: "unitCount(factionIndex)" is explained twice  ;)
(https://sourceforge.net/apps/trac/glestae/wiki/LuaReference)

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #131 on: 30 November 2009, 06:10:31 »
btw: "unitCount(factionIndex)" is explained twice  ;)

Thanks! It was a bit of a cut-n-paste frenzy by the end :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #132 on: 3 December 2009, 08:27:26 »
!!!!NEW CODE SAME BUG!!!!!  >:( >:( >:(

Guess what? I fixed it.  ;D
The guards died of hunger. The CPU player has no food so the guards die. I just changed the the xml file of the guard and there you go.

Things I found out about GAE (0.2.X-win32) so far:

1. The xml comments does not work ("<!-- -->")
2. I have the win mouse over the glestmouse.
3. If you zoom out there are no shadows at the edge of the screen (it depands on the position of the sun/light).
4. When I type in the "console" the short cuts are active.
5. What about changing the names of all hilight-functions to highlight-funcions?
6. What about using "==" instead of "=" for conditions like: 'region==name' instead of 'region=name'. I wondering about this because in
    C++ and LUA one use "==" for conditions (correct me if I'm wrong).
7. Sometimes (two times till now) GAE is going crazy by that I mean the speed is set to normal but the speed is superfast (faster than
   fast). But not only the speed ingame is so fast also the speed in the menu is superfast (the animations in the menu are superfast and
  the blinking buttons blinks superfast when mouseover).

8. NEW CODE NEW BUG ;D ;D  It seems like sometimes units hinder eachother and then one will stop to move. (just try my new code
    or make alot of units and give them a long way to move-> some units will get stuck)

new code:
Code: [Select]
<?xml version="1.0" standalone="yes" ?>
<scenario>

<difficulty value="0"/>
<players>
<player control="human" faction="defence" team="1"/>
<player control="cpu" faction="attack" team="2"/>
<player control="closed"/>
<player control="closed"/>
</players>
<map value="TD_like_4"/>
<tileset value="forest"/>
<tech-tree value="td_1"/>
<default-resources value="false"/>
<default-units value="false"/>
<default-victory-conditions value="false"/>
 
<scripts>
 
<startup>
----------------------------------------------------------------------------
--                Unit Creation and Group Management                      --
----------------------------------------------------------------------------

-- create an attack group
function createAttackers()
  for i=1,attackers.number do
createUnit(attackers.type, 1, attackers.startPoint);
local id = lastCreatedUnit();
--debugLog("created a "..attackers.type.." id = "..id);
attackers.units[#attackers.units+1] = id;
givePositionCommand(id, "move", attackers.waypoints[1]);
--debugLog("gave movecommand to ".. i .." id = "..id);
setUnitTrigger(id, "region=waypoint", "waypoint_reached");
setUnitTrigger(id, "region=finish", "in_finish_area");
  end
end

-- takes an array of type and position pairs, creates units for faction
function createStartingUnits(typeAndPosition, faction)
  for i=1,#typeAndPosition do
createUnit(typeAndPosition[i][1], faction, typeAndPosition[i][2])
  end
end       

-- remove a unit id from a group, returns true if removed, false if unit wasn't in the group
function removeFromGroup(group, unitId)
  for i= 1,#group do
  if group[i] == unitId then
table.remove(group, i);
return true;
  end
  end
  return false;
end

----------------------------------------------------------------------------
--                             Utilities                                  --
----------------------------------------------------------------------------

-- returns a rectangle around the point 'pos'
function areaAround(pos)
  return { pos[1]-3, pos[2]-3, (2*3), (2*3) };
end

-- takes an array of type and amount pairs, gives resources to faction
function giveResources(typeAndAmount, faction)
  for i=1, #typeAndAmount do
giveResource(typeAndAmount[i][1], faction, typeAndAmount[i][2]);
  end
end

----------------------------------------------------------------------------
--                             Start-Up                                   --
----------------------------------------------------------------------------

attackers = {};
attackers.startPoint = {49,81};
attackers.waypoints = {{49,30}, {5,30}};
attackers.units = {}
attackers.type = "guard";
attackers.number = 6;

registerRegion("wa", {20,20,10,10});
registerRegion("waypoint", areaAround(attackers.waypoints[1]));
registerEvent("waypoint_reached");

finish = areaAround({15,30});
registerRegion("finish", finish);
registerEvent("in_finish_area");

disableAi (1);

player_units = {
  { "worker",   {30,40} },
  { "worker",   {15,20} },
  { "worker",   {20,20} },
--  { "ground1",  {40,60} },
--  { "ground1",   {60,60} },
  { "castle2",  { 5,30} }
}
player_resources = {
  { "gold",  2000 },
  { "stone",  300 },
  { "wood",  2000 },
  { "food",   500 }
}
createStartingUnits(player_units, 0);
giveResources(player_resources, 0);
setCameraPosition(startLocation(0));
showMessage('Welcome', 'welcome')

reward_resources = {
  { "gold",  2000 },
  { "stone",  300 },
  { "wood",  2000 },
  { "food",   500 }
}

lives=100;
wave=0;
no_bonus = {}

setTimer("start_wave", "game", 40 * 5, false);
</startup>
 
<unitEvent name="waypoint_reached">
  -- when a attacker reaches way-point 1...
  givePositionCommand(unit_id, "move", attackers.waypoints[2]);
</unitEvent>

<unitEvent name="in_finish_area">
  -- triggers when a bad guy enters finish area...
  lives = lives - 1;
  no_bonus[#no_bonus+1] = unit_id;
  setDisplayText("Amount of lives: "..lives);
if lives == 0 then --we lost
clearDisplayText()
setPlayerAsWinner(1)
endGame()
end
</unitEvent>

<timer name="start_wave">
  if wave == 19 and lives > 0 then -- victory?
  setPlayerAsWinner(0);
  endGame();
  end
  if wave == 5 then -- after 5 waves of daemons, switch to guards
attackers.type = "guard";
attackers.number = 6;
  elseif wave == 10 then -- after 5 waves of gaurds, switch to horsemen
attackers.type = "horseman";
attackers.number = 3;
  end
  -- create a wave and start them on their way
  createAttackers();
  wave = wave + 1;
</timer>
 
<unitDied>
local deadId = lastDeadUnit();
--debugLog("unit death "..lastDeadUnitName().." id = "..deadId);

if unitFaction(deadId) == 0 then -- human unit, do nothing
  return;
end

if not removeFromGroup(no_bonus, deadId) then -- if not in finish area
  --debugLog("giving reward");
  giveResources(reward_resources, 0);         -- give player reward
--else
  --debugLog("no reward");
end

if removeFromGroup(attackers.units, deadId) then   -- remove from attackers
  if #attackers.units == 0 then                    -- if attackers now empty, set timer for next wave
setTimer("start_wave", "game", 40 * 5, false); -- 5 seconds (at normal game speed)
if wave == 19 then
  setDisplayText("This was the last wave");
end
  end
end
</unitDied>

</scripts>
</scenario>

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Glest tower defense
« Reply #133 on: 3 December 2009, 12:06:12 »
I've added 2. and 4. to trac. I haven't tested the others.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #134 on: 3 December 2009, 23:37:01 »
1. The xml comments does not work ("<!-- -->")
That's interesting... I'd have thought this might be from the move to TinyXML, but I know I've used them since with-out problem, will investigate.

Quote
3. If you zoom out there are no shadows at the edge of the screen (it depands on the position of the sun/light).
I think it's more to do with the orientation and distance of the camera, shadows only appear to be rendered correctly (as in, at all) in the area the Glest 'game mode' camera would be looking at, been meaning to open a ticket for this...

Quote
5. What about changing the names of all hilight-functions to highlight-funcions?
Make the names even longer? No. How about I make them colourCells() and colourRegion(), and add an optional parameter to specify colour to show them with? That'd make them more useful.

Quote
6. What about using "==" instead of "=" for conditions like: 'region==name' instead of 'region=name'. I wondering about this because in C++ and LUA one use "==" for conditions (correct me if I'm wrong).
In C++ and Lua, you use for == for comparison. Trigger conditions are not comparisons, they specify a trigger type and optionally some extra data for that trigger (with the extra data redundant and omitted for simple conditions). Perhaps it should be 'in_region=name' or some such, but I don't think I'll change that one.

Quote
7. Sometimes (two times till now) GAE is going crazy by that I mean the speed is set to normal but the speed is superfast (faster than fast). But not only the speed ingame is so fast also the speed in the menu is superfast (the animations in the menu are superfast and the blinking buttons blinks superfast when mouseover).

8. NEW CODE NEW BUG ;D ;D  It seems like sometimes units hinder eachother and then one will stop to move. (just try my new code or make alot of units and give them a long way to move-> some units will get stuck)

7 is an odd one, never experienced it myself, could you possibly provide some details on the hardware you're running?

8 is a problem that is being looked at, but yes, especially with a narrow path and a number of units, some may be blocked and 'give up' and cancel their command. You could set 'command_callback' triggers, but to use them effectively you will probably need to start keeping some information about each unit's state in lua.  I've actually being playing with 'finite state machines' a bit of recent, making a scenario and doing a feasibility study at the same time. I doubt you want full blown state machines, but I'll try to rig up a simple framework you can use to manage your bad guys better.

Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #135 on: 4 December 2009, 16:47:46 »
Quote
Make the names even longer? No. How about I make them colourCells() and colourRegion(), and add an optional parameter to specify colour to show them with? That'd make them more useful.

Sounds nice.

Quote
In C++ and Lua, you use for == for comparison. Trigger conditions are not comparisons, they specify a trigger type and optionally some extra data for that trigger (with the extra data redundant and omitted for simple conditions). Perhaps it should be 'in_region=name' or some such, but I don't think I'll change that one.

I was thinking like: if region == myregion than activate trigger. But I think stick with "=" is ok.

(I use an AMD CPU (4400+) and ATI graphic board (all in wonder X800GT))

me5

  • Guest
Re: Glest tower defense
« Reply #136 on: 6 December 2009, 17:15:13 »
for glest I use most:
OS: winXP (SP2)
and CatalystControlCenter says:
-DriverPackagingVersion: 8.593.100.1-...
-CatalystVersion: 09.3
-OpenGLVersion 6.14.10.8543

Can I do this by using GAE:
-A tower which slows down unist.
-A tower which has a turret which turns in the direction of the enemy and then fires.
-A unit with particles. For example a burning unit (not only when damaged).

(@silnarm how about markRegion, it's even shorter  :) )

me5

  • Guest
Re: Glest tower defense
« Reply #137 on: 7 December 2009, 17:46:39 »
I guess
Quote
-A tower which slows down unist.
works (one can add effects to the attack https://docs.megaglest.org/GAE/Guide)
« Last Edit: 18 June 2016, 17:54:23 by filux »

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #138 on: 9 December 2009, 00:56:00 »
Can I do this by using GAE:
-A tower which has a turret which turns in the direction of the enemy and then fires.
No, as per Glest the whole model would have to rotate, this would make a good feature request though..

-A unit with particles. For example a burning unit (not only when damaged).
Not yet.

Quote
(@silnarm how about markRegion, it's even shorter  :) )
Actually, I think colourRegion, or maybe shadeRegion, might be best, as I'll be adding an outlineRegion soon ;)

I guess
Quote
-A tower which slows down unist.
works (one can add effects to the attack https://docs.megaglest.org/GAE/Guide)
Yeah, please let us know how you go with the effects, I never really tested them while I was changing things recently, hopefully I didn't break anything!
« Last Edit: 18 June 2016, 17:53:13 by filux »
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #139 on: 9 December 2009, 10:47:59 »
OK I tried to make
Quote
-A tower which slows down unist.

I only changed the attack tag in the xml file of my tower but it seems like it does not work.
At first I tried to set a "static-modifiers" to slow down the units. After that I added the "multipliers" tag but it seems like it changed
nothing. Are there other things I have to change or is it only the xml of the unit?

Here is the attack tag of my unit:

Code: [Select]
<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="30"/>
<anim-speed value="30"/>
<animation path="models/frosttower.g3d"/>
<sound enabled="true" start-time="0">
<sound-file path="sounds/defense_tower_attack1.wav"/>
<sound-file path="sounds/defense_tower_attack2.wav"/>
</sound>
<attack-strenght value="2"/>
<attack-var value="50"/>
<attack-range value="17"/>
<attack-type value="piercing"/>
<attack-start-time value="0"/>
<attack-fields>
<field value="land"/>
<field value="air"/>
</attack-fields>
<projectile value="true">
<particle value="true" path="particle_proj.xml"/>
<sound enabled="true">
<sound-file path="sounds/arrow_hit1.wav"/>
<sound-file path="sounds/arrow_hit2.wav"/>
<sound-file path="sounds/arrow_hit3.wav"/>
<sound-file path="sounds/arrow_hit4.wav"/>
<sound-file path="sounds/arrow_hit5.wav"/>
</sound>
</projectile>
<splash value="true">
<radius value="3"/>
<damage-all value="true"/>
<particle value="true" path="particle_splash.xml"/>
</splash>
<effects>
<effect name="icy_chill"
bias="detrimental"
stacking="stack"
target="any"
chance="100.0"
duration="8">
<static-modifiers>
<attack-speed value="-25"/>
<movement-speed value="-70"/>
</static-modifiers>
<multipliers>
<sight value="0.0"/>
<movement-speed value="0.2"/>
</multipliers>
<light enabled="true" red="0.8" green="0.1" blue="0.1"/>
<flags>
<apply-splash-strength/>
</flags>
</effect>
</effects>
</skill>

me5

  • Guest
Re: Glest tower defense
« Reply #140 on: 14 January 2010, 08:08:27 »
Made it ;D

so if you want to use a slowdown effect this code worked for me:

Code: [Select]
<effect name="icy_chill"
bias="detrimental"
stacking="stack"
target="all"
chance="100.0"
duration="8">

<static-modifiers>
<move-speed value="-30"/>
</static-modifiers>

<multipliers>
<sight value="0.0"/>
</multipliers>

<flags/>
<fields-added/>
<fields-removed/>
<light enabled="false"/>
<sound enabled="false"/>
<particle value="false"/>
<recourse-effects/>
</effect>

In the wiki there is a "<apply-splash-strength/>" flag but I can't make it work for me!  :-\
But it seems to work without this flag

if you don't know where to put the effect here is the whole attacktag

Code: [Select]
<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="30"/>
<anim-speed value="30"/>
<animation path="models/frosttower.g3d"/>
<sound enabled="true" start-time="0">
<sound-file path="sounds/defense_tower_attack1.wav"/>
<sound-file path="sounds/defense_tower_attack2.wav"/>

</sound>
<attack-strenght value="2"/>
<attack-var value="50"/>
<attack-range value="17"/>
<attack-type value="piercing"/>
<attack-start-time value="0"/>
<attack-fields>
<field value="land"/>
<field value="air"/>
</attack-fields>
<projectile value="true">
<particle value="true" path="particle_proj.xml"/>
<sound enabled="true">
<sound-file path="sounds/arrow_hit1.wav"/>
<sound-file path="sounds/arrow_hit2.wav"/>
<sound-file path="sounds/arrow_hit3.wav"/>
<sound-file path="sounds/arrow_hit4.wav"/>
<sound-file path="sounds/arrow_hit5.wav"/>
</sound>
</projectile>
<splash value="true">
<radius value="3"/>
<damage-all value="true"/>
<particle value="true" path="particle_splash.xml"/>
</splash>
<effects>
<effect name="icy_chill"
bias="detrimental"
stacking="stack"
target="all"
chance="100.0"
duration="8">

<static-modifiers>
<move-speed value="-30"/>
</static-modifiers>
<multipliers>

<sight value="0.0"/>
</multipliers>

<flags/>
<fields-added/>
<fields-removed/>
<light enabled="false"/>
<sound enabled="false"/>
<particle value="false"/>
<recourse-effects/>
</effect>
</effects>
</skill>

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #141 on: 12 February 2010, 02:15:08 »
Wow, I have been a bit slack checking the forum of recent.. but not much was happening, and I didn't think I'd missed anything.... where would I be without Hailstone's community development monthly.

In the wiki there is a "<apply-splash-strength/>" flag but I can't make it work for me!  :-\
But it seems to work without this flag

Ok, thanks... I've been meaning to go through and figure out what effects work and which don't, but have been kept very busy with other things, did this refuse to load? or load but have no effect in game?
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #142 on: 13 February 2010, 18:11:26 »
It loads but seems to kind of turning off the slowdown effect. I also tried to change the radius to 10 but it still doesn't work. The bad guys are hit/damaged by the effect and I can see the splasheffect but they move at the same speed as before they were hit.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #143 on: 14 February 2010, 09:13:58 »
Thanks for the info, I'll create a ticket to make sure it gets looked into at some stage, but it probably wont be looked at until after 0.2.13 is out, sorry.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #144 on: 17 February 2010, 14:58:52 »
Quote
.., but it probably wont be looked at until after 0.2.13 is out, sorry.
Never mind! The most important thing I would like to see to be fixed is the "units get stucked" issue but it seems like this one is alreydy fixed, is it? (No longer a problem with HAA*)

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Glest tower defense
« Reply #145 on: 18 February 2010, 07:58:51 »
Quote
.., but it probably wont be looked at until after 0.2.13 is out, sorry.
Never mind! The most important thing I would like to see to be fixed is the "units get stucked" issue but it seems like this one is alreydy fixed, is it? (No longer a problem with HAA*)

It damn well better be!   :-\

Yes, I think I finally got the whole pathfinder thing sorted out.  I may have to make some small fixes yet, but I wont be spending much more time on the "time-thief".
Glest Advanced Engine - Code Monkey

Timeline | Downloads

me5

  • Guest
Re: Glest tower defense
« Reply #146 on: 30 July 2010, 08:56:35 »
Look at the first post.  ;)

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Glest tower defense
« Reply #147 on: 30 July 2010, 10:40:30 »
Nice update  :thumbup:

Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Glest tower defense
« Reply #148 on: 30 July 2010, 18:56:52 »
Cool, nice update. Now I can re-try...  :thumbup:

me5

  • Guest
Re: Glest tower defense
« Reply #149 on: 4 August 2010, 09:43:26 »
Have someone reached the last wave (without cheating :P ) ?

 

anything