Comments (20)
You could put conditions in your script. If they are met, you can load a new script.
For instance if you have completed the mission in the current "area" and you go thru a wormhole and are near an object in the new area, load the new script.
Another way to handle it is that you could just not spawn the wormhole (or have its exit point not go anywhere) until the current mission is complete.
from emptyepsilon.
Thanks for the reply, but I guess you do not entirely understand what I need. (Maybe it is not clear)
Sevcol is a larp, so GM influence is necessary, both in EE and out of EE. Also a 'completion of a mission' is not something you can or want to hardcode. If the players decide to leave without eliminating the enemy ship or the marines board and capture the enemy ship, instead of destroying the ship as expected, they should be allowed to.
I want the GM's to decide which new (mission) area should be loaded. This decision should be made in the previous area, unconnected the previous area or any actions players do.
If they don't decide, a random scenario/area will be loaded if the wormhole is entered by the players.
It is not an option not to spawn the wormhole, because that'd validate world-consistency.
from emptyepsilon.
Ok, I understand now. I don't believe there's a way to load a script from the GM screen yet. Of course daid can answer that better than I.
I am planning on doing a LARP of sorts (since basically EE and other bridgesim games are LARPs in the true-est sense) myself once I finished building my permanent bridge at home. It will be an all day mission (I hope) with mostly the same crew. I don't plan on running a GM screen as I want the script to load based off of events happening during the game with some randomness thrown in.
from emptyepsilon.
Hopefully Daid will read this and implement option then.
Well, If you want an idea how we do it, come to our larp :). Furthermore a GM with a GM-Screen is better, especially in a long game. Since a game gets more interesting if there is somebody who actually responds to the players actions. (And you actually have someone to talk to).
from emptyepsilon.
If it wasn't so far away, I'd consider it. I'm from the US so I can't exactly drive there :)
from emptyepsilon.
It would be ideal if we could let the GM-screen call a script-method at the press of a button, just like the update()-method is now called each game-update.
Maybe reserve the method-names scriptMethodA till scriptMethodX for this functionality. Mission-scripts can than implement one or more of these methods. The GM screen needs some more buttons, and shouldn't crash if a method isn't implemented.
Another option might be sharing some global game-variable, but you would have to read that in the update-method of the script and then reset it if read. But I think that would be rather ugly.
from emptyepsilon.
Perhaps the built-in web server could be modified and used for this. Create a local web page that submits a GET request for calling a function from the LUA script. That function could then load outside scripts.
from emptyepsilon.
Here's a hackish way that works now to do what I was talking about in the previous comment:
save as scenario_99_test.lua
-- Name: Test
-- Description: Test script
function init()
player=PlayerSpaceship():setFaction("Human Navy"):setShipTemplate("Player Cruiser"):setRotation(200)
end
function runscript(delta)
Script():run("test.lua")
end
function update(delta)
if player:getDescription() == "test" then
player:setDescription("") --Set to Blank to make sure it doesn't get run again
runscript()
end
--No victory condition
end
save as test.lua:
victory("Ghosts")
Then from a browser go to this url:
http://localhost:8080/set.lua?setDescription("test")
It will run the function runscript which you then can run whatever you put in that function or run another lua script as in this example (change localhost to your server name/IP in the URL)
from emptyepsilon.
That... is a seriously ugly hack :). And possible if the other option will not be chosen.
To be honest I prefer Vincent's method :P.
from emptyepsilon.
I think the best solution, is to have the scenario define "GM functions" which call functions in the script. And add these functions as buttons on the GM screen.
On the script side, it can look like this:
function init()
addGMFunction("Create something", function()
SpaceStation():setTemplate('Small Station'):setFaction("Human Navy"):setPosition(500, 500)
end)
addGMFunction("Create more", otherFunction)
end
function otherFunction()
SpaceStation():setTemplate('Small Station'):setFaction("Human Navy"):setPosition(500, 500)
end
The C++ code has "callback" functions from C++ code to scripts. But currently this is only supported on "game objects", not globally. And if you look at the SeriousProton/src/scriptInterfaceMagic.h "setcallbackFunction", you can see that there is quite some complexity in these bindings. So I'll have to think a bit on how to implement this.
from emptyepsilon.
Okay, Nice and thanks!
How to implement it in my Lua script? (I can also try at home, but asking it is easier than 30mins of trying).
from emptyepsilon.
The above proposal I gave should work.
I tested it with:
addGMFunction("Test", function()
CpuShip():setShipTemplate("Transport5x5"):setFaction("Human Navy"):setRotation(90):setPosition(2500, 4000):orderIdle():setCallSign("T-5-5"):setScanned(true)
end)
At the end of the init of the empty scenario.
from emptyepsilon.
Awesome.
from emptyepsilon.
(You do need a new build, as the download on emptyepsilon.org isn't updated yet)
from emptyepsilon.
Hey,
Thanks, and now I have another idea. Could it also be possible that a keypress from a console could be determined in the script?
from emptyepsilon.
Nope, keypresses happen client side, while the script runs server side. I'm not going to send all key presses to the server.
from emptyepsilon.
That is too bad, (and why not, it is possible in artemis and a lot of other data is send towards the server, why not keypresses?).
It would lead to more possibilities for scenario's in which you can send data, add small-minigames to enter a wormhole, etc.
from emptyepsilon.
Because instead of keypresses, it would be better to have something less "low level". Like, script requests text input from a certain console, and then gets a call back when the text is entered.
from emptyepsilon.
Well, that is essentially for me the same, but I understand the difference.
from emptyepsilon.
I found a minor annoyance with the function.
When you select a NPC ship, the behavior overlays the GM buttons and you can not select the GM button anymore.
from emptyepsilon.
Related Issues (20)
- [GUI] GM comms chat spawns minimised with regular size. HOT 2
- [GUI] Science database needs scrollbar to certain ships with too many beams and torpedo tubes. HOT 1
- [Ship categories] Freighters and Ktlitan ships should get their own category. HOT 3
- [GM interface improvements] GM input dialogue and Add ship filtering HOT 3
- [gm/ObjectCreationView] Add icons to ship lists HOT 1
- [gm/ObjectCreationView] Allow filtering/sorting ship lists HOT 2
- [AI] CpuShips with 0 max_impulse_speed can set infinite impulse_request values HOT 3
- [GuiAdvancedScrollText] Large number of entries degrades render performance HOT 1
- [GuiScrollbar] Draggable bar size has no lower bound HOT 2
- [GuiScrollbar] Scrollbar bottom range can be positioned below bottom arrow, where user can't scroll HOT 1
- [GuiScrollbar] Arrow scroll amount can be too small HOT 1
- Warp Jammer is invisible in 3D views HOT 1
- [ShipsLogControl] Log might not update if first entry text is the same as the latest
- [Planet] Collision radius isn't updated with object radius
- [scriptdocs] Path references are incorrect
- [docs] Document resource pack creation and usage
- Alpine-linux compiling HOT 9
- Package EmptyEpsilon via Flatpack and publish on Flathub HOT 9
- After building from source running fails due to no config HOT 5
- Pressing delete while at the end of a text entry box crashes the game HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emptyepsilon.