Welcome aboard Visitor...

Daily Screenshot

Server Costs Target


84% of target met.

Latest Topics

- so i talked with Massi »
- See Commands »
- Now the fun begins »
- Qand answers have returned »
- Call to Arms »
- All Species 8572 Report in »
- hi there »
- Anyone still playing from a decade ago or longer? »
- Game still active. NICE! »
- help me »

Development Blog

- Roadmap »
- Hello strangers, it’s been a while... »
- State of DarkSpace Development »
- Potential planetary interdictor changes! »
- The Silent Cartographer »

Combat Kills

Combat kills in last 24 hours:
No kills today... yet.

Upcoming Events

- Weekly DarkSpace
11/23/24 +1.1 Days

Search

Anniversaries

No anniversaries today.

Social Media

Why not join us on Discord for a chat, or follow us on Twitter or Facebook for more information and fan updates?

Network

DarkSpace
DarkSpace - Beta
Palestar

[FAQ
Forum Index » » Basic Scripting Discussion » » scripting, loads of questions to F :)
 Author scripting, loads of questions to F :)
Lord_Binary
Midshipman

Joined: June 20, 2001
Posts: 459
From: €/Austria/Sol-System
Posted: 2001-11-18 18:44   
1)
client scripts + server scripts
did I get this right ?
you always have to write exaclty ONE script
(not two separte for server+client ?)

so if you want to have client scripts only, it has to look like that

if client()
{
client script part here
...
}
end of script

server script only

if !client()
{
server script part here
...
}
end of script

server+client script

if client()
{
client script-part here
...
}
else
{
server script-part here

}
end of script

????

2) lists of valid arguments to the windows-set of commands ?
for example: hidewindow("ViewTactical")
so ViewTactical is one of them, I'd like to have a complete list of ALL.

3) same goes for spawnship
"ships/icc/engeneering/mr 110/sc-mr 100"
is one valid one
A complete list of all would be nice.

4) add remotecall: what is a verb ?

5) sethull ?
heh, EXPLOIT ???
making some players undestroyable ?

6) how to get max-x, max-y, max-z, min_x, .. of current "universe" ?
something like getuniversecubus()

7) how to destroy an object ?

8) usegadet ? what's a gadet ? key ? what valid keys exist ?

9) it would be nice to enumerate players ?
it's possbile to enumerate ships, but how to distuingsh between npc-ships and player ships ?

10) getting players names would be nice. well, would be at least problematic because it would allow to take action against certain players, but getting them in a way that prevents this would be neat :)

11) letting a npc-ship fly TO a destination would be very cool. like flyto(object, object)

12) changing rotation speed of planets would be cool as well

13) how to check if a point in space at certain x,y,z is inside or on surface of an existing object ?

that's all for now :wink:

[ This Message was edited by: Lord Binary on 2001-11-18 18:50 ]
_________________
"Oh, don't worry, I had some, too. It will be over soon!"'>----------------------------------------------------
Two planets meet in the Universe...
Are you sick? You look so pale!"
"Don't mention it! I have some bad Homo Sapiens!"
"

  Email Lord_Binary
Samweis*
Cadet

Joined: May 29, 2001
Posts: 515
From: Berlin, Germany
Posted: 2001-11-18 23:25   
Solution for point 11 is to give the ship an order:

Quote:

3.18 orderShip
This function sets the order for the specified ship.

-- orderShip( name, target, order )
orderShip( “Eng Alpha”, “Mycopia”, 2 );

Order Value
NOORDER 0
ATTACK 1
DEFEND 2
CAPTURE 3
MOVE 4
RELOAD 5



And i tried to read out the players name with the playership function:

ship = playerShip();
pushChat("Welcome to DarkSpace "..ship );

But this seems not to work ("a nil value"). I placed this in the onTactical funtion.

Also here i got error messages:

local x,y,z=getPosition("Cadet");
pushChat( "Player X:"..x..", Y:"..y..", Z:"..z );
local d = getDistance("Cadet","Secret System Entry");
pushChat("Distance to Secret System Entry: "..d);

I dont get the z position for the ship. If i try it with an object in space then i get all 3 coordinates. Also if i try to get the distance i get an -1

_________________
[GER]Clandiplomat

PIII 450 MHz, 384 MB RAM, Matrox G400 MAX, Soundblaster AWE 64, Windows 2000 Advanced Server SP2 english, DSL, DNS2GO-Client

[ This Message was edited by: Samweis on 2001-11-18 23:27 ]
_________________
[GER]Clandiplomat
P: @31
C: @2


  Email Samweis*
Lord_Binary
Midshipman

Joined: June 20, 2001
Posts: 459
From: €/Austria/Sol-System
Posted: 2001-11-19 03:33   
hi Sam !

thx for 11 :)

think nil etc is due to this
important "smallprint" :wink:

Quote:

its important to note that the script is NOT currently transfered to the connecting client. The script will be accessable only to the data set you export your map onto...



--> playerShip for example currently CAN'T work because it reads out dynamical data.

what the above statement means:
(a bit less cryptic put):
commands only work for the static data that is defined in the map editor.

explains also distance -1, because your secret entry sounds like being dynamicaly generated

if you calc distance between two planets, it will/should work.

IMHO it's of little to no use to start scripting unless this is "script transfer to client" is enabled.

a few answers from F to the brave scripting pioneers here would be neat as well :)

