glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] Features needed for campaigns


From: Kieran P
Subject: [glob2-devel] Features needed for campaigns
Date: Fri, 16 May 2008 17:13:33 +1200

Hey everyone,

I've posted these ideas on the wiki and IRC, but they get lost, and because its important we have a decent campaign for 1.0 (which I still intend to make as I said many months ago), there are a few things I was hoping to see included in SGSL scripting. If any of these are unsuitable for network gaming, some scripting to disable the functionality of certain unpredictable codes by default would be handy.

If you're not sure about something I suggest here, just ask. I'm hoping most things can be done (maybe not the eachHas type thing, but who knows). These types of things would make much richer campaigns.

Also, support for mouse drag highlighting, Tabbing, CTRL+C, CTRL+V, CTRL+X, and CTRL+A controls inside the editor would be nice (for those who don't want to use the Load/Save functionality)


* Ability to define alliances in SGSL, so I can setup the player and a weak ally against say Nicowar, of which you must defend against
  - This would be done whereever needed, not pregame. For example, setting the enemy an ally at the start would allow them to grow naturally, while not attacking. Then when a certain things are reached, I can set it as an enemy, thus causing it to attack. The settings would be locked, so they cant be changed by the player ingame.
* The ability to define an AI's maximum building territory. Its not nice to have the AI build in the middle of your base. The units would go outside this zone, but new buildings would be as if they had forbidden area and unable to build.
* An ingame timer from the moment the command startTimer() is executed, for things like "you have 5 minutes to build up forces", and the ability to check it (would at the same time enable the ability to limit total game time)
* The ability to count total amount of whatever unit, plus do math calculations on them (count workers, count explorers, count warriors, and ability to add them up), with listing ability and a eachHas method taking a int param
* The adition of a when loop, to keep looping every so many ticks, checking for a condition (this wouldn't halt the script, but keep checking even when the rest is running)
* The ability to get the current players ID
* Signal mark spot function, with the name of an are which would be defined in the oringal map
* The ability to store building and unit locations to be able to reload them in the next map of the campaign.
* The ability to load the next campaign map from within the game, rather than taking the play back to the campaign screen, using a prompt, and loadMap function
* and a whole bunch more (see below)

Heres a script showing a few of them together with examples (not syntacticly correct, but if it were, thats a decent mini script :D)
------------------------------------------------------------------------------------
// Please keep in mind some functions like endGame exist in some other form, I just dont have time to research
// loadBuildings() <- restore data from storeBuildingData() function
// loadUnits() <- restore data from storeUnitData() function
// setAI(playerID, aicodename) <- set the player to a specific AI using shortcut constants
// setAlliance(setwho, withwho, towhat)  <- set an alliance with who, about whom, to what (allies or enemies) which works both ways (they ally each other)
// playerID() <- the ID of the current player who  is viewing the game
// setBuildField(setwho,  buildrange_from_first_swarm_in_tiles, include_unusable_tiles)  <- how many tiles around their first swarm can they build?
// revealMap() <- doesn't take id. it will reveal to all to make it fair
// startTimer() <- returns reference which is used to get the current time since starting in seconds
// count(unitType1, unitType2, etc) <- int of how many of that units, with listing (like PHP's list function) and eachHas method
// endGame(winner) <- force the game to end with a winner
// signalPlayer('enemyArea') <- puts a markspot at a script area within the map
// allyDead(whichTeam, whichAlly) <- checks if a specific ally of a specific team has died
// gameWon()  <- has the game been won by victory?
// gameWinner() <- the ID of the player who won
// storeBuildingData() <- store the locations of the buildings, their level, their health, their stock etc
// storeUnitData() <- store the locations of the units, their level, their health, their cargo etc
// prompt('ask this', 'Yes', 'No')  <- prompts the player 'ask this' for either a Yes or No button answer (all changable)
// loadNextMap() <- based on prompt above, can load the next campaign map without going to campaign screen
// restartMap() <- restart the current map after the player is prompted

------------------------------------------------------------------------------------

loadBuildings()
loadUnits()
setAI(2, nicowar)
setAI(3, numbi)
setAlliance(playerID(), 2, allies)
setAlliance(playerID(), 3, allies)
setAlliance(2, 3, allies)
setBuildField(2, 100, false)
revealMap()
show "our spied managed to get hold of the current landscape. We see the enemy is building to defeat our ally. Quick, make 10 workers, and 10 warriors and attack them"
time = startTimer()
function countDown() {
 if time == 60 or count(warriors, workers).eachHas(10) {
  show "Times up"
  setAlliance(playerID(), 2, enemies)
  setAlliance(2, 3, enemies)
  return true
 } elseif time > 30 {
  show "You have 30 seconds left"
 } else {
  show "Keep building over 10 warriors and 10 workers"
 }
 wait(5)
 countDown()
}
when (countDown() == true) {  // this loop will instantiate the first loop of the countDown() function
 //warriors, workers = count(warriors, workers) <- thats one way, the other is on the next line
 if count(warriors, workers).eachHas(<10) {
  show "oh dear, you're not strong enough"
  endGame(2)
  if (prompt("Do you wish to try again?", "Yes", "No") == true) {
   restartMap()
  }
 } else {
  show "FIGHT. Check minimap for location"
  signalPlayer('enemyArea')
 }
}
when (allyDead(1, 3)) {
 show "your ally has died. You lose"
 endGame(2)
 if (prompt("Do you wish to try again?", "Yes", "No") == true) {
  restartMap()
 }
}
when (gameWon()) {
 if gameWinner() == playerID() {
  show "Well done, next level"
  storeBuildingData()
  storeUnitData()
  if (prompt("Continue playing Campaign?", 'Yes Please', 'No thanks') == true) {
   loadNextMap()
  }
 } else {
  show "Nice try. Maybe next time"
 }
}
when (time > 3600) {
 show "you were too slow to defeat your enemy"
 endGame(2)
 if (prompt("Do you wish to try again?", "Yes", "No") == true) {
  restartMap()
 }
}
------------------------------------------------------------------------------------

This email has been in my drafts box for 2-3 days, and I can't think of anything else at this point, so I'll send it.

So, are any of these possible either in the current SGSL or in the future libUSL? Ignore the syntax or execution, just focus on the ideas. And don't be too quick to say no. Without a few of them, you wont get very interactive campaigns like most other games have :(

--
Regards
Kieran
reply via email to

[Prev in Thread] Current Thread [Next in Thread]