What no one should EVER do!

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
archlich
Posts: 34
Joined: August 11th, 2008, 3:10 pm
Location: Deep in an underground bunker in an undisclosed location

What no one should EVER do!

Post by archlich »

I like to experiment with WML, and I managed to create something that will seriously screw things up:

Code: Select all

#define LOOP
	[gold]
	amount=1
	side=1
	[/gold]
	{LOOP}
#enddef

	[event]
	name=turn 2

	{LOOP}
	[/event]
No one except myself is dumb enough to try this, but anyone that got this idea should know the consequences: when loading the scenario, the computer will use 100% RAM and never get past this point, forcing you to manually restart this.


I also made a less obvious mistake.

I was experimenting with a code that would heal everything that died and store it. If it died because of a unit with a plague attack, the program would crash

Code: Select all

    [event]
        name=die
        first_time_only=no

        [object]
            silent=yes
            [filter]
                x,y=$x1,$y1
            [/filter]
            [effect]
                apply_to=hitpoints
                increase_total=100%
                heal_full=yes
            [/effect]
        [/object]
The first part probably won't help anyone, but anyone that is experimenting with a way to resurrect creatures should add a filter to stop plague attacks.
"The bombing starts in 5 minutes."- Ronald Wilson Reagan
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: What no one should EVER do!

Post by AI »

Or you could change the event to name=last breath, which would trigger it *before* it dies.
User avatar
MaxRip
Posts: 20
Joined: August 19th, 2008, 11:14 pm
Location: The distance of 5 hexes from nowhere

Re: What no one should EVER do!

Post by MaxRip »

Yes I believe that would do it. Another thing to never do. Set a unit's max experience to 0
:oops:
Current Projects:
Biomancy and Necromancy
Experimental Unit types
Expire mental Unit types
Willful Undead
Expanding upon the following races:
Ogres
Bats
Wose
Monsters

In short:too much
User avatar
Zachron
Posts: 416
Joined: July 24th, 2007, 5:12 pm
Location: North Central Texas
Contact:

Re: What no one should EVER do!

Post by Zachron »

AMLA after every attack, roxorz boxorz! :lol2:

[edit] Also one way to handle the event of returning the unit, is to filter out plagued attacks, so that someone lost to zombie plague is still basically screwed, so plague can still work as well.
Project Battlescar: An rpg engine of my own design.
http://battlescar.wikispaces.com/
User avatar
Lizard
Posts: 355
Joined: January 19th, 2008, 8:20 am
Location: Hiding in a swamp (gtm +1; DST)

Re: What no one should EVER do!

Post by Lizard »

archlich wrote:I like to experiment with WML, and I managed to create something that will seriously screw things up:

Code: Select all

#define LOOP
	[gold]
	amount=1
	side=1
	[/gold]
	{LOOP}
#enddef

	[event]
	name=turn 2

	{LOOP}
	[/event]
No one except myself is dumb enough to try this, but anyone that got this idea should know the consequences: when loading the scenario, the computer will use 100% RAM and never get past this point, forcing you to manually restart this.
In some late 1.3 version where a function to prevent this, but it got removed because it detected false positives. (might be still a bugreport on GNA, author unknown, but I wrote Lizard below the report.)
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Post Reply