26
Feature requests / [done] Teleporting with Lua
« on: 9 April 2012, 17:47:47 »
I's like a function like setUnitPosition(unitID,pos) to teleport a unit from one Position to another, without the move-command.
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.
<?xml version="1.0" standalone="no" ?>
<unit>
<!-- *** parameters *** -->
<parameters>
<size value="1" />
<height value="0" />
<max-hp value="49" regeneration="-1"/>
<max-ep value="0"/>
<armor value="0" />
<armor-type value="runes"/>
<sight value="0" />
<time value="1" />
<multi-selection value="false" />
<cellmap value="true" allowEmpty="true" >
<row value="0"/>
</cellmap>
<levels/>
<fields>
<field value="land" />
</fields>
<properties>
</properties>
<light enabled="false" />
<unit-requirements/>
<upgrade-requirements />
<resource-requirements>
<resource name="gold" amount="0"/>
</resource-requirements>
<resources-stored />
<image path="images/gold.bmp"/>
<image-cancel path="images/tech_stop.bmp"/>
<meeting-point value="false"/>
<selection-sounds enabled="false"/>
<command-sounds enabled="false"/>
</parameters>
<!-- *** skills *** -->
<skills>
<skill>
<type value="stop" />
<name value="stop_skill"/>
<ep-cost value="0" />
<speed value="300" />
<anim-speed value="10" />
<animation path="models/iceaura.g3d" />
<sound enabled="false" />
<attack-boost name="fireeffect">
<allow-multiple-boosts value="false" />
<radius value="3"/>
<target value="foe"/>
<max-hp value="0" regeneration="-15"/>
<max-ep value="0" regeneration="0"/>
<sight value="0"/>
<attack-strenght value="0"/>
<attack-range value="0"/>
<armor value="0"/>
<move-speed value="0"/>
<production-speed value="0"/>
<particles value="true">
<affected-particle-file path="fire_particles.xml"/>
</particles>
</attack-boost>
<particles value="false">
<particle-file path="glow_particles.xml"/>
</particles>
</skill>
<skill>
<type value="be_built" />
<name value="be_built_skill" />
<ep-cost value="0" />
<speed value="300" />
<anim-speed value="300" />
<animation path="models/iceaura.g3d" />
<sound enabled="false">
</sound>
</skill>
<skill>
<type value="die" />
<name value="die_skill"/>
<ep-cost value="0" />
<speed value="300" />
<anim-speed value="300" />
<animation path="models/none.g3d" />
<sound enabled="false"/>
<fade value="false"/>
</skill>
<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="50"/>
<anim-speed value="50"/>
<animation path="models/none.g3d"/>
<sound enabled="false" start-time="0.5" />
<attack-strenght value="50"/>
<attack-var value="0"/>
<attack-range value="1"/>
<attack-type value="fire"/>
<attack-start-time value="0.5"/>
<attack-fields>
<field value="land"/>
<field value="air"/>
</attack-fields>
<projectile value="false" />
<splash value="false"/>
</skill>
</skills>
<!-- *** commands *** -->
<commands>
<command>
<type value="attack_stopped"/>
<name value="attack_on"/>
<image path="images/tech_stop.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<attack-skill value="attack_skill"/>
<stop-skill value="stop_skill"/>
</command>
</commands>
</unit>
In non network games the game is paused automatically if a menu/message is raised. I am not sure if I should do this for scenario messages too?
megaglest_g3dviewer --load-unit=scenarios\0_battleglest\battleglest\factions\%%i\units\%%i,stop_skill,attack_skill --load-model-animation-value=0.5 --load-particle-loop-value=8 --zoom-value=1.22 --rotate-x-value=-39 --rotate-y-value=21 --auto-screenshot=disable_grid,saveas-scenarios/0_battleglest/grafiks/avatars/%n%.png
YES
NO
YES
NO[img]http://www.muwum-lexicons.de/ds4/titel.php?t=BattleGlest%20v.%200003%20-%20008[/img][url=http://www.muwum-lexicons.de/bg/fotos/heros/arbol_alma.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/arbol_alma.jpg[/img][/url] [url=http://www.muwum-lexicons.de/bg/fotos/heros/bai_zaa.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/bai_zaa.jpg[/img][/url] [url=http://www.muwum-lexicons.de/bg/fotos/heros/golden_knight.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/golden_knight.jpg[/img][/url] [url=http://www.muwum-lexicons.de/bg/fotos/heros/met_the_beekeeper.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/met_the_beekeeper.jpg[/img][/url] [url=http://www.muwum-lexicons.de/bg/fotos/heros/saurian.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/saurian.jpg[/img][/url] [url=http://www.muwum-lexicons.de/bg/fotos/heros/xatum.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/xatum.jpg[/img][/url] [url=http://www.muwum-lexicons.de/bg/fotos/heros/shadow_monk.jpg][img]http://www.muwum-lexicons.de/bg/fotos/heros/small/shadow_monk.jpg[/img][/url][img]http://www.muwum-lexicons.de/bg/icons/icons.png[/img]
void MainWindow::onClose(wxCloseEvent &event) {
delete this;
}void MainWindow::onClose(wxCloseEvent &event) {
//Code by MuwuM
if ( MessageBox(NULL,"Do you Want to save?" ,"Closing...", MB_YESNO)==IDYES) {
wxCommandEvent ev;
MainWindow::onMenuFileSave(ev);
}
//End Code by MuwuM
delete this;
}
void Unit::tick() {
if(isAlive()) {
if(type == NULL) {
char szBuf[4096]="";
sprintf(szBuf,"In [%s::%s Line: %d] ERROR: type == NULL, Unit = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->toString().c_str());
throw runtime_error(szBuf);
}
//regenerate hp
hp+= type->getHpRegeneration();
if(hp>type->getTotalMaxHp(&totalUpgrade)){
hp= type->getTotalMaxHp(&totalUpgrade);
}
//stop DamageParticles
if(hp>type->getTotalMaxHp(&totalUpgrade)/2 ){
stopDamageParticles();
}
//regenerate ep
ep+= type->getEpRegeneration();
if(ep>type->getTotalMaxEp(&totalUpgrade)){
ep= type->getTotalMaxEp(&totalUpgrade);
}
}
}to:void Unit::tick() {
if(isAlive()) {
if(type == NULL) {
char szBuf[4096]="";
sprintf(szBuf,"In [%s::%s Line: %d] ERROR: type == NULL, Unit = [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->toString().c_str());
throw runtime_error(szBuf);
}
//regenerate hp
hp+= type->getHpRegeneration();
if(hp>type->getTotalMaxHp(&totalUpgrade)){
hp= type->getTotalMaxHp(&totalUpgrade);
//kill when life below 0
if(hp <= 0){
alive = false;
kill();
}
}
//stop DamageParticles
if(hp>type->getTotalMaxHp(&totalUpgrade)/2 ){
stopDamageParticles();
}
//regenerate ep
ep+= type->getEpRegeneration();
if(ep>type->getTotalMaxEp(&totalUpgrade)){
ep= type->getTotalMaxEp(&totalUpgrade);
}
}
}