Nenquel Posted November 22, 2010 Share Posted November 22, 2010 Hey there, the problem is: I want to create a robot that work a little similar to rhonda from black mountain.- It's broken at first- When "looted/activated" a message says: "it's broken, wanna repair?"- When repaired the robots supposed to stand up (its lying broken on the floor yet) and start a conversation. I've been trying to understand the rhondaScript for days now, but I simply dont get it.I got the robot with 0 health in the world dropped on the floor. When activated I can loot it, but I want to have the "wanna repair?" message instead.. PLEASE help me! Kudos waiting! Link to comment Share on other sites More sharing options...
JohannesGunn Posted November 22, 2010 Share Posted November 22, 2010 I got the robot with 0 health in the world dropped on the floor. When activated I can loot it, but I want to have the "wanna repair?" message instead.. Have you tried setting it to one hp, and seeing if you could repair it then? Maybe it's spawning already dead... Link to comment Share on other sites More sharing options...
Dandys Posted November 22, 2010 Share Posted November 22, 2010 (edited) You need to have the robot have a script with an onactivate block that tells it to display a message. Here's an example ( a rough one ) Don't set the robot's health to 0, make it something like 100 ----- short repairedstateshort buttonshort screennumber begin onload if repairedstate == 0killendif end begin onactivate if RepairedState == 0 if player.getav Science >= 60 ;science requirement ShowMessage BMRhondaBrokenMsg ;make your own message else ShowMessage BMRhondaBrokenNoSkillMsg ;make your own failure message (<60 science) endif else;nothingendif end begin GameMode Set Button to GetButtonPressed if Button == 0 if ScreenNumber == 1 resurrect 0 ;resurrects it;after this you add what you want it to do when it comes back to life, I'd either do...;addscriptpackage "your dialogue package" (advanced);or;startconversation player "your new topic (optional, if not put in it just says GREETING)" (simpler) set RepairedState to 1 endif set ScreenNumber to 0 elseif Button == 1 set ScreenNumber to 1 ShowMessage BMRhondaFixMsg ;make your own message endif end ---- not sure if it works, I just made it up from the Rhonda script Dandys Edited November 22, 2010 by Dandys Link to comment Share on other sites More sharing options...
Interfer0 Posted November 22, 2010 Share Posted November 22, 2010 (edited) You need to use OnActive. Here is a rundown of the script re written a bit to take out the stuff you won't need. The Rhonda script I believe is copied over from something else. There are variables declared and not used, some of the coding is done different from how I would do it. ******Declares the variables we will be using. int RepairedState ; 0 = Not repaired, 1 = Repaired int Button int ScreenNumber ; 0 = Default screen ; 1 = Examine screen ; 2 = Repair Examine ; 3 = Science Examine ---------------------------------------------------------------------------- ******Runs this when player clicks on Robot begin onActivate **********Checks whether the Robot is repaired. if RepairedState == 0 **********If Checks the players science skill if player.getav Science >= 60 *********Shows this message If you can repair with science skill ShowMessage RobotBrokenMsg *******or else *************Shows this message if you don't have the skill ShowMessage RobotBrokenNoSkillMsg ******no more elses in repair skill check endif *******If Robot has already been repaired else *******Check to see if Robot has been killed after being repaired if GetDead ******I think this moves on to the inventory/loot screen Activate ****Or else ********Starts the conversation/dialog called RobotGreeting. StartConversation player RobotGreeting ******No more elses in the dead check endif **********No more elses in the is repaired check endif ***********ends the on active end ----------------------------------------------------------------------- ******This begins running after the you leave which ever msg you received before. begin GameMode ****Sets the Button Variable to the option you presses in the message. Set Button to GetButtonPressed *******Checks to see if a button was pressed. Will also run if first selection is msg is picked. if Button == 0 ; Normally, do nothing *****Checks to see if the Robot has been fixed. if ScreenNumber == 1 ; If player fixed robot, make it happen ******Resurrects the robots, renames it, moves it to a marker you set up, and gives it 500HP RobotREF.resurrect 0 RobotREF.SetActorFullName BMRhondaNameMsg RobotREF.MoveTo RobotResMarker RobotREF.setav Health 500 ************Sets your robot variable to a repaired state, so you no longer get the fix messages above set RobotREF.RepairedState to 1 *******ends the screennumber 1 check endif *********Sets screen back to 0 so that it isn't constantly reviving the robot/crashing your game set ScreenNumber to 0 *********Checks to see if you had clicked the second button in the last message elseif Button == 1 ; Fix Robot button ************Sets screen number above so that the game goes to button 0 pressed, and Robot will resurect set ScreenNumber to 1 ***********Shows a message that the Robot was fixed by your awesomness ShowMessage RobotFixMsg *****Ends checking for button presses endif ********Ends your OnGamemode command end Edited November 22, 2010 by Interfer0 Link to comment Share on other sites More sharing options...
Nenquel Posted November 23, 2010 Author Share Posted November 23, 2010 Thank your for your quick replys! I have been looking at this script for days now as well.Could anyone tell me whatint Buttonint ScreenNumberand GetButtonPressedare?I understand most of this rhonda script (Kudos, Interfer0 for commenting it!), but I don't know how and where the player is able to alter Button or ScreenNumber. Link to comment Share on other sites More sharing options...
Nenquel Posted November 24, 2010 Author Share Posted November 24, 2010 Could anyone tell me whatint Buttonint ScreenNumberand GetButtonPressedare?I understand most of this rhonda script, but I don't know how and where the player is able to alter Button or ScreenNumber. Sorry, BUMP. Link to comment Share on other sites More sharing options...
Interfer0 Posted November 24, 2010 Share Posted November 24, 2010 In the second part of the script the one that has Begin Gamemode. Any script that has Begin Gamemode causes the script to run whenever a menu, message, dialogue, or window is closed. So When the first part of the script runs, it pops up the message box. So when you select the option by pressing one of the buttons it exits the first script. This causes the game world to come up, and Gamemode begins. It will immediately check which button was pressed. If the first button was selected the GetButtonPressed will return 0 this option is something like don't fix robot. If the second button is pressed the GetButtonPressed will return 1. The Script sets the Button variable to be equal to GetButtonPressed. So in the question on whether you want to fix Robot or not you can either have a 0 or a 1, because your player only has two options to choose from. So when the Player want to fix the robot they will select option 1, which is actually option two on your list. When the player selects the option the window closes and runs gamemode. The Variable Button is set to 1, and is causes the variable ScreenNumber to be set to 1, and shows a message. You close this message, and the Gamemode begins again. This time GetButtonPressed is equal to 0 because there was only 1 option in the second message. Button now = 0 so the first part of the script runs. Since ScreenNumber is 1, the Robotref is resurected and placed at your marker. Then the ScreenNumber is set back to 0. GameMode is still running, and your gamemode script is still running but now GetButtonPressed and ScreenNumber are both set to 0, so it just keeps running with nothing changing the ScreenNumber variable any longer. Link to comment Share on other sites More sharing options...
Nenquel Posted November 25, 2010 Author Share Posted November 25, 2010 Wow, that was a far more detailed answer than I had expected!Thank you a lot! Link to comment Share on other sites More sharing options...
Recommended Posts