CaioVictor Posted August 27, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Share Posted August 27, 2013 (edited) Hi rAthena ^^' First excuse my English. I have a problem in the PHP code below: $this->header = unpack('a2header/cversion/x/SmovementCount', fread($act, 10)); $this->movements = array(); for ($nMovement = 0; $nMovement < $this->header['movementCount']; $nMovement++) { $movementHeader = unpack('LframeCount', fread($act, 4)); $this->movements[] = new ActionMovement($movementHeader); for ($nFrame = 0; $nFrame < $movementHeader['frameCount']; $nFrame++) { fseek( $act, 20, SEEK_CUR ); $frameHeader = unpack('LlayerCount', fread($act, 4)); $this ->getMovement($nMovement) ->addFrame(new ActionFrame($frameHeader, $this->getSprite())); for ($nLayer = 0; $nLayer < $frameHeader['layerCount']; $nLayer++) { $layerHeader = unpack('lxOffset/lyOffset/LsprFrame/Lmirror/Cred/Cgreen/Cblue/Calpha', fread($act, 14)); if($this->header['version'] >= 2){ $layerHeader += unpack('fxScale', fread($act, 4)); }else{ $layerHeader['xScale'] = 0; } if($this->header['version'] >= 4){ $layerHeader += unpack('fyScale', fread($act, 4)); }else{ $layerHeader['yScale'] = $layerHeader['xScale']; } $layerHeader += unpack('Lrotation/LsprType', fread($act, 8)); if($this->header['version'] >= 5){ $layerHeader += unpack('LxSize/LySize', fread($act, 8)); } } $frameData = unpack('LsoundFrame', fread($act, 4)); extract(unpack('lnumExtraInfo', fread($act, 4))); for( $i=0; $i<$numExtraInfo; ++$i ){ $frameData += unpack('x4/VxExtra/VyExtra/x4', fread($act, 10)); } } } $this->header += unpack('LsoundCount', fread($act, 4)); $this->sound = array(); for ($nSound = 0; $nSound < $this->header['soundCount']; $nSound++) { $this->sound[] = array_pop(unpack('a40', fread($act, 28))); } This code is working perfectly, including wiki Oboro ACT but in the case of Kagerou ACT, returns the following error: Warning: unpack() [<a href='function.unpack'>function.unpack</a>]: Type L: not enough input, need 4, have 0 in ... That is relating the following line: $layerHeader += unpack('Lrotation/LsprType', fread($act, 8)); I know that the code is not the best one, but can anyone help me fix? Any help will be greatly appreciated. Att, CaioVictor. Edited August 27, 2013 by CaioVictor Quote Link to comment Share on other sites More sharing options...
Phantom Of Rogue-Gon Posted August 27, 2013 Group: Members Topic Count: 65 Topics Per Day: 0.02 Content Count: 181 Reputation: 0 Joined: 08/07/13 Last Seen: September 15, 2014 Share Posted August 27, 2013 hello can i join your ro Quote Link to comment Share on other sites More sharing options...
Question
CaioVictor
Hi rAthena ^^'
First excuse my English.
I have a problem in the PHP code below:
This code is working perfectly, including wiki Oboro ACT but in the case of Kagerou ACT, returns the following error:
That is relating the following line:
I know that the code is not the best one, but can anyone help me fix?
Any help will be greatly appreciated.
Att,
CaioVictor.
Edited by CaioVictorLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.