Jump to content

Trying to make Softimage Rock Paper Scissors with my models


Recommended Posts

So simply put, I want to make a simple 'rock paper scissors' two player game that populates models I've made for each part, determine who's won and say so at the end. It's going to require a yes/no box for a player to say if they want to play, the input box, a loop to make sure the user puts in a valid choice fr 'rock, paper or scissors', the statement that populates the model, a bunch of conditional statements to determine the win/loss/tie combinations, and if possible a tally at the end and a replay option. I know basic vbscript so if stuff is posted, I can probably understand it, but I've never been very good at making the scripting myself from scratch. Any help would be appreciated.

Link to post
Share on other sites

So just to clarify, I know the parts that I need. Do loop for replayInput box for player one and two.Conditional statements for names of player choice (Rock, paper, scissor) plus models for each choice.Loop around input boxes for verification of correct input.Conditional statement combinations to determine winner.Variables for storing user input. I'll be trying to put it together, just, like I said, I'm usually better at taking code apart and altering it than building it from scratch.

Link to post
Share on other sites

Alright, decided to just use models for placeholders since you guys can't reference my models. The code I have so far.

'Create a new sceneNewScenedim ui, objname, valid, play1, play1validdoplay1 = MsgBox ("Would you like to play a game?", vbYesNo)if play1 = vbYes thenplay1valid = trueelseplay1valid = falseend ifloop until play1valid = truedoobjname1 = inputbox("Rock, paper or lizard?")if objname1 = "rock" then CreatePrim "Sphere","MeshSurface","UserObject"if objname1 = "paper" then CreatePrim "Grid","MeshSurface","UserObject"if objname1 = "lizard" then GetPresetModel "Lizard", "Lizard" if objname1 = "rock" or objname1 = "paper" or objname1 = "lizard" then valid = true else msgbox "Sorry, that wasn't a valid object type." valid1 = false end ifloop until valid1 = truedim ui2, objname2, valid2, play2, play2validdoplay2 = MsgBox ("Would you like to play a game?", vbYesNo)if play2 = vbYes thenplay2valid = trueelseplay2valid = falseend ifloop until play2valid = truedoobjname2 = inputbox("Rock, paper or lizard?")if objname2 = "rock" then CreatePrim "Sphere","MeshSurface","UserObject"if objname2 = "paper" then CreatePrim "Grid","MeshSurface","UserObject"if objname2 = "lizard" then GetPresetModel "Lizard", "Lizard" if objname2 = "rock" or objname2 = "paper" or objname2 = "lizard" then valid2 = true else msgbox "Sorry, that wasn't a valid object type." valid2 = false end ifloop until valid2 = trueif objname1 = "lizard" and objname2 = "lizard" then MsgBox = "It's a tie!"if objname1 = "rock" and objname2 = "rock" then MsgBox = "It's a tie!"if objname1 = "paper" and objname2 = "paper" then MsgBox = "It's a tie!"if objname1 = "paper" and objname2 = "rock" then MsgBox = "Player 1 wins!"if objname1 = "lizard" and objname2 = "paper" then MsgBox = "Player 1 wins!"if objname1 = "rock" and objname2 = "lizard" then MsgBox = "Player 1 wins!"if objname1 = "paper" and objname2 = "lizard" then MsgBox = "Player 2 wins!"if objname1 = "rock" and objname2 = "paper" then MsgBox = "Player 2 wins!"if objname1 = "lizard" and objname2 = "rock" then MsgBox = "Player 2 wins!"
Currently it just loops on until infinity. =(
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...