changing ellipses in 1.5

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
opensourcejunkie
Posts: 547
Joined: August 11th, 2008, 3:19 pm

changing ellipses in 1.5

Post by opensourcejunkie »

I've been browsing through the 1.5 image files for unit ellipses (the little ovals that represent the unit's team colour, as well as whether or not it has a zoc), and I noticed that the ellipses now consist of multiple image files (e.g. one image for the normal ellipse, and one for the ellipse of a selected unit, etc.). So, I'm now wondering how exactly you go about manually changing the ellipse of a unit.

In 1.4, you would change that unit's "ellipse" property to the new ellipse graphic. However, now that there're multiple ellipses for any given unit, I'm curious how we can set them. Anyone know? The wiki doesn't have it yet.
--OSJ
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: changing ellipses in 1.5

Post by zookeeper »

It guesses. Look at the filenames and the ellipse= values.
opensourcejunkie
Posts: 547
Joined: August 11th, 2008, 3:19 pm

Re: changing ellipses in 1.5

Post by opensourcejunkie »

aah, thanks. I didn't realize they were manually set in each [unit] file.

tx,
--OSJ

Edit: As it turns out, the WML to change ellipses apparently hasn't changed; I was just being an idiot :-]. However, for some reason, my old 1.4 code no longer works. Any ideas on what's wrong?:

Code: Select all

    ##:: Change Zoc Ellipse
    {SOL_STORE_UNIT id={ID} SOL_04_NEWBS_temp}
    {VARIABLE SOL_04_NEWBS_temp.ellipse "misc/ellipse-nozoc"}
    {SOL_UNSTORE_UNIT SOL_04_NEWBS_temp no}
    {CLEAR_VARIABLE SOL_04_NEWBS_temp}
The SOL_STORE/UNSTORE_UNIT macros are just shortcuts; they do what their names imply. Thanks for any help,
--OSJ
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2176
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: changing ellipses in 1.5

Post by Ken_Oh »

Bumping because I'm having the same problem. I want to manually change a no-zoc ellipse into a regular one.

I've noticed that some things we used to be able to alter directly through variables no longer have that option. For example, you used to be able to directly poke a halo into a unit, but not anymore.

Ellipses are like this, but, unlike halos, I haven't been able to change one via object/effect. This code doesn't change the ellipse of the Ruffian.

Code: Select all

[event]
	name=start
	{GENERIC_UNIT 1 "Ruffian" 10 10}
[/event]

[event]
	name=moveto
	[filter]
		side=1
	[/filter]
	[object]
		id=standing_anim
		name="standing_anim"
		silent=yes
		[filter]
			x=$unit.x
			y=$unit.y
		[/filter]
		[effect]
		   apply_to=new_animation
		   [standing_anim]
			  start_time=0
			  [frame]
				 ellipse="misc/ellipse"
				 duration=100
			  [/frame]
		   [/standing_anim]
		[/effect]
	[/object]
[/event]
Is there any way to work this? Or, do I have to make a variation for any unit on which I want to be able to change ellipses?
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: changing ellipses in 1.5

Post by Sapient »

The way direct unit modifications work has changed a lot since 1.4...

If you are using direct unit modification instead of [object] tags, then there needs to specifically be support in the code for direct modification of that attribute you are trying to modify. So if you found something new that needs to support direct modification, then please submit an F.R.

However, the preferred way of permanently modifying units is [object] tags, because that will persist even when the unit levels up. So consider that possibility when making the request.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
opensourcejunkie
Posts: 547
Joined: August 11th, 2008, 3:19 pm

Re: changing ellipses in 1.5

Post by opensourcejunkie »

Out of curiosity, why are [object] tags now the preferred way of permanently modifying units? They seem rather clunky compared to the comparatively more elegant (IMO) solution of store/modify/unstore.
--OSJ
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: changing ellipses in 1.5

Post by Sapient »

It would take a long time to explain fully... but as I wrote "because that will persist even when the unit levels up"
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
opensourcejunkie
Posts: 547
Joined: August 11th, 2008, 3:19 pm

Re: changing ellipses in 1.5

Post by opensourcejunkie »

Sapient wrote:It would take a long time to explain fully... but as I wrote "because that will persist even when the unit levels up"
Okay, so it's more of a technical requirement than a design choice. gotcha.
--OSJ
what if the Bible's claims about Christ depicted accurate, verifiable history? given some research, you might be surprised at the evidence...
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2176
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: changing ellipses in 1.5

Post by Ken_Oh »

Sapient wrote:However, the preferred way of permanently modifying units is [object] tags, because that will persist even when the unit levels up. So consider that possibility when making the request.
I understand why [object] is preferred. It's because it leaves a [modification].

Like usual, I'm mostly concerned about just making it work, asking if ellipses are even able to be modified via [object]. Is this the case? Because, I can't figure out how to do it.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: changing ellipses in 1.5

Post by Boucman »

replying here since lots of people are interested and i'll get more replies than if I reply in the bug report


1) ellipses are not technically part of the animation engine and never were... so changing animations in a [object] won't work and never did AFAIR
2) direct changing of a unit's ellipse= field should work, not through an [object] though. As sapient said, changing something through an [object] needs an explicit change, i'll look into it later

I would be gratefull if someone could quickly test that directly changing a unit's ellipse= field works..


thx

Edit : done, it will be in the nex 1.7 release, the keys are
apply_to=ellipse
ellipse=<new image file>
Fight key loggers: write some perl using vim
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2176
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Re: changing ellipses in 1.5

Post by Ken_Oh »

I just tried to change an ellipse via direct poking of a variable in 1.7.9 and it didn't work.

I'm just grateful that there'll at least be one way to do this. Thanks.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: changing ellipses in 1.5

Post by Sapient »

Boucman wrote: 2) direct changing of a unit's ellipse= field should work...
I would be gratefull if someone could quickly test that directly changing a unit's ellipse= field works..
No, as I wrote: "If you are using direct unit modification instead of [object] tags, then there needs to specifically be support in the code for direct modification of that attribute you are trying to modify." (otherwise it will reload it from the base unit_type each time... see unit::read() for examples)

By the way, I already made halo directly modifiable (an attribute that was mentioned earlier in this thread).
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply