I want to here about all the cool new tricks people have invented with ToT events.
Announcement
Collapse
No announcement yet.
ToT events chat ...
Collapse
X
-
It looks like you and I are the only ones John.
The fantasy scenario I am building has a number of quests in it requiring the player to explore maps 1, 2 and 3. I felt that the players would get bored searching an entire map so I decided to locate treasure chests in various locations to keep the search interesting and included rewards such as gold, a magic scroll (free advance), and a curse (disables a technology). The problem with this is that it would be fun the first time playing the scenario but thereafter it would detract from the re-playability because the players would learn which chests contained rewards and which contained curses. I decided I wanted the contents of the chests to be randomly determined, to be impossible to predict the contents, to never have more then one chest in a given site, and not to use up allot of heap space doing it.
Here is how I did it.
Each turn several flags of the barbarian civ are seeded with a random value.
@IF
RandomTurn
Denomonator=2
@THEN
FLAG
Who=Barbarian
State=On
Flag=31
@ENDIF
Once set the flags can be examined for an exact match of the mask for equal probability results or as a count producing a bell curve result. I chose to use the bell curve making the scroll and the curse the least likely result.
@IF
UnitKilled
Unit=Treasure Chest
Attacker=anybody
Defender=anybody
@AND
Checkflag
Who=Barbarians
Mask=0xF0000000
Count=4
@THEN
NoBroadcast
TEXT
Within the ancient chest is the treasure of a Lich worth 1000 gold. The Lich pronounces a curse on you and your people forbidding you communication with the denizens of the spirit world.
ENDTEXT
TakeTechnology
Whom=TriggerAttacker
Collapse
Technology=Sorcery
ChangeMoney
Receiver=TriggerAttacker
Amount=1000
@ENDIF
Like it?
Comment
-
I like it William. I'd like it even more if I could understand it. How about an "Events for Dummys" tip? Please?
Comment
-
-
Actually, I do know what a bell curve is.
Comment
-
Flags are storage places for information. They store a yes (1) or no (0), or a true (1) or false (0). Each civ gets 32 flags (four bytes).
Things you might want to store in these flags are:[*]Was Berlin taken? [*]Was the Napoleon killed in battle? [*]Did the player complete his third quest?
The FLAG command sets the value (1) is true (0) is false.
The CHECKFLAG command is used in the @IF to decide if the value is true or false.
MASKS are a way to look at many flags at one time or to set many flags at once. You might use a mask to have a nation surrender if they have lost four or more key cities.
Does this help?
[This message has been edited by William Keenan (edited October 20, 1999).]
Comment
-
Um...well...sure, I guess. Don't you feel a tip coming on William?
Comment
-
Techumseh ...
The good news is that I will definitely be writing a tip on this topic.
The bad news is that I will not start work on it until after I finish the rewrite of the Barbarian order of appearance tip and publish my first ToT scenario. That could be awhile.
In the meantime I'll be glad assist you in your ToT scenario building efforts.
Comment
-
Just curious here. Does anyone have trouble using the events to load movies? I'm having trouble right now with TOT.
This is the command in the events file
@IF
TURN
turn=3
@THEN
PLAYAVIFILE
FIRE.AVI
@ENDIF
William, can you help out?Civfan (Warriorsoflight)
Comment
Comment