Home   Help Search Login Register  

Author Topic: Death Report mixed with children song, need help scripting.  (Read 1377 times)

0 Members and 1 Guest are viewing this topic.

Offline emmanrulesit

  • Members
  • *
Hi all. Me and my brother recently started reading about mission editing seriously and we've been working on a multiplayer mission for three days now (!!!) but there's this thing that we still can't manage to get working and we need all the help we can get.

It's a bit farfetched so I'm going to explain the mission for you. This is what we have done so far:

Quote
The mission is a co-op-game named "They'll be coming around the mountain" and west (10 Real Players) has to protect a city from being captured by east (108 soldiers) by killing all of them. East start off far up in the mountain so west has plenty of time to find good spots for camping. Since they're strongly outnumbered the conditions are that west are able to respawn, but they must have at least one soldier alive in the city. If all soldiers are dead att the same time, east wins.

When east is very close to the city, a trigger goes off and starts playing a 30-second track of the song "She'll be coming around the mountain" just to make the killing a bit humurous.

The final touch is that when the music starts to play, we want to show the number of soldiers approaching the city (since west is able to kill some soldiers before reaching the city, it's not gonna' be 108) and after 2 minutes, we want the song to start playing again, but this time reporting number of deaths for east and how many soldiers that are left. We want this to happen every 2 minutes.

EXAMPLE
Game starts, West manages to kill 8 soldiers before triggering the song.

The song is triggered, the text reads:
Quote
100 Ruskies are approaching the city

West kills 10 soldiers more and first report reads:
Quote
2 minute report
10 Kills
90 Left

West kills 3 soldiers more and next report reads:
Quote
4 minute report
3 Kills
87 Left

And so on...

Sorry for the long post, but I really want this thing to work! It would be fun! I'll publish the result if you guys help us, and could even put your name in the beginning of the mission. Whatever you guys want, just learn me the scripty scripty. Me love you long time!

 :D

Thanks in advance.
« Last Edit: 02 Aug 2007, 02:33:45 by emmanrulesit »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Death Report mixed with children song, need help scripting.
« Reply #1 on: 02 Aug 2007, 02:56:32 »
10 dollah! Sucky sucky!

What you want to do is better done with a script than a trigger, but you will need a trigger too!

First trigger surrounding the area in question named triggerEastCount , East Present,Once, with on Activation:
Code: [Select]
[] exec "cummin.sqs"
Script cummin.sqs
Code: [Select]
_eastInTrigger = count list triggerEastCount
#loop
hint format ["%1 suckas left to ice...", _eastInTrigger]
..insert playSound here... cummin round the mountain
~120
_eastInTrigger = count list triggerEastCount
if (_eastInTrigger > 0) then {goto "loop"}
exit

This is somewhat simplified, but should work for most circumstances.
« Last Edit: 02 Aug 2007, 02:59:39 by Mr.Peanut »
urp!

Offline emmanrulesit

  • Members
  • *
Re: Death Report mixed with children song, need help scripting.
« Reply #2 on: 02 Aug 2007, 12:21:27 »
Yes! The script language in the .sqs-file you wrote is decipherable!

I've modified it a little, here's the final script:

Quote
_eastInTrigger   = count list triggerEastCount
_minutereport    = 0;
hint format ["%1 Soldiers are approaching the city", _eastInTrigger]

#loop
playMusic "mountain"
~120
_minutereport    = _minutereport+2;
_deathreport    = _eastInTrigger-(count list triggerEastCount)
_eastInTrigger    = count list triggerEastCount;

hint format ["%1 minute report \n %2 kills since last report \n %3 soldiers left",_minutereport, _deathreport, _eastInTrigger]

if (_eastInTrigger > 0) then {goto "loop"}

exit

Thanks man! You helped me get the hang of this. There isn't much left before we finish our first mission.  :good: