Closed LemonDew closed 7 years ago
the pokemon does have an id. from your example data
id : {
high : 1555942776,
low : 1686710777,
unsigned : true
}
just use something like: (based on assumptions have not tested)
ReleasePokemon(pokemonToRelease.id,function(err,response){
//whatever you want to do here
});
function getPokemonAttribute(pokemon, attribute) {
return pokemon.inventory_item_data.pokemon[attribute];
}
a.ReleasePokemon( getPokemonAttribute( pokeObject, "id"), (err, dat) => {});
Doing something like this should do it for you. If you still have issues, take a look at #194
Unfortunately, this is not working.
I'm sending
{"low":141963903,"high":-892688286,"unsigned":true}
or
{low:141963903,high:-892688286,unsigned:true}
to
self.ReleasePokemon = function (pokemon, callback) { console.log("ReleasePokemon: " + pokemon.toString()); var releasePokemon = new RequestEnvelop.ReleasePokemonMessage({ 'pokemon_id': pokemon.toString() });
but it fails there with the message
Illegal value for [object Object] of type fixed64: string (interior hyphen)
I've tried it with: `self.TransferPokemon = function (pokemonId, callback) { var _self$playerInfo3 = self.playerInfo; var apiEndpoint = _self$playerInfo3.apiEndpoint; var accessToken = _self$playerInfo3.accessToken;
var transferPokemon = new RequestEnvelop.TransferPokemonMessage({
'PokemonId': pokemonId
});`
but with the same response.
Any suggestions here?
Ah yes. This is a bug in the code. The suggested fix is outlined #194.
Thanks, it worked. id needs to be json parsed for API.
Hi,
I'm wondering how to use the transfer API call.
I've got the pokemon from the bag via the "GetInventory" call. This returns a list of pokemon, like:
additional_cp_multiplier : null battles_attacked : null battles_defended : null captured_cell_id : Object cp : 12 cp_multiplier : 0.09399999678134918 creation_time_ms : Object deployed_fort_id : null egg_incubator_id : null egg_km_walked_start : null egg_km_walked_target : null favorite : null from_fort : null height_m : 0.7560690641403198 id : Object high : 1555942776 low : 1686710777 unsigned : true __proto__ : Object individual_attack : 10 individual_defense : 10 individual_stamina : 10 is_egg : null move_1 : 220 move_2 : 24 nickname : null num_upgrades : null origin : null owner_name : null pokeball : null pokemon_id : 4 stamina : 10 stamina_max : 10 weight_kg : 14.30856990814209 __proto__ : Object 1 : Object additional_cp_multiplier : null battles_attacked : null battles_defended : null captured_cell_id : Object high : 1202819328 low : 0 unsigned : true __proto__ : Object cp : 15 cp_multiplier : 0.16639786958694458 creation_time_ms : Object high : 342 low : 1904614509 unsigned : true __proto__ : Object deployed_fort_id : null egg_incubator_id : null egg_km_walked_start : null egg_km_walked_target : null favorite : null from_fort : null height_m : 0.21971619129180908 id : Object high : 1018247722 low : -590436383 unsigned : true __proto__ : Object individual_attack : null individual_defense : 9 individual_stamina : 15 is_egg : null move_1 : 221 move_2 : 133 nickname : null num_upgrades : null origin : null owner_name : null pokeball : 1 pokemon_id : 10 stamina : 17 stamina_max : 17 weight_kg : 1.2500449419021606
I assume I need to call the "ReleasePokemon" method: ` self.ReleasePokemon = function (pokemon, callback) { console.log(pokemon.toString()); var releasePokemon = new RequestEnvelop.ReleasePokemonMessage({ 'pokemon_id': pokemon.toString() }); var req = new RequestEnvelop.Requests(112, releasePokemon.encode().toBuffer());
But how do I pass "pokemon" there? It want's to send an 'pokemon_id' in the request envelop, sending the complete pokemon with all field does not make sense. Further, I don't see a unique pokemon-id in the entry of the inventory, which I would assume (see mapPokemon, each pokemon has a unique SpawnPointId).