Jump to content

how to add Betting/gambling with prizes


CommodoreBlitz

Recommended Posts

I am working on a mod that I'd like to add some gambling to, now the results of the event to be bet on is random. So how to setup a way to bet on the event and then have the game figure out the winner of the event and then if the player did bet on the winner how to pay out the winnings....

 

An example.. Say I make a set of tracks with Geckos in it each enclosed in there own track separate from the other, before the race the player would pick the one he wants to bet on then Now the player would have bet on the one he wants to win (perhaps each one is of a different color or type etc ) at a set time Bang they all run down the track and one wins the race, if the winner is the same as the player picked before the race then the player would get a pay of caps, if the player did not pick the winner then he would then lose his bet. Now the only scripting I have done so far is to make a go from point a to b then fight then go to point c and get quest reward, so I have know idea to implement this idea.

 

If you have some idea how to do this I would take any help i can get. I am skilled enough to set everything up except how to get the betting and payout and how to trigger the start of the race..(I have experimented a little I can setup the "race" but it starts as soon as you load the game tho..

 

(I have posted this before without replies)( someone must have some idea how to do this)

 

Perhaps a Race is a bad setting, perhaps a fight between a Gecko and a Scorpion....You place a bet on one and if you win the game adds some caps to your inv if you lose it takes some.

I know how to make a basic script where you get a reward for doing something, but how to have a random event trigger a reward or a take item from your inv I don't know.

Link to comment
Share on other sites

I am working on a mod that I'd like to add some gambling to, now the results of the event to be bet on is random. So how to setup a way to bet on the event and then have the game figure out the winner of the event and then if the player did bet on the winner how to pay out the winnings....

 

An example.. Say I make a set of tracks with Geckos in it each enclosed in there own track separate from the other, before the race the player would pick the one he wants to bet on then Now the player would have bet on the one he wants to win (perhaps each one is of a different color or type etc ) at a set time Bang they all run down the track and one wins the race, if the winner is the same as the player picked before the race then the player would get a pay of caps, if the player did not pick the winner then he would then lose his bet. Now the only scripting I have done so far is to make a go from point a to b then fight then go to point c and get quest reward, so I have know idea to implement this idea.

 

If you have some idea how to do this I would take any help i can get. I am skilled enough to set everything up except how to get the betting and payout and how to trigger the start of the race..(I have experimented a little I can setup the "race" but it starts as soon as you load the game tho..

 

(I have posted this before without replies)( someone must have some idea how to do this)

 

Perhaps a Race is a bad setting, perhaps a fight between a Gecko and a Scorpion....You place a bet on one and if you win the game adds some caps to your inv if you lose it takes some.

I know how to make a basic script where you get a reward for doing something, but how to have a random event trigger a reward or a take item from your inv I don't know.

 

The way I would do this would have a straight track set up. I would have probably 25 geckos in groups of 5. Each gecko has a unique speed.

So there are 5 gecks on the track at each time. We'll call them Red, Green, Yellow, Blue, Black. There are 5 geckos of each colour.

Red1 has a speed of 10. Red2 has a speed of 8. Red3 has a speed of 7, etc.

Green1 has a speed of 6. Green2 has a speed of 7.

Etc, etc.

 

At the finish line there would be 5 trigger boxes. The geckos are given an always run AI package to their own XmarkerHeading that's behind the trigger zones.

 

I would then do this:

scriptname StartGeckoRace    ;on the activator to start the race

short random

begin OnActivate Player
  set random to GetRandomPercent   ;generates a random number between 0-99

 if random < 20  
   Red1.enable
   Red1.moveto RedGeckoStartXmarker
   Green1.enable
   Green1.moveto GreenGeckoStartXmarker
   etc for all the Colour1 Geckos
 
  elseif random < 40      ;it is implied that  20 < random < 40
   Red2.enable
   red2.moveto RedGeckoStartXmarker
   Green2..
    ....
  
  elseif random < 60      ;if 40 < random < 60
   red3.enable
   ... ;you should see where I'm going with this

  elseif random < 80
    ...
  elseif random < 100
   ...
  endif    
 
  showMessage GeckoPick
end

Begin Gamemode ;This is where you set up the message, where the player picks the gecko to bet on.
end

 

Then you'd need a trigger script on each of the trigger boxes. To determine the winning gecko, set up a quest. The quest should have a quest script like this.

 

scriptname WinningGecko

short wehaveawinner
Begin GameMode
End

 

On each trigger box,

if WinningQuest.wehaveawinner == 0
  set WinningQuest.wehaveawinner to 1   ;1 if red gecko wins, 2 if green gecko wins, 3 if blue gecko wins, etc.
endif

 

Then in the WinningGecko script, check for when the value of 'wehaveawinner' changes. If it matches the selection the player picked, then he's a regular Charlie Sheen. (Winning).

 

Otherwise, he's got no money.

 

You've really inspired me with this haha

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...