it should have been quickly done. Almost trivial. Edit "DHud.cpp", revive calls to the MuadDebug
class, change the GOB number so that it tracks the scorpeye rather than Bilou, and make it rewind time
- when the shell's horizontal speed turns to zero
- after it has been thrown (there's a flag telling us that)
- after it has been picked up (need a new flag for that).
Except that however I tried to do it, and regardless of the amount of instruction-by-instruction stepping I made, I couldn't get the second condition to trigger. The optimizer did a great job at packing the expression evaluation code -- I mean there, that you can't tell anymore where you're in the source while doing it, and thus mostly can't set a breakpoint on a specific instruction.
Hopefully, there's the B
opcode (not D
, which is for Detach) to break at the script expression level. That one at least allowed me to realise that the expression for that second condition was indeed evaluated. But for some reason, the part I was interested in, with flag-setting, never got executed. A 'all done, bye' opcode always showed first. Mysterious...
Faire des essais dans le jeu pour essayer de reproduire un 'trick' pas fréquent, et avoir programmé un critère d'arrêt qui nous permet de passer en débugging pas-à-pas mais en revenant une image en arrière dans le temps, donc en revivant exactement l'évènement qui fait que tout est parti de travers en bullet-time pour pouvoir le comprendre et savoir ce qui doit être corrigé. J'appelle ça le muad-debugging, et c'est vachement pratique.
Enfin, surtout quand ça marche.
siscanf(base+cont,"[%64[^]]] (%64[^)])",predicate, axion)
predicate
' and 'axion
' arrays are static-sized. I know there's another way you could do the 'same' thing, but with any-sized arrays. That'd be something like
siscanf(base+cont,"[%m[^]]] (%m[^)])",predicate, axion)
siscanf
function will allocate some memory by itself and you'll have to invoke free(predicate)
when you're done with it. It is sure the way to go in most of your production code, but to be honest, I do not want this within GEDS script parsing code. Parsing a level already takes too much time. Adding dynamic memory for strings processing will only make things worse. Not to mention that it will fragment memory with temporary strings requested while we're making big blocks for the 'tank'.
%n Nothing is expected; instead, the number of characters consumed thus far from the input is stored through the next pointer, which must be a pointer to int. This is not a conversion and does not increase the count returned by the function
%*s
scans a 'string', but does not store it, I should be able to write
siscanf(base+cont, "[%n%*[^]]%n] (%n%*[^)]%n)", &predistart, &prediend, &axstart, &axend);
\0
No comments:
Post a Comment