Plotting points behind the player that looks like wings. Computer does not know what wing you are thinking.
Yes, and the question is, what is the simplest way to plot them other than hardcoding everything directly with code. I am thinking about this: In the resources folder of your plugin, create a text file like this: Code: X X XX XX XXXXX X Parse the contents of the file into coordinates: PHP: $map = [];$handle = $plugin->getResource("wings.map");$lines = explode("\n", rtrim(stream_get_contents($handle)));fclose($handle);$height = count($lines);foreach($lines as $lineNumber => $line){ $len = strlen($line); for($i = 0; $i < $len; ++$i){ if($line{$i} === "X"){ $map[] = new Vector2($i, $height - $lineNumber - 1); } }} Convert the mapped coordinates into runtime physical coordinates PHP: $scale = 0.2;$particle = new FlameParticle(new Vector3);$yaw = $player->yaw / 180 * M_PI;$xFactor = -sin($yaw) * $scale;$zFactor = cos($yaw) * $scale;foreach($map as $vector){ $particle->y = $vector->y; $particle->x = $xFactor * $vector->x; $particle->z = $zFactor * $vector->x; $player->getLevel()->addParticle($particle);} Of course, cache the value of $map. Don't open-read-close a file every time. Even though the file is inside a phar, it will still create notable lag if you do it every time.
Yep, @thebigsmileXD has coded it very likely like that (but with more particles, the picture shows the plugin of him) BUT IT's N O T OPEN SOURCE!
If you adjust scale enough it should work Particle handling isn't all that hard. FTP handling is f****** hard Spoiler Here is some FTP MADNESS: PHP: public function updateAllFloatingTexts($playerLevelArray = NULL){ $this->hideAllFTPs(); if($playerLevelArray == NULL){ $this->showAllFTPs(); }else{ foreach($this->floatingTextConfig->getAll() as $configFT){ $configFT = $configFT[0]; $this->FloatingTexts[$this->IndexFTC] = new FloatingText($this, $this->getServer()->getLevelByName($configFT[0]), new Vector3($configFT[1], $configFT[2], $configFT[3]), $configFT[4]); if(isset($this->FloatingTexts)){ foreach($this->getServer()->getOnlinePlayers() as $player){ foreach($this->FloatingTexts as $FloatingTextObject){ if(!isset($playerLevelArray[$player->getName()])){ $playerLevel = $player->getLevel()->getName(); }else{ $playerLevel = $playerLevelArray[$player->getName()]; } $FloatingTextLevel = $FloatingTextObject->getLevel()->getName(); //echo("Checking "."PlayerLevel: ".$playerLevel." FTPLevel: ".$FloatingTextLevel." PlayerName: " . $player->getName() . "\n"); if($playerLevel == $FloatingTextLevel){ $FloatingTextObject->update($player); //echo("Re-Created "."PlayerLevel: ".$playerLevel." FTPLevel: ".$FloatingTextLevel." PlayerName: " . $player->getName() . "\n"); } } } } $this->IndexFTC++; } } } public function hideAllFTPs(){ if(isset($this->FloatingTexts)){ foreach($this->FloatingTexts as $FloatingTextObject){ $FloatingTextObject->setInvisible(true); } } unset($this->FloatingTexts); $this->IndexFTC = 0; } public function showAllFTPs(){ foreach($this->floatingTextConfig->getAll() as $configFT){ $configFT = $configFT[0]; $this->FloatingTexts[$this->IndexFTC] = new FloatingText($this, $this->getServer()->getLevelByName($configFT[0]), new Vector3($configFT[1], $configFT[2], $configFT[3]), $configFT[4]); if(isset($this->FloatingTexts)){ foreach($this->getServer()->getOnlinePlayers() as $player){ foreach($this->FloatingTexts as $FloatingTextObject){ $playerLevel = $player->getLevel()->getName(); $FloatingTextLevel = $FloatingTextObject->getLevel()->getName(); //echo("Checking "."PlayerLevel: ".$playerLevel." FTPLevel: ".$FloatingTextLevel." PlayerName: " . $player->getName() . "\n"); if($playerLevel == $FloatingTextLevel){ $FloatingTextObject->update($player); //echo("Re-Created "."PlayerLevel: ".$playerLevel." FTPLevel: ".$FloatingTextLevel." PlayerName: " . $player->getName() . "\n"); } } } } $this->IndexFTC++; } }
Yes. You can even use multiple symbols in your file to represent different particles. You realize that you are talking in front of an open-source terrorist, right?
*terrorists (Including me) [Although not all of my code is open source, but only because it's so bad, I still have much to learn]
Idk. But still. @Tim // robske Büba just posted content stolen from an closed code paid plugin, which is illegal. Yes, that was ORIGINALLY the way i did it. Hooray, mapped arrays. Always a good way. But now i get different particle types etc from the config. Configurable wings. High 5, yml. Sure, have fun with wings spawning INSIDE the player. You generate the particles at the players position. Not cool. You would always have the particles in your face in first person.
What if I want the two sides to be different? Actually if I am making the plugin myself, I would even make the wings 3D, but since this is just an example I don't need to be so serious ;P What? Actually, the code above should create a pair of wings in front of the player, both of them, perpendicular to the one in the image, but that doesn't matter, just swap $factorX and $factorZ Actually the bitmap format I mentioned was supposed to be used in https://github.com/LegendOfMCPE/Vehicles, but it never got finished because I was waiting for the addition of vehicles that time (and you know what's the result). Not really. Not really in the face. The wings aren't that high if you use the height in my code. Also, could you make your tone a bit less hostile maybe you didn't mean it, but it gives me that impression like you're trying to pick a fight.
Thx but $line[$i] I Think Thats better then $line{$i} Why ? Some Peepol he donot know what is $line{$i} I Think $line[$i] is famous That is just Suggestion
It is just my own practice (common practice) that [$i] is used for arrays and {$i} is used for strings (seems @shoghicp is doing this too).