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

Login with username, password and session length
207390 Posts in 10531 Topics by 2074 Members
Latest Member: cpmoneymakertutorials
   Home   Help Search Calendar Login Register  
Cafe Tropico  |  Tropico  |  Scenario Editor / User Scenarios / Competitions (Moderator: CafeDave)  |  Topic: script help on unitdiefromsickness
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: script help on unitdiefromsickness  (Read 349 times)
0 Members and 1 Guest are viewing this topic.
artemais
General
****
Offline Offline

Gender: Male
Posts: 365


Hawaii's Pineapple King


« on: 03/23/04 at 06:02 PM »

Hola.  I've been dorking around with some script and have run into a slight problem.  Here's my script:

Poison.evt

Checkfrequencymonthbegin
LoopThroughAllUnits
condition unittype=unittypeslobtourist
generaleffect addto unitdiefromsickness 1
messagetypedossier
messagetext "Presidente, the people have poisoned[UNIT_NAME] to death."


This works perfectly except for one problem....this of course kills anybody who is a slob tourist, and I only want to kill one.  Is there a way to isolate just one of them?  I tried taking out loopthroughallunits and I get an error.

Also, does anybody know how I can isolate visits to a particualr building for scripting?  Say, for example, that before I posion the slob tourist, I want to only include people who have been to the pub...or even in general, like say to get a score based on how many pub visits I have had?

Any help would be appreciated.
Report to moderator   Logged
Brf
Emperor
******
Offline Offline

Posts: 1651


I must make more scenerios!! Bwahahahahah!!!!!!


WWW
« Reply #1 on: 03/24/04 at 02:45 PM »

I do not believe you can tell where any unit is, or ever was, in scripting.

To only kill the first tourist, put in the line

executeonlyonce

Either that, or you can set a global or script variable to count the number you have killed, and only execute if the variable is <= the amount you want to kill.
Report to moderator   Logged

artemais
General
****
Offline Offline

Gender: Male
Posts: 365


Hawaii's Pineapple King


« Reply #2 on: 03/25/04 at 10:08 PM »

thanks...I figured out how to use the group variables to ensure that only one tourist dies...

Still wish there was a way to check how many visits there were...figured out a workaround on that too, but it means I can only charge a set amount for the price (say, for example, $1 and then count *GSrevenue).  This, however forces more issues of how to enforce that to other players, which can't be done in scripting (although making life miserable can be scripted Smiley

Thanks
Report to moderator   Logged
Brf
Emperor
******
Offline Offline

Posts: 1651


I must make more scenerios!! Bwahahahahah!!!!!!


WWW
« Reply #3 on: 03/26/04 at 11:50 AM »

Well.... you should be able to count BldgYtdRevenue and divide by BldgRent to find out how many people are visiting.... but there isnt any way to tell who was the visitor.
Report to moderator   Logged

Coconut Kid
Tempus Fugit
Deus Ex Machina
********
Offline Offline

Gender: Male
Posts: 7084

ˇay caramba! ~~ ˇparedón!


WWW
« Reply #4 on: 05/07/12 at 01:08 PM »

... Also, does anybody know how I can isolate visits to a particular building for scripting?  Say, for example, that before I poison the slob tourist, I want to include only people who have been to the pub -- or even in general, like say to get a score based on how many pub visits I have had? ...

... Still wish there was a way to check how many visits there were. Figured out a workaround on that too, but it means I can only charge a set amount for the price (say, for example, $1 and then count *GSrevenue). This, however forces more issues of how to enforce that to other players, which can't be done in scripting. ...

I really can't follow that because there is no script code " *GSrevenue " because all the Game Statistic script codes having to do with revenue do not use that format.

... you should be able to count BldgYtdRevenue and divide by BldgRent to find out how many people are visiting -- but there isn't any way to tell who was the visitor.

I don't think that will work because BldgRent will (should) work only on buildings which use RENT which is not the same as FEES. I deduce this from the word pattern of the script codes.

I do not believe the script can derive the number of visits. For one thing, visits may last long enough to trip two monthly charges.

The scriptor may not micromanage to the visit level. He has to rethink to the macro-level of revenue or profit.
Report to moderator   Logged

Pages: [1]   Go Up
  Send this topic  |  Print  
Cafe Tropico  |  Tropico  |  Scenario Editor / User Scenarios / Competitions (Moderator: CafeDave)  |  Topic: script help on unitdiefromsickness
 
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!