Mission Scripting Question/Problem/Issue/blah

I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
1, 2
posted on January 24th, 2012, 10:05 pm
Last edited by remore on January 26th, 2012, 6:02 pm, edited 1 time in total.
Right now it is essentially a Federation Tutorial, I was talking with TChapman earlier about it and there will probably be other tutorials of a more basic nature. I might start looking for some voice talent story board brainstorming geniuses and piece together a campaign if i can get enough people poking around.

Edit:
New question (i have more than one but I will spare you my rambling), I am at a loss on how to locate multiples of a type of object (ex. 4 Federation Platforms) findOne is easy but i cannot seem to get find() to work, i think i've got programmers block at the moment.
posted on January 27th, 2012, 10:15 pm
find() returns a table of results. So you can do something like this (assuming we have an entity finder called finder):

Code: Select all

local results = finder:find()

for key, ent in pairs(results) do
    --Do something with ent
end

posted on January 29th, 2012, 4:41 pm
Last edited by remore on January 29th, 2012, 4:54 pm, edited 1 time in total.
Is there a way to simply could the number of entries in "result"? I noticed something else too and I am probably not doing this right either but whenever i try to use the ship.hull or ship.hullValue properties to compair to a number (eg. if enemy1.hull == 0.1 then...) the game crashes.

The other question i have is not related to scripted directly. What do I need to add to a map itself to have a functional AI on it? I know the AI uses a different build list then what the player uses because of systems using the replaceweapon classlabel. but I cannot seem to get the AI to act at all. I think I'm missing something. beyond the AI specific odfs. And do you/FO/anyone have plans of porting the entire A1 campaign any time soon? My thought was after I polish off the last three tutorials (klingons are about 70%, borg at 30%) I could start porting over the klingon campaign since its my favorite. but i don't want to start in on something that someone else is already half finished and then have a poll on whose is better one day which will just lead to a longer run on sentence like this one.  :shifty:
posted on January 29th, 2012, 9:43 pm
There were plans to import the AI missions - but nobody has actually started on that besides making a few maps (and of course Premonitions) :) . In general, you seem to be the first one to actually be giving the missions a serious shot  :thumbsup:
posted on January 30th, 2012, 11:31 am
remore wrote:Is there a way to simply could the number of entries in "result"? I noticed something else too and I am probably not doing this right either but whenever i try to use the ship.hull or ship.hullValue properties to compair to a number (eg. if enemy1.hull == 0.1 then...) the game crashes.


If you mean count, you can get the number of entries in a table using #, like this:

Code: Select all
-- Table is called results
local count = #results


I'll have a look at that hull value crash when I get back home. It shouldn't be doing that at all.

remore wrote:The other question i have is not related to scripted directly. What do I need to add to a map itself to have a functional AI on it? I know the AI uses a different build list then what the player uses because of systems using the replaceweapon classlabel. but I cannot seem to get the AI to act at all. I think I'm missing something. beyond the AI specific odfs.


OK, I think this is it - I'm not somewhere I can check at the minute though, so I may update it later:

Code: Select all
--Make sure player number is correct.
local aiPlayer = Player(2)
aiPlayer.isAI = true
--Real AIP name would go here.
aiPlayer:loadAIP( "example_aip" )


That should make the AI do something.

remore wrote: And do you/FO/anyone have plans of porting the entire A1 campaign any time soon? My thought was after I polish off the last three tutorials (klingons are about 70%, borg at 30%) I could start porting over the klingon campaign since its my favorite.


No plans right now to port the Klingon campaign. Might get back to the Fed one at some point.
posted on January 30th, 2012, 4:05 pm
Last edited by remore on January 30th, 2012, 5:01 pm, edited 1 time in total.
The ship.hull property works when assigning hull values ( ship.hull = 0.1 makes drops the ship to 10% hull) but i cannot use it to check the hull value to see when it reaches a certain point. the # is exactly what I am looking for I'll experiment with it and maybe be able to turn out a working Fed tutorial by tomorrow (without voiceovers of course still need voice talent for that). Will check on AI later.

Anyone every tried enabling the single player (mission) maps in instant action? Would that just be wierd?
posted on January 30th, 2012, 7:02 pm
remore wrote:Anyone every tried enabling the single player (mission) maps in instant action? Would that just be wierd?

I do not believe that is possible yet, but it has been discussed in two threads that I know of, maybe more.  I know that this is the third thread that has suggested something like that.  Something like that would require hard-coding.
posted on January 30th, 2012, 8:57 pm
You can run scripts in instant action. Just set the loader and the script as usual.
posted on January 31st, 2012, 3:44 pm
If life is that simple you'd think it would work in multiplayer too?  :sweatdrop:
posted on January 31st, 2012, 4:36 pm
You can start scripts in multiplayer, yes. Doing things after the game has started  leads to out of sync errors though because there isn't a way to synchronise script instances at the moment. I had a random map generator that would just make a whole bunch of objects before the game started which worked OK as it technically all happened at the same time for all players.
posted on January 31st, 2012, 5:04 pm
what about times evens such as every 10 minutes something happens regardless, would that work or still cause out of sync problems?
posted on January 31st, 2012, 8:51 pm
It's something to play with at the minute, something like that might have success but it would have to be much more frequent.

About your hull thing : can't see why it would crash, unless the entity wasn't valid. I did find that reading hull and hullValue is a bit messed up and gives the wrong values. I'll put out a fix shortly.
1, 2
Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest