Information on the IF, OTHERWISE, IF (Message Choice) and END IF commands

#1
First off, remember that every 'IF' command has to be ended by an 'END IF' command. An 'IF' command lets you make a condition that must be fulfilled in order to carry out the commands listed in between the 'IF' and its 'END IF'. In the following example, the message and the enemy will only be enacted if Counter00 (named 'PayerHasMoonlightSword' in this example) is set to '1'.:

IF ('Counter00-PayerHasMoonlightSword' =1)
‎  Display Message (Enemy says 'Nice sword. I'll take it off your dead corpse!'
‎  Activate Enemy ('Final Boss')
END IF
------------------------------------------


An 'OTHERWISE' command goes in between an 'IF' and its 'END IF'. The commands listed between the 'OTHERWISE' and 'END IF' will only be enacted if the condition on the 'IF' is NOT met. In the following example, the 'too bad' message will only display if Counter00 does NOT equal '1':

IF ('Counter00-PayerHasMoonlightSword' =1)
‎  Display Message (Enemy says 'Nice sword. I'll take it off your dead corpse!'
‎  Activate Enemy (activate 'Final Boss')
OTHERWISE
‎  Display Message (Enemy says 'Too bad you don't have a better weapon. I don't fight weaklings.'
END IF
-----------------------------------------


An 'IF (Message Choice)' is pretty much the same but it gives the player two on-screen choices. If the first response is chosen, the commands after ?IF (Message Choice)? will happen. If the player makes the second choice, the commands after OTHERWISE will be carried out instead.

IF (Message Choice):('Do you want to set sail?' Choice1='Yes' Choice2='No')
‎  ‎ Warp Player (to ship)
OTHERWISE
‎  ‎ Display Message ('Ok, let me know when you're ready to leave.') ‎ 
END IF
------------------------------------------


You can also embed an 'IF' command inside another 'IF'. In the following example, if the player answers 'yes', it will trigger the second 'IF' ‎  which will only let him sail if 'Counter01-PlayerStength' is greater than 50.

IF (Message Choice)-('Do you want to set sail?' Choice1='Yes' Choice2='No')
‎  ‎  ‎ IF ('Counter01-PlayerStength' > 50)
‎  ‎  ‎  ‎ Warp Player (to ship)
‎  ‎  OTHERWISE
‎  ‎  ‎  ‎ Display Message ('No, You're not strong enough yet. Come back later')
‎  ‎  ‎ END IF
OTHERWISE
‎  ‎ Display Message ('Ok, let me know when you're ready to leave.') ‎ 
END IF
-----------------------------

IF anyone finds this confusing or has more questions, feel free to post. OTHERWISE don't post. . . (ha ha ha! I slay me Tongue )
Reply

#2
Thank you John so much:) exellent explanation:) got it , makes sence :) ya see Todd's tutorial section isn;t complete and the sections that would cover that stuff well ........ aren't there. but I am glad YOU are:) now that Dark Destiny is near press, I hope he gets a few moments to finish the tutorial, not for my sake anymore, but for other newbies. So that kind fellows like yourself won't have to type directions at 4:15 in the morning:)
thanks again John:)
Reply

#3
Hello, I have a problem I have been trying to solve myself but I am sooooo stuck now I can't get around it nor do I want to.....I can edit map Pieces with skill now, and npcs and objects with an mdo extension..... But the objects with MDL, I can not yet modify. ‎  I can do NPCs with MDL using the "tim viewer" Method.... but I get errors using the "tim" method to embed my new textures on objects.......What am I doing wrong? Crying for example I am trying to take "bridge stone 2.mdl and alter it texture... I saved the new texture using the tim method and when I over wrote the texture from 256 color to 24 bit, I then converted to 16 bit just to be safe like I did with my NPC textures. but when I try to reinsert it back to the mdl I get two errors (1) it ask for x and y corodanates not found in the bmp (yet I am using the same measurment bmp. I do not alter the file I just resaved it as 24 bit from 256 color, then I paste my new texture over the old one and resave) ‎  Anyway I ‎  just default to 1. I guess or thats what I have been doing. Then the second error is the new file is somethin like 192,000 bits larger than the origanal , do you wish to keep inserting ?( you have to say yes or it stops the process) it says the process is complete and everything seems like it should work right? well my end result is a milky white textureLESS object very sad:( so what the smurf am I doing wrong? thanks folks happy holidays


Attached Files
.jpg   Evil Ugly3.JPG (Size: 39.63 KB / Downloads: 325)
Reply

#4
Im surprised that model is in mdl format.
- Todd DuFore (DMPDesign)
Site Founder
Reply

#5
I definitely intend to finish up the tutorials...I suppose this sort of scenario would go under the 'advanced events' section.

I have an event in DD that uses 176 IF's in it ‎  Biggrin
- Todd DuFore (DMPDesign)
Site Founder
Reply





Users browsing this thread:
4 Guest(s)