Not allow cp selection

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
ryukaji
Major
Major
Posts: 513
Joined: Mon Sep 17, 2007 7:46 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Not allow cp selection

Post by ryukaji »

How would I make it so that I automatically spawn at a certain cp, with no choice to select, and then how could I change it?

Im making a map where you fight alone in a building full of monsters, and the goal is to get to a portal to the next level, so I would need to make it so if they die on level 2 they start at the beginning of level 2 rather than repeating lvl 1 to get back to 2
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Re: Not allow cp selection

Post by jangoisbaddest »

ryukaji wrote:How would I make it so that I automatically spawn at a certain cp, with no choice to select, and then how could I change it?

Im making a map where you fight alone in a building full of monsters, and the goal is to get to a portal to the next level, so I would need to make it so if they die on level 2 they start at the beginning of level 2 rather than repeating lvl 1 to get back to 2
You'd have to get into LUA programming for that kind of work. Read up on the "Battlefront2_scripting_system" documentation in the modtools, and then search the site for the grand list of LUA functions (I think it's in the FAQ/Everything you Need thread).

Also don't forget that you can't have one playable area directly over another (in other words, buildings with floors is impossible in this game if you want the AI to function properly).
ryukaji
Major
Major
Posts: 513
Joined: Mon Sep 17, 2007 7:46 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Re: Not allow cp selection

Post by ryukaji »

I didnt mean like height "levels" I already have that figured out with the teleports rather than an elevator, and you can get stacked playing areas to work fine if they are the same area which I will have on some of the levels. I read through a lot of the scripting but im really no good at that I need some expert help with it, im sure its pretty simple. I could probably do with looking through the lua functions though
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Not allow cp selection

Post by RepSharpshooter »

Code: Select all

SpawnCharacter(character, GetPathPoint(spawnpath, node))
character = you, comes from somewhere, either a ondeathevent, or you have to search through the team and find him.
spawnpath = name of one in ZE
node = which node on spawnpath (0, 1, 2 ...)



Or you could go the easy route and use:

Code: Select all

--at begining
KillObject(cp2)
KillObject(cp3)
KillObject(cp4)

--when you complete objective
KillObject(cp1)
RespawnObject(cp2)

--when you complete another objective
KillObject(cp2)
RespawnObject(cp3)

Basically turning on/off cps
ryukaji
Major
Major
Posts: 513
Joined: Mon Sep 17, 2007 7:46 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Re: Not allow cp selection

Post by ryukaji »

Oh... thanks ill have to try that so make it like a campaign script
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Not allow cp selection

Post by RepSharpshooter »

Yeah either use an OnEnterRegion to trigger the next level, or you may want to make it a kill all the monsters first objective.

Either way, play the Geonosis training campaign, then look at its script. Knowing what the campaign does, then looking at the script should give you an idea what the code is doing. (that campaign features many different objectives and is a good starting place).
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Not allow cp selection

Post by Fiodis »

jangoisbaddest wrote:Also don't forget that you can't have one playable area directly over another (in other words, buildings with floors is impossible in this game if you want the AI to function properly).
Not true. It's that the AI planning can't handle stairs. If you have a level directly over another floor, it's perfectly ok if there are no obstacles in the way of the planning hubs from the floor below.
Post Reply