Author Topic: Scripting Engine Suggestions  (Read 28871 times)

0 Members and 2 Guests are viewing this topic.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #140 on: October 11, 2007, 06:47:30 am »
Saying things like that are just going to make me not do it.

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #141 on: October 11, 2007, 07:02:23 am »
Come on, don't be a pouter ;) It's a great feature and you can do it so just do it please please please? :)

Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: Scripting Engine Suggestions
« Reply #142 on: October 11, 2007, 10:39:19 am »
ah nice enesce. Did you thought about setplayerdeaths by the way?


?  ^^

*coughs*
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #143 on: October 11, 2007, 10:46:16 am »
Why would you want to set a number of player deaths? Not that I'm against the idea.
« Last Edit: October 11, 2007, 10:49:12 am by Aquarius »

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: Scripting Engine Suggestions
« Reply #144 on: October 11, 2007, 11:02:03 am »
just for the script...

Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: Scripting Engine Suggestions
« Reply #145 on: October 11, 2007, 11:03:39 am »
We want to be able to kill the player to reset his position to a nearby spawnpoint, fill up his health and remove any vest or predator while making sure it doesn't affect his kill to death ratio, without having to resort to cheap hacks like increasing his kills. We could also use moveplayer but this causes an annoying stripe to appear between the from and to position and doesn't get rid of the vest problem.
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting Engine Suggestions
« Reply #146 on: October 11, 2007, 04:01:15 pm »
I wont be adding listening sockets, and mouse place won't help anyone at all, what are you going to do with an integer from 0->480,0->640. They aren't world XY like those used in spawning stuff.

GlobalCursorXY = GlobalPlayerXY + (LocalCursorXY * 2)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Engine Suggestions
« Reply #147 on: October 11, 2007, 04:08:59 pm »
I came up with something more like... (px+s*2*(mx-(640/2)), py+s*2*(my-(480/2))) where as px,py = player position, mx,my = player's mouse x,y (according to screen) and s as in scale in case 480 across the screen is not really 480 on the actual map (would need a bunch of testing to get a more accurate number, who knows, it could be 1)

Date Posted: October 11, 2007, 05:07:58 pm
Why would you want to set a number of player deaths? Not that I'm against the idea.
sub-gamemodes

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #148 on: October 11, 2007, 04:53:58 pm »
Guys I wrote the formula on the previous page... it's playerX-640+(cursorX*2),  playerY-480+(cursorY*2). It means if the cursor is in the middle of the screen (320,240) it's exactly in playerX, playerY position (points at the player). If it's in top left screen corner (0,0), it's -640,-480 pixels away etc.
« Last Edit: October 11, 2007, 05:03:02 pm by Aquarius »

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting Engine Suggestions
« Reply #149 on: October 11, 2007, 05:21:39 pm »
if LocalCursor0,0=GlobalPlayerXY then GlobalCursorXY=GlobalPlayerXY+LocalCursorXY
but...
if LocalCursor0,0=Screen0,0 then GlobalCursorXY=what you said

I like the first option more, can't enesce code the cursor 0,0 to playerXY ?
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #150 on: October 11, 2007, 05:40:07 pm »
Hope yas are prepared to have to use ThreadFunc. If I add something like GetClientWhatevererevev() the function will have to send a packet to the client and wait for a response - if their ping is like 500 your script will be stuck on GetClientWhatevererevev() for 500ms; which pretty much forces you to use ThreadFunc, threads don't work very well with scripts.

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #151 on: October 11, 2007, 05:52:36 pm »
You mean it's needed to get client's cursor? Now clients don't send cursor position to the server? Like for the head angle?  ???

Would it be possible instead of ThreadFunc add onServerReceive event or something like this (but only for special things like this one)?
« Last Edit: October 11, 2007, 06:00:13 pm by Aquarius »

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #152 on: October 11, 2007, 06:07:39 pm »
The cursor position isn't bundled with any existing packets (The server itself has no need for it) so it would be in a separate packet; bundling it with an existing packet would create unnecessary bandwidth, which makes server hosts weep and dialup moan.

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Scripting Engine Suggestions
« Reply #153 on: October 11, 2007, 06:55:17 pm »
Maybe it could be optional, enabled by a script function so only servers with scripts which need it would use more bandwidth. And the cursor position could be sent only if it changed, in some reasonable minimal interval like 0.2 seconds. Unless I'm aiming at a moving target very often it's in the same place for a second or sometimes longer. Besides if someone shakes his cursor and has 500 ping, he can't expect 100% accuracy with the spawning objects/teleporting/selecting other players/whatever the cursor position would be needed for. Nothing works perfect with 500 ping.
« Last Edit: October 11, 2007, 07:00:19 pm by Aquarius »

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting Engine Suggestions
« Reply #154 on: October 12, 2007, 03:13:46 pm »
if my MapRandomize function is ever fixed, might you code it (and RandomMap) into SoldatServer's hard code?

pweez? and maybe add Clearfile or Deletefile or something to fix the extra mapslists (mapslist0.txt, mapslist00.txt etc)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Scripting Engine Suggestions
« Reply #155 on: October 12, 2007, 11:24:58 pm »
I want a DeleteFile too. Maybe enabled only with -safe 0, to avoid noobs to post scripts that delete important files.
urraka

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #156 on: October 13, 2007, 02:04:19 am »
mmk ill add DeleteFile. I could have sworn WriteFile('deleteme.txt',''); deleted files at some stage....

And no Kavukamari, I wont be hard-coding things you can do yourself. Learn

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Scripting Engine Suggestions
« Reply #157 on: October 13, 2007, 04:57:01 am »
Fixing ThreadFunc would also be quite 1337 ;D
Kudos for DeleteFile
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Scripting Engine Suggestions
« Reply #158 on: October 13, 2007, 07:23:12 am »
Can't fix that which isn't broken. Its just incompatible.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting Engine Suggestions
« Reply #159 on: October 13, 2007, 10:02:13 am »
a way to get contents of a folder :)
GetDirContents(Directory: string): array of string;