Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Adam Tohrst

Registered:
Posts: 4
Reply with quote  #1 
Hello Forum!

Fairly new to the Forums, but an avid player of the game for months now.

I took a fairly good look into learning XML for this game, but the process seems a little daunting and the changes discussed largely (I haven't anywhere near exhausted the forums yet) appear to be for small functions here and there.

I was very interested in the idea of having enemies turn into Artefact drops by having the Artefact spawn at the time and location of the enemy that was just destroyed.

It's along those lines that my query lies; does anyone feel it would be possible to have an NPC ship, upon receiving a specific communication from Artemis (or any other PC ship), lay mines in a pattern?

Instructions such as:
        Travel at (Speed) bearing (Heading)
        Spawn Mine (Distance) behind NPC ship
        Repeat until (Number) Mines have been dropped (Possibly Mines created in this way need to have an identifier of some kind
       Change Direction, and then again (For the sake of argument, turning left and then left again so that the ship has doubled back on itself but is higher up the map than the recently dropped line of mines)
        Travel at (Speed) bearing (Heading)
        Spawn Mine (Distance) behind NPC ship

Continuing in this manner, until a preset point (perhaps by having a counter increase each row, and having the process end once the counter reaches the set number), should allow an NPC ship to create a minefield upon command.

To those who have been coding XML for a while, is this possible? Can new Comms Station commands be added to the game in order to facilitate this rather than having it purely a GM command?

Also, my group has been discussing things we'd love to see, and one thing was an escort mission to guard a construction ship building a new station. Immediately my mind raced to the same trick, and I thought "Why can't you just have an NPC ship move to a location, wait for X amount of time, and then destroy it and replace it with a station, in essence having the ship be a construction ship building a new station?". Has this been entertained as a notion before?

I'm done now. I'd love to see people's thoughts. If all of this is possible in XML, then I'll certainly be getting on to Codecademy and learning me some programming!

Xavier Wise

Registered:
Posts: 1,362
Reply with quote  #2 
Quote:
I was very interested in the idea of having enemies turn into Artefact drops by having the Artefact spawn at the time and location of the enemy that was just destroyed.


This should be possible I believe. Without having a go however, I am not 100% certain that it would be easy to accomplish, or even possible.

Quote:
"Why can't you just have an NPC ship move to a location, wait for X amount of time, and then destroy it and replace it with a station, in essence having the ship be a construction ship building a new station?".


You can do this; I have done it in a couple of missions.

Quote:
does anyone feel it would be possible to have an NPC ship, upon receiving a specific communication from Artemis (or any other PC ship), lay mines in a pattern?


I think it would be possible to have an NPC ship spawn mines and lay a minefield. It would take some scripting though, and may not turn out exactly as you envisage. You would have to have the NPC ship run a set pattern and have a set pattern of mines. I do not think you would be able to have the ship deploy a minefield anywhere you want in game, but it would be possible to have them deploy in a specific location on a command from the Comms Officer.

In terms of linking it to a command from comms, that is easy enough. You just use a "Client pressed the key...." condition. I have linked a number of events to client key presses and it works well.

__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community Website

Want to follow development of the TSN Sandbox? Head here:
https://ko-fi.com/xavierwise
Adam Tohrst

Registered:
Posts: 4
Reply with quote  #3 
Him... So it's not possible to have a specific action follow the completion of another action?
Surely by checking if action 1 (moving 2km after being given the order to lay a mine field) is completed, another action could be triggered (lay a mine).
If this is possible, then by checking if 5 mines have been placed, another action (turning 90 degrees) could surely follow, with the same action repeating so the ship is poised to go back along the same route but out of range of the mines, and then have the pattern of travelling and planting mines repeat, but in the coding manually repeating the directions for moving and planting so as to ensure correct application.
This all hinges on 2 things: stacking programmed orders to follow one after the other, which must be possible if an artefact can be dropped after checking if an enemy has been destroyed;
And if spawned items, such as mines, can be given identifiers in the code to make it simple to measure how many mines have been laid by the NPC ship.
Can an autual Comms button be added?
Key commands to trigger events would only work if one or two NPC ships could perform this action on the map and no other trigger events from Comms were on the map.
Toochaos

Registered:
Posts: 30
Reply with quote  #4 
unnamed objects cannot be placed in a relative position, or placed then moved to a relative position. which is how it works with named objects. therefore there is only one way to do this and i will take page and pages of code, but it is possible. first you must ask how big the minefield is, then you must divide the map up into a series of circle with no overlap. then whenever the ship is within one of those circles you get key press from coms to lay mines it will appear to place a mine field in the area it is you can also have it lay mines and have a series of wait timers so it appears to place mine slowly then you have to set up more code for leaving while a mine field is in progress ( and dear god if you get this to work make sure its nice and separated so you can copy and share), but this is just an illusion of good programming. now in contrast what you can do is fake mines by producing named objects and moving them to the ship. then if distance between named object and other named object is <= subtract x from property shields, if shields are <= then do x to a system. thats a fake mine that you can move



also with the space station i use that a number of times, my favorite is the cargo ship has some issues and you dock with it to get people off. since you can only Dock properly with a space station.

no you cannot alter the underlying code in artemis through the editor so you must fake it with get button press. if you do a series you can make them type a sentence


but you can really make ships perform some pretty decent combat moves, but it takes a decent amount of coding. not to put you off most stuff isnt to bad but the mines just wouldn't work well. and i you want to look at a mission and things ive gotten a ship to do my mission is on mission testing thread 
Adam Tohrst

Registered:
Posts: 4
Reply with quote  #5 
Forgive the impertinence, but if named objects can be created, and we can check is specific actions have been performed, then this is incredibly easy.

You create waypoint objects relative to the position of the ship that are invisible upon the creation of the command. Creating each waypoint as a different object with different instruction helps deal with pesky things like asteroids and enemy ships nudging the mine-layer out of the way: Just constantly check for the next waypoint (checking if value of pervious waypoints = destroyed (through contact by mine-layer)), and by placing these other named objects you can then check if these new faux-mine named objects are present. If one is, destroy it and place a mine in it's place.

The way to make it work with less glitches, however, would be to wait until the minefield is complete, or at least a certain Navpoint Object is destroyed, as at that moment you could destroy all the faux-mine objects and replace them with real mines, then the ship turns 90 degrees down the map at the navpoint, hits the next navpoint and turns 90 degrees along the next row and starts placing the new faux-mines.

The only way I could see to make this work with 2 or more ships at once, though, would be to have each set of objects assigned to each ship so faux-mine objects placed by Ship A are differently named by faux-mine objects from Ship B.

Should be fairly simple but repetitive programming.

That's if I'm recalling my C++ experience correctly. I have no experience with XML but object-based programming should be all the same, right?

A point of clarity; my initial statement about destroying a ship and creating a station, through the idea of destroying an enemy and having an Artefact turn up was not an idea I had, but one I liked. I had read it on the Forums and placed it there to show what I've read and liked so far on here.

I knew that this was possible, and there was discussion of invisible objects of an indestructable "Shield" that could be activated as an invisible object relative to the position of the ship.

I can only imagine needing to create 20 named objects for a 3-row minefield of 5 mines across, 15 faux-mines and 5 Nav points to help keep the grid structured. If we're unable to extrapolate simply the speed of a ship and the distance from the next Nav point in order to determine faux-mine drops, then each faux-mine object would need to be placed already upon the command from Comms and the ship passing over them causes the collision that should serve as their destruction and replacement by a mine.

The end result is still acheived; if the ship is vulnerabvle, a half-minefield could be laid down, the NPC ship can be utilised to do this multiple times, and with a tweak to the object names the code can be copy-pasted onto other NPC ships and given another command key for Comms. In this way, a whole fleet could be commanded to lay mines wherever they happen to be, not just in a prescripted area of the map.

I feel I must be missing something. I was never a professional programmer although I take to it quite easily, so I'll never profess to have some deep understanding of it that those of you that have been programming don't have. However, this doesn't seem to be as difficult as it's being made out to be, or as static; is it simply the labour involved in the working out of distances, creating the invisible named objects and setting them to positions relative to the NPC ship?

In game modes of strategic defence, as the Captain is proposing may be on the horizon, I can see this sort of thing being handy.

On another note, why can't Comms commands be added? Why is this set as a fundamental and not a variable we can alter? Surely, with all the mission scripts and custom content someone somewhere has wanted a custom-insult to give to an enemy, or wanted a Comms button to activate a scripted event rather than it being a hotkey.

I apologise, I feel I'm doing nothing but whining about that now. If there's a reason, I'd like to know it. Otherwise I'll chalk it up to a future improvement to be made.

But with the minefield laying idea, has anyone any idea why it wouldn't work the way I'm describing it?

Xavier Wise

Registered:
Posts: 1,362
Reply with quote  #6 

I suggest you download the Mission Editor and see what you can and cannot do. I can see how parts of your ideas would work, but also where they may fall down.

If you do manage to script a ship to lay a minefield as you want, then share the code as I am sure there will be many other mission scripters who would be interested (including myself). If not, then you will soon find the answer to your question about why it might not work.

I can say confidently that it will be quite complex to write in to a script, but without having a go myself, I cannot say for certain if it is or is not possible, and why. I am sure some other experienced scripters would give this same response too.

I would also suggest looking at other peoples' mission scripts for ideas and inspiration. You are welcome to look at any of mine; I have written some that have a series of scripted events based upon a client pressing a key (the Fuel Collection System is one example). The most complex script I have written is the Sandbox Mission Script which has the most developed examples of my ideas. Feel free to pick it apart and get some ideas.


__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community Website

Want to follow development of the TSN Sandbox? Head here:
https://ko-fi.com/xavierwise
Toochaos

Registered:
Posts: 30
Reply with quote  #7 
i would also advise downloading the mission editor. because mines can only be placed in Absolute positions. and you cant do a get location command and use that absolute location, you cannot replace a named object with an unnamed object either. this is not due to the limits of XML, but of what artemis does with it.


i dont know if i mentioned what a named object was and what an unnamed object is.

asteroid, nebulars and mines are unnamed objects.
Ships, Stations, monsters, anomaly and Blackholes are named
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.