Data Realms Fan Forums
http://868000.nnhp.asia/

Area Editor help
http://868000.nnhp.asia/viewtopic.php?f=73&t=12072
Page 1 of 1

Author:  fyher [ Mon Aug 25, 2008 12:19 am ]
Post subject:  Area Editor help

I've been trying to make a lua scene but i can't get the zones figured out. If someone could explain what the name of each zone means, i would greatly appreciate it.

Also, is there a way to make the enemy AI sentry and not want to come after my brain, i want to keep them stationary so they defend their base.

Author:  Azukki [ Mon Aug 25, 2008 12:47 am ]
Post subject:  Re: Area Editor help

None of them actually do anything other than AttackerLZ
And that's the landing zone of the attackers.
There's commented out lua code in the lua file for KillZone to gib actors that go into it, for reference.


To make them sentry, open your lua file, ctrl+f, and look for AIMODE_BRAINHUNT
Change that to AIMODE_SENTRY

Author:  fyher [ Mon Aug 25, 2008 1:37 am ]
Post subject:  Re: Area Editor help

Ahh ok thanks. Is there a code in the lua to make winzone work?

Author:  Azukki [ Mon Aug 25, 2008 1:46 am ]
Post subject:  Re: Area Editor help

Is there one already? I don't think so.
Can there be? Yes.

Code:
    for actor in MovableMan.Actors do
        if SceneMan.Scene:WithinArea("Win Zone", actor.Pos) and ActivityMan:ActivityRunning() then
                self.WinnerTeam = Activity.TEAM_1
                ActivityMan:EndActivity();
        end
    end


Will this one work? No idea.

Author:  fyher [ Mon Aug 25, 2008 2:55 am ]
Post subject:  Re: Area Editor help

I've tried that already but it didn't work, i think i did something wrong tho. I also tried making an AI Brain and destroying it but that didnt work either. the parts at the end of the .lua file where the declare the win thing is un..un-commented so it should work but once the game starts it automatically says win.

Author:  casey [ Mon Aug 25, 2008 8:35 pm ]
Post subject:  Re: Area Editor help

try putting the code all in one line. dunno if it'll work but it might

Author:  fyher [ Tue Aug 26, 2008 3:20 am ]
Post subject:  Re: Area Editor help

So i tried your code Azzuki and it worked so thanks a lot, i just gotta figure out a way to make killing the brain win because the code that's commented out doesn't seem to be working...

Author:  Azukki [ Tue Aug 26, 2008 3:43 am ]
Post subject:  Re: Area Editor help

Code:
    -- Check if the CPU brain is dead
    if not MovableMan:IsActor(self.CPUBrain) and ActivityMan:ActivityRunning() then
        self.CPUBrain = nil;
        -- Proclaim player winner end
        self.WinnerTeam = Activity.TEAM_1
        -- Finito!
        ActivityMan:EndActivity();
    end


Base.rte/Scenes/TestScript.lua is the tutorial mission lua code.

And guess what happens when you kill the enemy brain in the tutorial mission?

Author:  fyher [ Tue Aug 26, 2008 4:15 am ]
Post subject:  Re: Area Editor help

Ahh ok but when i tried it it just automatically said win...maybe i screwed up again.

Author:  Azukki [ Tue Aug 26, 2008 4:25 am ]
Post subject:  Re: Area Editor help

There is an enemy brain on the scene, right?

Author:  fyher [ Tue Aug 26, 2008 4:26 am ]
Post subject:  Re: Area Editor help

ya, but i think it had something to do with win zone, i'm gonna try disabling win zones and using the brain code.

Author:  Azukki [ Tue Aug 26, 2008 4:32 am ]
Post subject:  Re: Area Editor help

Did you by any chance put enemy actors in the win zone?

Because that win zone code doesn't care what team goes in it, it's just looking for actors.

Look around, I know I stumbled upon some code that checked an actor's team, and then did other stuff if it was the right team. Either in this forum or vanilla scripts.

Author:  Foa [ Tue Aug 26, 2008 4:57 am ]
Post subject:  Re: Area Editor help

Azukki wrote:
Did you by any chance put enemy actors in the win zone?

Because that win zone code doesn't care what team goes in it, it's just looking for actors.

Look around, I know I stumbled upon some code that checked an actor's team, and then did other stuff if it was the right team. Either in this forum or vanilla scripts.

Code:
    for actor in MovableMan.Actors do
        if actor.Team == 1 then
            if SceneMan.Scene:WithinArea("Win Zone", actor.Pos) and ActivityMan:ActivityRunning() then
                    self.WinnerTeam = Activity.TEAM_1
                    ActivityMan:EndActivity();
            end
        end
    end


Is that right?

Author:  Grif [ Wed Aug 27, 2008 1:10 am ]
Post subject:  Re: Area Editor help

Well yes, but Team 1 is Green.

Author:  fyher [ Wed Aug 27, 2008 3:22 pm ]
Post subject:  Re: Area Editor help

ok so destroying the AI brain doesnt work, with win zones disabled and just the destroy brain to win code gives me automatic win so i dunno how to fix this, i'll just stick with win zone for now.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/