About: How to Use Randomness to Perform Different Actions   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

You can use randomness to allow for different actions in a given map, such as spawning a guard with a KF7 or an RCP90 instead, or spawning Dr. Doak in a different location each time, etc. You can put these randomness blocks in anything, 04XX or 10XX blocks, but it is recommended generally to put them in 10XX blocks, because if a guard dies, so does his 04XX block with him, and it stops executing. It looks like in C code: The basic gist is the following sequence: … 0210 ;we’re finished checking

AttributesValues
rdfs:label
  • How to Use Randomness to Perform Different Actions
rdfs:comment
  • You can use randomness to allow for different actions in a given map, such as spawning a guard with a KF7 or an RCP90 instead, or spawning Dr. Doak in a different location each time, etc. You can put these randomness blocks in anything, 04XX or 10XX blocks, but it is recommended generally to put them in 10XX blocks, because if a guard dies, so does his 04XX block with him, and it stops executing. It looks like in C code: The basic gist is the following sequence: … 0210 ;we’re finished checking
dcterms:subject
abstract
  • You can use randomness to allow for different actions in a given map, such as spawning a guard with a KF7 or an RCP90 instead, or spawning Dr. Doak in a different location each time, etc. You can put these randomness blocks in anything, 04XX or 10XX blocks, but it is recommended generally to put them in 10XX blocks, because if a guard dies, so does his 04XX block with him, and it stops executing. Lets just do a simple randomness block where it displays different text on the screen depending on the random number. Note that text can ONLY be displayed if the text is currently loaded for the level. You cannot load Runway’s text on Bunkers, or vice-versa. Some text is always loaded such as LTitleE and LMiscE. The main important commands are 33 (seed random byte), and 34, a return value loop function for whether the seeded random byte is < a certain value. Note, you could alternatively use 35, a return value function to check whether random value is > a value, but it’s easier to stick with one or the other. Basically, what is done is a random byte is generated, and then it is checked whether it is below a value. In this example, there are four checks, to see whether it’s below 0x40, 0x80, 0xC0, and then the else clause (above 0xC0). It looks like in C code: if (randomValue < 0x40) { DisplayText(0x9C38); } else if (randomValue < 0x80) { DisplayText(0x9C28); } else if (randomValue < 0xC0) { DisplayText(0x9C33); } else { DisplayText(0x9C07); } //go on now at 0210, in this example we just exit by 05FD0001 Block: 1000 The basic gist is the following sequence: 33 Seed Random Byte (to start the process off) 344001 ; Check if value is < 0x40, if so goto 0201, else continue 0002; If not < 0x40, goto 0202 0201 ;was < 0x40 C39C38 ; display text 0010 ;goto end, we found our match 0202 ; // do next check 348003 ; check if was < 0x80 … 0210 ;we’re finished checking As a final note, remember that the last two checks actually both are endings, because if you check whether it’s < 0xC0, that’s one clause, and if it doesn’t fit there, then it’s above 0xC0 and another ending. In this example, in Runway if done there, it will randomly display one message when you start the level. NOTE: Had you not done the 05FD0001 at the end, it would constantly be showing random text messages forever.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software