Explorations/Random Events

General Chat, Comments
Post Reply
njfrlng
Posts: 53
Joined: Tue Feb 04, 2014 9:51 pm

Explorations/Random Events

Post by njfrlng »

Is there a way to set how often specific events happen while exploring?

example:

%50 of the time a generic comment with no effect will be displayed.
%20 of the time you will gain %.1 strength
%10 of the time you will find a random amount of gold
%1 of the time you will find a super item
etc...
User avatar
Chris
Posts: 1580
Joined: Wed Sep 30, 2009 7:22 pm

Re: Explorations/Random Events

Post by Chris »

What language?

PHP:

Code: Select all

$randomPercentage = rand(1,100);
if($randomPercentage >= 50) {
 // %50 of the time a generic comment with no effect will be displayed.
} elseif($randomPercentage >= 20) {
 // %20 of the time you will gain %.1 strength
} elseif($randomPercentage >= 10) {
 // %10 of the time you will find a random amount of gold
} elseif($randomPercentage == 1) {
 // %1 of the time you will find a super item
} 
Fighting for peace is declaring war on war. If you want peace be peaceful.
njfrlng
Posts: 53
Joined: Tue Feb 04, 2014 9:51 pm

Re: Explorations/Random Events

Post by njfrlng »

thanks.

NWE has it so you can just add events and throw in any effects. I see that you can randomly add how much of something they recieve using similar code. But the actual generation of the events must have to be edited in the actual mod itself.

Thanks for the help
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: Explorations/Random Events

Post by a_bertrand »

No currently the exploration module doesn't have % of chances for the events. But nothing prevent you to implement it if needed ;)
Creator of Dot World Maker
Mad programmer and annoying composer
njfrlng
Posts: 53
Joined: Tue Feb 04, 2014 9:51 pm

Re: Explorations/Random Events

Post by njfrlng »

a_bertrand wrote:No currently the exploration module doesn't have % of chances for the events. But nothing prevent you to implement it if needed ;)
Therin lies the problem, im a noob! lol
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: Explorations/Random Events

Post by a_bertrand »

Well... sadly you will not be able to fully implement YOUR game without starting to dig into the code and create new modules and / or change existing one. It's an engine not a pre-made game. Advantage is that you will have your game at the end, and not a game made by somebody else.
Creator of Dot World Maker
Mad programmer and annoying composer
Post Reply

Return to “General”