--- Log opened Sat May 25 00:00:37 2019 20190525 04:38:56-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has quit [Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] 20190525 06:20:12-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20190525 13:43:35-!- celticminstrel [~celmin@unaffiliated/celticminstrel] has joined #wesnoth-umc-dev 20190525 17:26:07-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 268 seconds] 20190525 17:50:44<+wesdiscordbot> @josteph this is what i used [event] name=moveto [filter] side=1 [filter_adjacent] id=Caravan1 [/filter_adjacent] [/filter] [move_unit_fake] x=$x1,$x2 y=$y1,$y2 type=Spearman side=2 [/move_unit_fake] [unit] 20190525 17:50:45<+wesdiscordbot> x,y=$x2,$y2 type=Spearman side=2 id=Shodrano name= _ "Shodrano" [/unit] [/event] 20190525 17:50:57<+wesdiscordbot> but he spawned too far away from the caravan ... 20190525 17:51:00<+wesdiscordbot> how to fix? 20190525 17:51:24<+wesdiscordbot> (just using the name as a place-holder btw) 20190525 17:51:35<+wesdiscordbot> you can use three tic marks for multiple lines, by the way 20190525 17:52:15<+wesdiscordbot> thanks 20190525 17:56:20-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 18:30:35<+wesdiscordbot> @PastaSaucey In moveto x1,y1 don't refer to the Caravan 20190525 18:37:39-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20190525 18:38:32<+wesdiscordbot> so remove [filter_adjacent] id=Caravan1 [/filter_adjacent]? 20190525 18:43:05<+wesdiscordbot> no 20190525 18:43:10<+wesdiscordbot> you just need to get the Caravan's location 20190525 18:43:17<+wesdiscordbot> in moveto x1,y1 refer to the unit's location 20190525 18:43:29<+wesdiscordbot> https://wiki.wesnoth.org/SyntaxWML#Automatically_Stored_Variables 20190525 18:43:55<+wesdiscordbot> https://wiki.wesnoth.org/EventWML#Predefined_Events_With_Filters 20190525 18:44:50<+wesdiscordbot> for example, if you move a spearman to 5,7, then $x1 will be 5 and $y1 will be 7. 20190525 18:46:41<+wesdiscordbot> so i used the wrong tag? 20190525 18:47:07<+wesdiscordbot> you used the right event 20190525 18:47:20<+wesdiscordbot> but $x1,$y1 don't contain the values you need 20190525 18:48:00<+wesdiscordbot> okay, now i'm a bit confused ... 20190525 18:48:01<+wesdiscordbot> XD 20190525 18:48:48<+wesdiscordbot> it's really quite simple 20190525 18:49:04<+wesdiscordbot> your event fires when a Spearman moves, so $x1 is the _Spearman's location, but you need to get the Caravan's location 20190525 18:49:59<+wesdiscordbot> it's like if you borrow a friend's phone to call me, I can't use caller id to call you back 20190525 18:52:17<+wesdiscordbot> you would need to use [store_locations] to get the caravan's x and y coordinates. 20190525 18:52:17<+wesdiscordbot> https://wiki.wesnoth.org/InternalActionsWML#.5Bstore_locations.5D 20190525 18:52:57-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 18:53:45<+wesdiscordbot> where would i need to put that? 20190525 18:57:05<+wesdiscordbot> after the [filter] block. alternatively, you could also manually check each of the six surrounding hexes with [have_unit]. 20190525 18:57:06<+wesdiscordbot> https://wiki.wesnoth.org/ConditionalActionsWML#Condition_Tags 20190525 18:58:48<+wesdiscordbot> do you know of any campaigns that use this? 20190525 18:58:58<+wesdiscordbot> i'll get it better if i have an example to look at 20190525 18:59:16<+wesdiscordbot> so like [if] [have_unit] id=Caravan x="$($x1-1)" y=$y1 [/have unit] [then] # do stuff [/then] [/if] 20190525 18:59:28< Soliton> so using $other_unit doesn't work? 20190525 18:59:49<+wesdiscordbot> and so on 20190525 19:00:13<+wesdiscordbot> Soliton: would that be populated for a moveto event? 20190525 19:01:54<+wesdiscordbot> actually, I think you can just do {UNIT ... $x_of_Caravan $y_of_Caravan} and it'll automatically be placed next to the Caravan 20190525 19:02:05<+wesdiscordbot> you'd need to set those variables yourself first 20190525 19:02:11< Soliton> no idea if the event type is relevant. 20190525 19:02:29<+wesdiscordbot> that's kind of his question though, right? how to get the x and y of the caravan? 20190525 19:03:49< Soliton> i'd check if $other_unit isn't already what you want. otherwise the suggestions for looking for id=Caravan will certainly work. 20190525 19:10:48<+wesdiscordbot> @Pentarctagon Note that "manually check each of the six surrounding hexes" would be a little hairy because the arithmetic to get them depends on whether y is even on odd 20190525 19:11:16<+wesdiscordbot> I linked yesterday a lua API that just gives the right six hexes, if you want to try writing the event in lua 20190525 19:13:43<+wesdiscordbot> the documentation there doesn't even say what values are returned or which attributes they're stored on though. it's not really useful other than saying that the function exists. 20190525 19:14:29<+wesdiscordbot> you'd need to store it in a WML variable then go into :inspect to find that out 20190525 19:18:13<+wesdiscordbot> @PastaSaucey [filter_locations] would look something like this, I believe: 20190525 19:18:17<+wesdiscordbot> [store_locations] variable = caravans x=$x1 y=$y1 radius=1 [filter] side=1 id=Caravan [/filter] [/store_locations] 20190525 19:19:27<+wesdiscordbot> theoretically, that should store the locations of any Caravans adjacent to the hex a unit moved to. 20190525 19:23:40<+wesdiscordbot> the lua version josteph mentioned could also be done like this, to avoid using more lua than necessary: wml.variables["caravans"] = wesnoth.map.get_adjacent_tiles(wml.variables["x1"], wml.variables["y1"]) 20190525 19:23:46<+wesdiscordbot> probably, at least 20190525 19:24:42<+wesdiscordbot> exactly what loc is, isn't given either 20190525 19:27:41<+wesdiscordbot> It's probably either an object {x: 5, y: 5} or two integers as separate arguments get_adjacent_tiles(5,5) 20190525 19:28:56<+wesdiscordbot> that's how locations are usually represented 20190525 19:33:33<+wesdiscordbot> wesnoth.map.get_adjacent_tiles { 10, 10 } 20190525 20:09:00-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20190525 20:09:28-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 20:09:51-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 20:10:19-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 20:10:37-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 20:11:11-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 20:11:25-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 20:11:49-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 20:12:12-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 20:12:46-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 20:13:00-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 20:13:35-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 20:13:47-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 21:15:56-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 22:42:00-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20190525 22:42:28-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 22:42:46-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 22:43:13-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 22:43:34-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 22:44:09-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 22:44:21-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 22:45:05-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20190525 22:45:09-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20190525 23:01:38-!- hk239 [~d@94.22.235.202] has quit [Remote host closed the connection] 20190525 23:07:32<+wesdiscordbot> @Pentarctagon would i need to put the store_locations tag in the moveto event tag? 20190525 23:07:46<+wesdiscordbot> yes 20190525 23:08:30<+wesdiscordbot> hmmm --- Log closed Sun May 26 00:00:38 2019