[DEPRECIATED] Campaign 4 (Old thread)

Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here.
Note, everything uploaded to this forum, MUST have a license!
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by aubergine »

My assumption is that you're spawning enemy droids using addDroid() and want the droid object for the spawned droid?

If so, you'll need to use either enumArea(), enumRange() or enumDroid() to get a list of the enemy droids after spawning. As you know where you're spawning them, enumArea() or enumRange() would be an economical choice.

Those enum*() functions return an array of droid objects. Now, they might return some droids you don't want, but there's a way to get round that...

Code: Select all

var spawned = 0;

function toLastSpawn(obj) {
   return ( obj.name.indexOf(":" + spawned) != -1 );
}

function spawnDroid(player, x, y, name, body, propulsion, reserved, droidType, turret1, turret2, turret3) {
   // turret2 and turret3 are optional

   if (arguments.length < 9) throw new Error("spawnDroid(): Invalid parameters!");

   var droid = null;

   // append name with spawn count
   arguments[3] += ":" + spawned;

   // spawn droid
   if ( addDroid.apply(this, arguments) ) {
       // droid was added, return it's droid object
       droid = enumArea(x, y, x, y).filter(toLastSpawn);
       droid = (droid.length) ? droid[0] : null;
   }
   
   // increment spawn counter
   ++spawned;

   return droid;
}
Then use spawnDroid() just like you would addDroid().

@Per - it would be much more useful if addDroid() returned the DROID object for the newly created droid, or null if there was a problem. I imagine same is true for addStructure() and addFeature() functions.

Remember that Goth can't add a label to the spawned droid until he has it's droid object ;)

If the game object was returned from those functions, my code sample above would be:

Code: Select all

var newDroid = addDroid(...);
A bit cleaner :)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

Not necessarily for enemy droids (I'll spawn them from templates, no need to custom-build them) .. I'm talking the player's droids as they get off the Transport(s) and when the Rescue Team enters the zone from the southeast.

Here's the flowchart:

Game Starts -> Dialogue -> Take over the Scavenger Sensor -> Spawn Gibbs from Trans1 -> Spawn Commander -> Spawn 6 other units -> Spawn 2 Repair vehicles.

Lay that out for me so I can see how it's supposed to be used, please. :)
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

And yes, I have Skype turned on. :P
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by aubergine »

Well, you'll have fun with the dialogue, that's for sure! There's no wait() (or was it pause()?) function in JS API.

Let me have a brief ponder and I'll see what I can do.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

No problem. I just needed to see an example is all. ;)

I'm going to install the latest Master and see about getting things running there.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by aubergine »

Skype auto-update has managed to massively fubar skype on my machine :( Looks like I really need to upgrade my OS X to 10.6 or 10.7 sooner rather than later!

I assume taking over the scav sensor is via nexus link turret? Is that something player does or scripted?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

Oh dear. :(

Nope, it's an object on the map that I use the script to takeOverSingleStructure() with.

As far as the player is concerned, the Transport One technicians reprogram it using the Transport computer. ;)
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by aubergine »

Ok, so when the player's troops enter that area of the map, you then transfer ownership of the scav sensor to the player?

I'm currently writing a simple sequencer class for dealing with dialog in a cleaner way.

Oh, and in JS API currently only droids can be transferred :(

@Per - can donateObject() be extended to allow transfer of structures as well? And can it be renamed to transferObject() (to tie in with eventObjectTransfer)?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by aubergine »

@Goth can you take a look at this proposed syntax and let me know if it looks ok?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

Yessir, that looks fine to me. :)
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by aubergine »

Well, I'm still coding (I should really get some sleep soon). I've pretty much implemented the sequencer and it's looking like it will deal with vast swathes of your cam4 scripts, even doing things like the droid spawning, scripted moves, console messages, and so on.

I'm assuming you've defined AREA objects on the map for triggers, and labelled them? If so, eventArea<label>() (as applicable) can be used to trigger sequences. If you've not, take a look at Per's mods to cam1a for example: labels.ini (world co-ordinates used in the ini = tile * 128), cam1a.js
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Rman Virgil »

.

Quick question, Goth.

Gonna continue playing this iteration even though you are making changes and wondering if there may still be value in looking out for anything in particular to report on here... ? Or should I wait for your next release ?
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.
User avatar
sensor
Trained
Trained
Posts: 120
Joined: 19 Dec 2009, 09:13

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by sensor »

I do not know what I'm doing wrong in this campaign, the problem arises when you get to the enemy base with a black-colored buildings. There is a few minutes to complete the mission and shortly after the failure message.
The second issue concerns the protection of the conveyor at the beginning of the game if I have to defend at all costs?
Intel(R) Core(TM) i5-2400 CPU @ 3.10 GHz 3,40 GHz
Win 10 Professional 64 bit
graphic card NVIDIA GeForce GTX 750 Ti
RAM 8,0 GB DDR III SDRAM
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

@ Rman: Sure, keep playing it. The missions themselves won't be changed, merely expanded for guidance, clarified as needed, and combed-out for glitches. The underlying framework will be different, but not the gameplay. The current builds are still valid. :) I have bugfixes to apply, still. I will likely put out another release or two using the current code.

@ sensor: make sure you aren't allowing your Commander or the two Hero units (Gibbs and Wilkes) to be destroyed.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: [BETA][Curr: Release-15-C] Campaign 4 Testing & Bug Repo

Post by Goth Zagog-Thou »

@ Aubergine: That's exactly what I needed to see, buddy :) The API actually used on Campaign mode. I'm a visual learner, and I had to see it in action.
Post Reply