Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2015, 5:56:56 PM (9 years ago)
Author:
paulsc
Message:

Made number of enemies increase over time, added fps undock, advanced quests/events/notifications to quest 6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/data/levels/Campaign1.oxw

    r10783 r10792  
    4040    <?lua
    4141        waves = 3
    42         enemies = 5
     42        enemiesInit = 5
     43        enemiesIncrease = 2
    4344        allies = 3
    4445
     
    241242    <!-- Actual recursive Event(s) for the respective waves. -->
    242243    <?lua
     244    enemies = enemiesInit
    243245    for k = 1, waves, 1
    244246    do
     
    252254        </events>
    253255    </EventMultiTrigger>
     256    <?lua enemies = enemies + enemiesIncrease ?>
    254257    <?lua end ?>
    255258
     
    286289    </EventDispatcher>
    287290
     291    <DistanceTrigger active=false name="reachedC" position="<?lua printC(cC) ?>" distance=1000 target="SpaceShip" beaconMode="exclude" targetname="NPC" stayactive=true>
     292        <events>
     293            <activity>
     294                <EventListener event="waveClear1" />
     295            </activity>
     296        </events>
     297    </DistanceTrigger>
     298
     299    <!-- TODO: find out how to link an event to the COMPLETION of a dock. How is this not possible?? -->
     300    <EventMultiTrigger name="dockedC" activations="1" stayactive="true" delay=3>
     301        <events>
     302            <trigger>
     303                <EventListener event="dockC" />
     304            </trigger>
     305        </events>
     306    </EventMultiTrigger>
     307
     308    <EventMultiTrigger name="wave2" activations="1" delay=8>
     309        <events>
     310            <trigger>
     311                <EventListener event="dockedC" />
     312            </trigger>
     313        </events>
     314    </EventMultiTrigger>
     315
    288316    <!-- FIXME: This trigger needs fixing, as endMission can only be called by a Pawn Distance Trigger. Herpaderp.
    289317    Also, the fix proposed in MissionOne does not work anymore... -->
     
    362390    </QuestEffectBeacon>
    363391
     392    <QuestEffectBeacon times=1>
     393        <effects>
     394            <CompleteQuest questId="quest4.1" />
     395        </effects>
     396        <events>
     397            <execute>
     398                <EventListener event="reachedC" />
     399            </execute>
     400        </events>
     401    </QuestEffectBeacon>
     402
     403    <QuestEffectBeacon times=1>
     404        <effects>
     405            <CompleteQuest questId="quest4.2" />
     406            <CompleteQuest questId="quest4" />
     407        </effects>
     408        <events>
     409            <execute>
     410                <EventListener event="dockedC" />
     411            </execute>
     412        </events>
     413    </QuestEffectBeacon>
     414
     415    <QuestEffectBeacon times=1>
     416        <effects>
     417            <CompleteQuest questId="quest5" />
     418        </effects>
     419        <events>
     420            <execute>
     421                <EventListener event="waveClear2" />
     422            </execute>
     423        </events>
     424    </QuestEffectBeacon>
     425
    364426    <!--NOTIFICATIONS -->
    365427
     
    444506    </SimpleNotification>
    445507
     508    <!-- HACK: Somehow only fires a second time if the (notification,event) pairs are separate! WTF -->
     509    <?lua
     510    for k = 1, waves, 1 do
     511    ?>
    446512    <SimpleNotification broadcast="true" message="An enemy wave is approaching the shuttle!">
    447513        <events>
    448514            <trigger>
    449                 <EventListener event="wave1" />
    450                 <EventListener event="wave2" />
    451                 <EventListener event="wave3" />
    452             </trigger>
    453         </events>
    454     </SimpleNotification>
     515                <EventListener event="wave<?lua print(k) ?>" />
     516            </trigger>
     517        </events>
     518    </SimpleNotification>
     519    <?lua end ?>
    455520
    456521    <SimpleNotification broadcast="true" message="yippie ki yay motherf*cker!">
     
    468533            <trigger>
    469534                <EventListener event="waveClear1" />
     535            </trigger>
     536        </events>
     537    </SimpleNotification>
     538
     539    <SimpleNotification broadcast="true" message="But it's not over yet! Get to Station C and dock!">
     540        <events>
     541            <trigger>
     542                <EventTrigger stayactive="true" delay=4 >
     543                   <events>
     544                      <trigger>
     545                         <EventListener event="waveClear1" />
     546                      </trigger>
     547                   </events>
     548                </EventTrigger>
     549            </trigger>
     550        </events>
     551    </SimpleNotification>
     552
     553    <SimpleNotification broadcast="true" message="This is our powerful reinforced cannon suit.">
     554        <events>
     555            <trigger>
     556                <EventListener event="dockedC" />
     557            </trigger>
     558        </events>
     559    </SimpleNotification>   
     560
     561    <SimpleNotification broadcast="true" message="It should deal with those pesky invaders!">
     562        <events>
     563            <trigger>
     564                <EventTrigger stayactive="true" delay=4 >
     565                   <events>
     566                      <trigger>
     567                         <EventListener event="dockedC" />
     568                      </trigger>
     569                   </events>
     570                </EventTrigger>
     571            </trigger>
     572        </events>
     573    </SimpleNotification>
     574
     575    <SimpleNotification broadcast="true" message="Brilliant work, Commander! now undock again.">
     576        <events>
     577            <trigger>
    470578                <EventListener event="waveClear2" />
    471                 <EventListener event="waveClear3" />
    472579            </trigger>
    473580        </events>
     
    584691                        <EventListener event="dockC" />
    585692                    </execute>
    586                     <undocking>
    587                         <EventListener event="undockC" />
    588                     </undocking>
     693                    <active>
     694                        <EventListener event="reachedC" />
     695                    </active>
    589696                </events>
    590697                <attached>
     698                    <!--HACK: We use another dock to undock back to the ship since undocking is not implemented... -->
     699                    <Dock position="0,0,0" active=true>
     700                        <effects>
     701                            <DockToShip target="newSpaceShip" />
     702                        </effects>
     703                        <events>
     704                            <execute>
     705                                <EventListener event="undockC" />
     706                            </execute>
     707                            <active>
     708                                <EventListener event="reachedC" />
     709                            </active>
     710                        </events>
     711                    </Dock>
    591712                    <DistanceTrigger position="0,0,0" distance="200" target="SpaceShip" beaconMode="exclude" targetname="NPC" name="dockC" />
    592713                    <Billboard position="0,0,0" amplitude=1 material="Flares/lensflare" colour="1,0,0.05" />
     
    747868    <!-- Enemies. Outer loop defines waves, inner loop defines enemies in every wave. -->
    748869    <?lua
     870    enemies = enemiesInit
    749871    for k = 1, waves, 1
    750872    do
     
    753875    for i = 1, enemies, 1
    754876    do
    755     x = math.cos(math.pi/(enemies + 3)*(i+1))*1500
    756     y = math.sin(math.pi/(enemies + 3)*(i+1))*1500
     877    x = math.cos(math.pi/(2*enemies - 2)*(i+k))*1500
     878    y = math.sin(math.pi/(2*enemies - 2)*(i+k))*1500
    757879    ?>
    758880    <SpaceShip visible=false active=false name="attackers<?lua print(k)?>" radarname="Attacker" position="<?lua print(y)?>,<?lua print(math.pow(-1,i)*250) ?>,<?lua print(x)?>" lookat="0,0,0" team=1>
     
    785907    </SpaceShip>
    786908    <?lua end ?>
    787     <?lua end ?>
     909    <?lua
     910    enemies = enemies + enemiesIncrease
     911    end ?>
    788912
    789913    <!-- Transporter, starting Point is near A, end Point near B, the circle parameters for the waypoints are: Center = (0, -887, 0), r = 2613 -->
Note: See TracChangeset for help on using the changeset viewer.