Go to Cafe Tropico Cafe Tropico
Go to the Blue Parrot Inn
Search:     Advanced search
05/23/13 at 11:40 AM
Welcome, Guest. Please login or register.

Login with username, password and session length
207387 Posts in 10531 Topics by 2074 Members
Latest Member: cpmoneymakertutorials
   Home   Help Search Calendar Login Register  
Cafe Tropico  |  Tropico 2: Pirate Cove  |  Pirate Cove Editor/Scripting Help (Moderator: CafeDave)  |  Topic: Interactive choice
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: Interactive choice  (Read 895 times)
0 Members and 1 Guest are viewing this topic.
TJ
Rebel
***
Offline Offline

Gender: Male
Posts: 240

Yes, I am addicted to Tropico 2. Ok, I was...


« on: 04/20/03 at 11:34 AM »

I have not seen this in any game I have played, but is there anything in the scripting language that will pop up a dialog box that allows a choice?

I am thinking about, for example, a captain making a one time offer for cash of his services (and his ship and/or crew) at some point during the game.
Report to moderator   Logged
FieryDove
Peasant
**
Offline Offline

Gender: Female
Posts: 59


Frequent Flyer


WWW
« Reply #1 on: 04/20/03 at 11:46 AM »

In documentation .txt there are the below listed that might fit the bill:

-Random events (it's often best if random events provide some kind of choice to the user, having positive negative effects, and are perhaps optional).
       
-Events displayed with messages or option dialogs, sounds, and voices.

- One-time or multi-part "mini-story" events.

It should be doable methinks.

Cheers,
FD
Report to moderator   Logged
TJ
Rebel
***
Offline Offline

Gender: Male
Posts: 240

Yes, I am addicted to Tropico 2. Ok, I was...


« Reply #2 on: 04/20/03 at 04:05 PM »

Those are not exactly what I am looking for. I would like a pop up with two buttons, one for Yes and one for No. The script could then take action either way depending on the choice.

Example: Say Spain is at war with France. You are neutral with both. A Spanish representative comes to you with an offer to ally with them. If you accept, they become your patron, letters of marquee, etc. If you do not relations instantly turn Hostile. You could then follow up with an event where France heard about you turning down Spain and then offers to become your Patron. Do you see where I am going?
Report to moderator   Logged
Charlemagne
General
****
Offline Offline

Posts: 354



« Reply #3 on: 04/20/03 at 05:03 PM »

TJ

I beleive there are examples of what you want in the add-on scenario you get when you register called Spanish Inquisition. I'll post one example from that file:

rule priest_demands_three
{
   frequency day;

   conditions
   {
                   game_tick > 4000;
      num_characters_of_type("skel") > 0;
      num_characters_of_type ("spri") > 0;
      demand_level == 2;
      is_asserted("demand_three_tick") == false || game_tick > demand_three_tick;
   }
   actions
   {
      
      action assert_int { name: "demand_three_tick"; value: game_tick + 2000; }
      action create_message_dialog
           {
                  title: "Demand by the Inquisition";
           
                  body: "Inquisitors insist on an Exorcism of your skeletons. If you agree,fear all over the island will decline.";
                  pictureID: EVENT_EDICT_RAISE;
                  option1_label: "Oh well, I can build more decor.";
                  option1_rule: "exorcise_skeletons";
                  option2_label: "No way! Fear is critical!";
                  option2_rule: "increase_demands";
           
              }
   }
}

Basically the actions include reference to other rules which would be invoked when the player takes that option. So of course, you would write those other rules as frequency invokation;
Report to moderator   Logged

Bill Spieth
Frog City
TJ
Rebel
***
Offline Offline

Gender: Male
Posts: 240

Yes, I am addicted to Tropico 2. Ok, I was...


« Reply #4 on: 04/20/03 at 09:12 PM »

Yes, exactly what I was looking for. I should have remembered seeing that in that scenario.
Report to moderator   Logged
jonedwards
Tourist
*
Offline Offline

Posts: 49


I'm a llama!


« Reply #5 on: 04/21/03 at 09:30 PM »

Yep, yep. That's right, you want to use create_message_dialog. You can chain a sequence of option message dialogs, play sounds when popping up or dismissing the dialog,  and I think potentially do a lot of fun stuff.
Report to moderator   Logged
Captain Bligh
Tourist
*
Offline Offline

Gender: Male
Posts: 44


I miss the Bounty!


« Reply #6 on: 05/10/03 at 04:09 AM »

Here is 3 of a dozen that I have made so far. Working on a mercenary one where you get paid for number of captives and ship's sunk by your employer. Having a hrd time with that one, only been taking programming classes for 3 month's.

"Ally" has spain and england at war and grants you a letter of marque and money, commodities and captives to join their side.( You need to start the war in your script yourself.)

"French Trader" sells you rum, beer, cigars and pastries once you have built the required buildings and have 2000 plus gold in the treasury.

"Dutch Trader" sells you goods that raise pirate satisfaction by 2 points in 1 of 4 fields if you have enough gold in your treasury.(Might want to adjust prices to balance gameplay, if you do, change the conditions to match highest price.)

I have tested these and they do work. If you find any issues let me know so I can fix them please.

* ally_french_trader_dutch_trader.zip (3.37 KB - downloaded 68 times.)
Report to moderator   Logged

Mel Gibson went native and cost me my ship.
Captain Bligh
Tourist
*
Offline Offline

Gender: Male
Posts: 44


I miss the Bounty!


« Reply #7 on: 05/10/03 at 04:57 PM »

My apologies to anyone who used the other events, I copied the wrong file. This is the correct one which does work.

* 3_events_texts.zip (3.34 KB - downloaded 45 times.)
Report to moderator   Logged

Mel Gibson went native and cost me my ship.
Pages: [1]   Go Up
  Send this topic  |  Print  
Cafe Tropico  |  Tropico 2: Pirate Cove  |  Pirate Cove Editor/Scripting Help (Moderator: CafeDave)  |  Topic: Interactive choice
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!