Scripting requests
Moderators: winston, another_commander
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
code request:
SetTargetAsMother
Makes the current target of the entity its Mother. (or Leader for that matter)
It would be usefull for non-standard escorting, guarding, etcetera.
Makes the current target of the entity its Mother. (or Leader for that matter)
It would be usefull for non-standard escorting, guarding, etcetera.
Riding the Rocket!
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Again, much too specific and tied to the current scripting model.
Once the JavaScript object model is fleshed out, that’ll be something like “ship.target = ship.leader”. Specific methods for every possible combination of properties will no longer be needed.
Once the JavaScript object model is fleshed out, that’ll be something like “ship.target = ship.leader”. Specific methods for every possible combination of properties will no longer be needed.
E-mail: [email protected]
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
I understood Ahruman in the same way as you did, A_H, so you're not the only one.
Anyway, a method for making an entity the mother of other entities (called by the respective daughter-entities) is exactly what I need for my sentinel asteroids-problem, I guess.
So I second the request.
And (as I don't know if that is self-evident) all entities tying themselves to the same mother via this method should also become a group and therefore get able to reply to groupAttackTarget etc.
Anyway, a method for making an entity the mother of other entities (called by the respective daughter-entities) is exactly what I need for my sentinel asteroids-problem, I guess.
So I second the request.
And (as I don't know if that is self-evident) all entities tying themselves to the same mother via this method should also become a group and therefore get able to reply to groupAttackTarget etc.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Interesting. I intended to write “Post a description rather than desired method name” where it currently says “ Post a description of the desired method name”. I also vividly remember fixing this typo several days ago. Bah.
Anyway… a useful request discusses capabilities, rather than explicit code (in either the existing model or JS).
Anyway… a useful request discusses capabilities, rather than explicit code (in either the existing model or JS).
E-mail: [email protected]
- Arexack_Heretic
- Dangerous Subversive Element
- Posts: 1876
- Joined: Tue Jun 07, 2005 7:32 pm
- Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
- Contact:
- Flying_Circus
- Dangerous
- Posts: 118
- Joined: Thu Dec 09, 2004 10:04 pm
- Location: Hexham, UK
Wouldn't an 'ignore friendly fire' method be useful? For instance, if it could be tied to scan-class, it would prevent protracted Galcop-on-Galcop firefights developing, and if scan-class could be user-defined it would allow factional OXPs to be developed.
Let me know if you want me to ellucidate further, and feel free to contribute any of you own suggestions (if you've understood, this far, that is).
Let me know if you want me to ellucidate further, and feel free to contribute any of you own suggestions (if you've understood, this far, that is).
And so I gave myself to God. There was a pregnant pause before He said "OK"
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Timers. Something like:
where "Stuff I need to do" is a unique (to the script) identifier, myCallback is a JavaScript function, and 42.0 is a time in seconds (in play time; also need a clear discussion of real time vs. play time vs. clock time). Not in 1.68. (Motivation: this is both more efficient and more precise than running stuff off the tickle timer.)
Code: Select all
RegisterTimer("Stuff I need to do", myCallback, 42.0);
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Ability to play “cabin sounds” (sounds with no spacial localization – not a meaningful distinction, yet) and music. Events for various things that make noise (weapons fire). Standard sound effects for these events being moved out into scripts, which can be overridden.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
JavaScript for non-player ships. This will take over the responsibilities of AIs, but also other stuff; for instance, spawn_actions and death_actions will be replaced with ship script events. I’m not sure how to replicate the ability to change AIs that’s currently in place, or whether that will be needed. Possibly ships will have a script and an AI as separate entities.
Ship scripts will look quite a lot like world scripts, only receiving events for their respective ships rather than the player.
Scripts should be able to send commands directly to any entity.
Ship scripts will look quite a lot like world scripts, only receiving events for their respective ships rather than the player.
Scripts should be able to send commands directly to any entity.
E-mail: [email protected]
- Dr. Nil
- ---- E L I T E ----
- Posts: 983
- Joined: Thu Sep 28, 2006 5:11 pm
- Location: Nearest Hoopy Casino
- Contact:
Good job on updating Oolite.
Things I'd like to be able to control with an OXP:
Current system (to have a ship the player is docked with travel to a chosen system or interplanetary space between two chosen systems).
Player ship (I'd like to be able to control which ship and which equipment a player has and to be able to 'store' a ship and it's configuration in the save file for later retrieval).
Both would be necessary for Sidewinder Commander
Things I'd like to be able to control with an OXP:
Current system (to have a ship the player is docked with travel to a chosen system or interplanetary space between two chosen systems).
Player ship (I'd like to be able to control which ship and which equipment a player has and to be able to 'store' a ship and it's configuration in the save file for later retrieval).
Both would be necessary for Sidewinder Commander
And there would probably be a lot of other cool uses for such features.Sidewinder Commander.
The commander is hired by the navy as a Sidewinder pilot. They store his ship while he works his way up in the navy ranks by completing missions from millitary bases and carriers in ever cooler naval ships.
Mostly very short intensely battle oriented missions like carrier defense or interstellar raid. The pay is lousy but there's lots of action and zero expenses.
Instead of paying for gear you are given equipment according to the mission and of course matching your expendability (rank) with the expendability of your gear to the navy.
I.e. you will only get a beam laser equipped sidewinder with nothing else to begin with and have to balance your play between letting others with better equipment take more of the heat in large battles, while still trying to grap some glory in order to advance in rank and get better equipped.
300 billboards in Your Ad Here!
Astromines and more in Commies.
AVAILABLE HERE along with other Oolite eXpansion Packs.
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
A death_by_player_action (as an alternative to death_actions) would be handy.
Oolite presumabley knows that the player rather than an NPC was responsible for a ships death as it awards a kill, but a way for the script to act on this would be useful in combat / escort missions.
EG: Death_actions can be used to advance a counter in a "defend the trade fleet" type mission where a certain number of deaths gives a "tried but failed" briefing. However, carless use of an e-bomb by the player could give a "what did you think you were doing, you were meant to be defending them!" briefing, possibley earning the employer's wrath!
Friendly Fire can be done with an AI that does not go to "Attack Ship" just because the ship has been attacked. EG:-
If the Gobal sets the state to look for targets, then this ship will only fire on or return fire to ships with the role victim9 or warfrigate. If a ship from its own side hits it, rather than switching to attack ship it attacks the nearest enemy ship.
Oolite presumabley knows that the player rather than an NPC was responsible for a ships death as it awards a kill, but a way for the script to act on this would be useful in combat / escort missions.
EG: Death_actions can be used to advance a counter in a "defend the trade fleet" type mission where a certain number of deaths gives a "tried but failed" briefing. However, carless use of an e-bomb by the player could give a "what did you think you were doing, you were meant to be defending them!" briefing, possibley earning the employer's wrath!
Friendly Fire can be done with an AI that does not go to "Attack Ship" just because the ship has been attacked. EG:-
Code: Select all
"LOOK_FOR_TARGETS" = {
ENTER = (switchLightsOff, "scanForNearestShipWithRole: victim9");
"ATTACKED" = ("setStateTo: LOOK_FOR_TARGETS");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: LOOK_FOR_TARGETS");
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"NOTHING_FOUND" = ("setStateTo: LOOK_FOR_TARGETS2");
EXIT = ();
UPDATE = ("scanForNearestShipWithRole: victim9");
};
"LOOK_FOR_TARGETS2" = {
ENTER = (switchLightsOff, "scanForNearestShipWithRole: warfrigate");
"ATTACKED" = ("setStateTo: LOOK_FOR_TARGETS");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: LOOK_FOR_TARGETS");
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"NOTHING_FOUND" = ("setStateTo: LOOK_FOR_TARGETS");
EXIT = ();
UPDATE = ("scanForNearestShipWithRole: warfrigate");
};
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Hopefully it will be possible for ship-attached JavaScript scripts to get a “who killed me” parameter to their didBecomeDead() handler.LittleBear wrote:A death_by_player_action (as an alternative to death_actions) would be handy.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Update on this: the world script event for player deaths now has two paramaters, “whodunnit” and “context”, as in:Ahruman wrote:Hopefully it will be possible for ship-attached JavaScript scripts to get a “who killed me” parameter to their didBecomeDead() handler.
Code: Select all
this.didBecomeDead = function(whodunnit, context)
{
Log("Gadzooks! Player was killed by " + whodunnit + " through " + context + ".");
}
- “energy damage” (whodunnit is a ship)
- “scrape damage” (whodunnit is a ship)
- “heat damage” (whodunnit is null)
- “hit a planet” (whodunnit is a planet)
My intention is (still) to have NPC scripts look similar to world scripts, so the same principle will apply.
Oh, it’ll also be possible for NPC scripts to suppress explosions in their death handlers.
E-mail: [email protected]