Going crazy help needed !

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
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Going crazy help needed !

Post by Flyro »

So i try to make a terrain become a "Portal" :annoyed:
so that i can place my "Portals" directly in map editor
The terrains are done So now all I've got to do is get the teleport code to work.

Code: Select all

#define TELE_TERRAIN_ON
    [event]
        name=moveto
        first_time_only=no
        [filter_location]
            terrain=^Otaf
        [/filter_location]
        [teleport]
            [filter_location]
                terrain=^Otaf
            [/filter_location]
            terrain=^Otat
        [/teleport]
        [redraw]
        [/redraw]
    [/event]
#enddef
Needless to say, help is needed!
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Going crazy help needed !

Post by Max »

how did you come up with the syntax you've used for [teleport]:
http://wiki.wesnoth.org/DirectActionsWML#.5Bteleport.5D

if you're using 1.9(.5?) you could use [tunnel]:
http://wiki.wesnoth.org/DirectActionsWML#.5Btunnel.5D
User avatar
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Re: Going crazy help needed !

Post by Flyro »

Max wrote:how did you come up with the syntax you've used for [teleport]:
http://wiki.wesnoth.org/DirectActionsWML#.5Bteleport.5D

if you're using 1.9(.5?) you could use [tunnel]:
http://wiki.wesnoth.org/DirectActionsWML#.5Btunnel.5D
Still cant fix it on my own!
I've used teleport before, but I've got tired of writing hexes.
Now I'm trying to make a specific terrain to be the "filter" and another specific terrain to be the "goto"!
Like the Silvermage's "teleport ability" but make it work for all units (not an ability) and make it work with my terrain instead of houses.
Hope its possible!
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Going crazy help needed !

Post by zookeeper »

The wiki tells you exactly how [event] and [teleport] work and your only problem seems to be that you're ignoring that.
User avatar
StDrake
Posts: 996
Joined: July 21st, 2009, 6:50 am

Re: Going crazy help needed !

Post by StDrake »

Teleporting the very way a silver mage does is not possible yet, unless you're using the newest svn version (not sure actually - is [tunnel] already on svn?). I assume that you're using 1.8 or 1.9.4 (or lower) though, so you have to limit yourself to writing hexes for now.
Like cats? I've made a whole faction of them to kick ass with!
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
User avatar
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Re: Going crazy help needed !

Post by Flyro »

KK :(
Thank you anyway guys!

Wait a minute isn't there a way to get a specific terrains cords?
And define them as "teleport cords"
or make them a variable or something like that?
that way i could just type my code like this

Code: Select all

    [event]
        name=moveto
        first_time_only=no
        [filter_location]
            terrain=^Otaf
        [/filter_location]
        [teleport]
            [filter]
                x=$x
                y=$y
            [/filter]
            x=$teleport x
            y=$teleport y
        [/teleport]
        [redraw]
        [/redraw]
    [/event]
seems possible to me:P
I'm running 1.9.4 BTW

--------------------------------------------------------------
Also every terrain has an unique ID couldn't that be used in order to automaticly get the hexes?
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Going crazy help needed !

Post by Max »

again - read the documentation:
http://wiki.wesnoth.org/EventWML

there's no [filter_location] on this level. you could add one inside [filter].

if you're looking for something similar to the silver mage you can have a look at [tunnel]. it's available in 1.9.5 (not announced yet, but windows build can already be downloaded at sourceforge).
User avatar
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Re: Going crazy help needed !

Post by Flyro »

Max wrote:again - read the documentation:
http://wiki.wesnoth.org/EventWML

there's no [filter_location] on this level. you could add one inside [filter].

if you're looking for something similar to the silver mage you can have a look at [tunnel]. it's available in 1.9.5 (not announced yet, but windows build can already be downloaded at sourceforge).
Ive read it still it makes no sense to me -.- Perhaps you could write an example for me ??
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Going crazy help needed !

Post by zookeeper »

I don't even know what you're trying to do exactly. If you use a moveto event then that only makes stuff happen when a unit steps on a particular hex. In your case, you're seemingly trying to make each unit which steps on a ^Otaf hex to be teleported... somewhere. I don't know where. So maybe start by describing exactly what you want to happen.

If you want something like Silver Mage's teleport then your approach is completely wrong and the only way to do it is using the [tunnel] tag as already mentioned.
User avatar
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Re: Going crazy help needed !

Post by Flyro »

zookeeper wrote:I don't even know what you're trying to do exactly. If you use a moveto event then that only makes stuff happen when a unit steps on a particular hex. In your case, you're seemingly trying to make each unit which steps on a ^Otaf hex to be teleported... somewhere. I don't know where. So maybe start by describing exactly what you want to happen.

If you want something like Silver Mage's teleport then your approach is completely wrong and the only way to do it is using the [tunnel] tag as already mentioned.
Ok i got to terrains one sender (^Otaf) and one receiver(^Otat).
What i want to do is making all units that steps on the sender(^Otaf) to be teleported to the receiver (^Otat).
I hope the explanation is understandable. :)

Code: Select all

#define ?????
        [filter]
            [filter_location]
                terrain=^Otaf
            [/filter_location]
        [/filter]
variable=teleportxy
#enddef

    [event]
        name=moveto
        first_time_only=no
        [filter]
            [filter_location]
                terrain=^Otaf
            [/filter_location]
        [/filter]
        [teleport]
            [filter]
                x=$x
                y=$y
            [/filter]
            x,y=$teleportxy
        [/teleport]
        [redraw]
        [/redraw]
    [/event]
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Going crazy help needed !

Post by Max »

you've got different portals. each has it's own terrain. you place exactly two of each in the editor and you'd like to make use of them in your scenarios without specifying the exact location. right?

- use wildcards (http://wiki.wesnoth.org/FilterWML#Filtering_Terrains) for your filter to filter all portal terrain
- use [store_locations] to get the current terrain.
- use store_locations again with the current terrain + [not]x,y (your current position).

this way you get the corresponding portal location.
User avatar
Flyro
Posts: 27
Joined: March 12th, 2011, 9:58 pm

Re: Going crazy help needed !

Post by Flyro »

Max wrote:you've got different portals. each has it's own terrain. you place exactly two of each in the editor and you'd like to make use of them in your scenarios without specifying the exact location. right?

- use wildcards (http://wiki.wesnoth.org/FilterWML#Filtering_Terrains) for your filter to filter all portal terrain
- use [store_locations] to get the current terrain.
- use store_locations again with the current terrain + [not]x,y (your current position).

this way you get the corresponding portal location.
Tank you thats probably the answer i was looking for.

Could you write an example for me?
SOLVED click url below
http://forums.wesnoth.org/viewtopic.php?f=21&t=33470
Post Reply