.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V > SEV Modders Knowledge Base

Reply
 
Thread Tools Display Modes
  #1  
Old November 6th, 2006, 09:11 PM

Phoenix-D Phoenix-D is offline
National Security Advisor
 
Join Date: Nov 2000
Posts: 5,085
Thanks: 0
Thanked 0 Times in 0 Posts
Phoenix-D is on a distinguished road
Default Event and Intel scripts

I can sort of figure out the AI scripts, but the Event script is driving me batty.

I'm trying to make a fairly simple change- I want an event to fire every turn. Any ideas on -how- to do that?
__________________
Phoenix-D

I am not senile. I just talk to myself because the rest of you don't provide adequate conversation.
-Digger
Reply With Quote
  #2  
Old November 6th, 2006, 09:19 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: Event and Intel scripts

Looks fairly straightforward:

Code:
  set event_freq := Sys_Game_Settings_Get_External_Events_Frequency()
set lng_Event_Severity := Sys_Game_Settings_Get_External_Events_Severity()
set chance := Sys_Get_Random_Long(1, 100)
case event_freq
EVENT_FREQUENCY_NONE:
set event_happened := FALSE
EVENT_FREQUENCY_LOW:
if (chance <= 5) then
set event_happened := TRUE
endif
EVENT_FREQUENCY_MEDIUM:
if (chance <= 10) then
set event_happened := TRUE
endif
EVENT_FREQUENCY_HIGH:
if (chance <= 25) then
set event_happened := TRUE
endif
endcase



A number between 1 and 100 is generated, then you go into this case statement based on the frequency used in game setup. In the particular frequency that the game is using, you compare your random number to some chance threshold to see if an event occurs. On low frequency, you have a 5% chance each turn. On high, you have a 25% chance. Set "chance <= 25" line to "chance <= 100" if you want 1 event per turn with high frequency game setting.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:55 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.