[ This Message was edited by: Lord Binary on 2001-11-19 04:00 ]
_________________
"Oh, don't worry, I had some, too. It will be over soon!"'>----------------------------------------------------
Two planets meet in the Universe...
Are you sick? You look so pale!"
"Don't mention it! I have some bad Homo Sapiens!"
"

  Email Lord_Binary
Samweis*
Cadet

Joined: May 29, 2001
Posts: 515
From: Berlin, Germany
Posted: 2001-11-19 05:08   
My "Secret System Entry" is a wormhole which should be later on (with more scripting ability ) only be opened by a event. This can be a captured planet or if you are near a distance of 500 gu

By the way the wormhole is not moving and i tried to get the distance between the ship (i saved the map as tutorial) and the wormhole. The interesting fact is that only the z-value seems to be missing and not the other values And also i got the position from the ship in the first 2 lines of the script.

Please help us Faustus

_________________
[GER]Clandiplomat

PIII 450 MHz, 384 MB RAM, Matrox G400 MAX, Soundblaster AWE 64, Windows 2000 Advanced Server SP2 english, DSL, DNS2GO-Client

[ This Message was edited by: Samweis on 2001-11-19 05:10 ]
_________________
[GER]Clandiplomat
P: @31
C: @2


  Email Samweis*
Lord_Binary
Midshipman

Joined: June 20, 2001
Posts: 459
From: €/Austria/Sol-System
Posted: 2001-11-19 05:25   
this brings up a new idea:

turning on/off visibility of certian objects via scripts would be kind of fun

actualy, similar to the thing Sam wanted to do with his wormhole if I understood correctly.


[ This Message was edited by: Lord Binary on 2001-11-19 05:27 ]
_________________
"Oh, don't worry, I had some, too. It will be over soon!"'>----------------------------------------------------
Two planets meet in the Universe...
Are you sick? You look so pale!"
"Don't mention it! I have some bad Homo Sapiens!"
"

  Email Lord_Binary
Chromix
Cadet

Joined: June 29, 2001
Posts: 3052
Posted: 2001-11-19 11:36   
1)
yep, both client and serverside script in one file, but without the filename they've nothing in common, so no shared variables and such, so watch out. Also get familiar with LUA if you wanna do some serious scripting.
So your first code snippet is correct

2)
Hiding or bringing certain elements to foreground is only usefull for tutorials, as I wouldn't want my nav-screen to go mad in a normal game.
Oh and "Use the source, Luke"
...load the basic tutorial into the map editor, the standard views are used there, just C&P

4) Verb = instruction.. "do something"
you can i.e. execute server side functions using client side functions with it.

5) yep, sethull is used in some tutorials to make the players ship indestructible or to pre damage other ships for soft combat.
Using this on a multiplayer server is cheating and will have consequences...

6) you create a script for a specific map,
max X = max GU (x-axis) max y should be treated as 0 and max Z is max GU in z-axis

7) not possible atm, but will be implemented later on.

gadget: ecm, weapons, jumpdrive etc...
and you don't know what keys ? you really dont know how to operate your own ship ?!

9) there is a getShips function (re read the reference) you can enumerate em by it. As you create the AI ships within the script you're writing you'll have no problem to distinguish between em.

10) same as above, look at getShips. and yes you can target players in particular on a multiplayer server using it... but guess what are the consequences for you when abusing it

11) orderShip(MoveTO)

12) ... planets that spin faster when you're near them... eeeeeerm no... will just get the clients out of sync, just like setPosition does.

13) there's no function for it, you've to iterate over all planets and compare the distances to do it

14) visibility of objects on/off... eeeeeerm.. NO... thats what the signature is good for.
For jumpgates/wormholes there may be an "operateable" switch be implemented.



Oh and last but not least I might give out the scouting tutorial script (30k) to the really desperate ppl...


[ This Message was edited by: Chromix on 2003-02-20 17:53 ]
_________________


  Email Chromix
Chromix
Cadet

Joined: June 29, 2001
Posts: 3052
Posted: 2001-11-19 12:18   
Oh, and when you run servers using custom scripts that do anything else but say "hi player" then plz set to ladder=off and inform players in the server name of it (script test) or something.
_________________


  Email Chromix
Faustus
Marshal
Palestar


Joined: May 29, 2001
Posts: 2748
From: Austin, Texas
Posted: 2001-11-19 15:31   
There is a typo in the doc...

It's not playerShip()... it's playersShip() as in possessive. so to correct...

pushChat( "Welcome "..playersShip() );

This should work..
_________________


  Goto the website of Faustus
Lord_Binary
Midshipman

Joined: June 20, 2001
Posts: 459
From: €/Austria/Sol-System
Posted: 2001-11-19 17:17   
thx a ton to Chromi

due to his excellent script and explainations here stupid LB fully understood it *g*

and had first success ...

_________________
"Oh, don't worry, I had some, too. It will be over soon!"'>----------------------------------------------------
Two planets meet in the Universe...
Are you sick? You look so pale!"
"Don't mention it! I have some bad Homo Sapiens!"
"

  Email Lord_Binary
Deleted
Midshipman

Joined:
Posts: 0
Posted: 2002-12-07 01:16   
I still dont understand.

How and where do you put the ship lines?

[ This Message was edited by: Ness on 2002-12-07 01:17 ]
_________________


Page created in 0.019088 seconds.


Copyright © 2000 - 2024 Palestar Inc. All rights reserved worldwide.
Terms of use - DarkSpace is a Registered Trademark of PALESTAR