How to specify a unit in debug

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
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

How to specify a unit in debug

Post by Helmet »

I've been using debug mode. I can inspect variables, advance to the next scenario, etc. But I don't know how to change the value of variables related to any specific unit.

For example, the "help" text says :unit hitpoints=amount. How do I specify the unit? Evidently it's not the unit selected on the map. And the unit's id doesn't work.

Thanks.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Straff
Posts: 85
Joined: September 27th, 2020, 2:53 pm

Re: How to specify a unit in debug

Post by Straff »

It should be the selected unit.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: How to specify a unit in debug

Post by Helmet »

Straff wrote: October 23rd, 2020, 1:58 pm It should be the selected unit.
Thanks. I tried it again. I selected my leader, entered debug mode and typed hitpoints=100.

It didn't work. I got an error messge: "Unknown command hitpoints=100."

What am I doing wrong?
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Pentarctagon
Project Manager
Posts: 5526
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to specify a unit in debug

Post by Pentarctagon »

The full command is :unit hitpoints=100.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: How to specify a unit in debug

Post by Helmet »

Thank you! That was the problem. I thought "unit" meant something else, not literally the word "unit." Clearly I need to be more literal-minded.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: How to specify a unit in debug

Post by Celtic_Minstrel »

As far as I know, these commands apply not to the selected unit but to the unit that's currently under the mouse. These are different things - the selected unit is the one you've clicked on, but you can still then move the mouse over a different unit and set its hitpoints, I believe.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply