Author Topic: Frosty's scripting thread  (Read 21918 times)

0 Members and 3 Guests are viewing this topic.

DarkCrusade

  • Guest
Re: Frosty's scripting thread
« Reply #120 on: September 04, 2010, 01:42:43 pm »
Did we already explain to you how to debug a script?

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #121 on: September 04, 2010, 07:10:48 pm »
yes

i know its this section, completely

but, once again, i dont know how to get it work

http://pastebin.com/GhFT8PYf

i was on irc @soldat.quakenet

they couldnt figure out it wasnt working either, even spoke to dnmr

i mean the checkpoints arent being triggered At all: http://pastebin.com/gaDmDwkC

none of those writelns are showing, not even the writeconsole message that happens when a lap is finished, so what am i missing?

i think its getting confused with the arrays, i had non array code that would have probably worked better than this....problem is it was unreadable, according to the folks on irc, so i gotta work with array code
« Last Edit: September 04, 2010, 07:45:15 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: Frosty's scripting thread
« Reply #122 on: September 05, 2010, 09:08:11 am »
Chk[1] will always be true - at least judging from the posted section.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #123 on: September 05, 2010, 01:09:51 pm »
how do i fix it it? i only want it to be true when checkplayerdist is true, then False ONLY when all the other checkpoints have been triggered including startfinish, i dont know what to do, but heres the full code

http://pastebin.com/JwTd2uxv

also, each checkpoint should not be triggered until the previous one has, for example, checkpoint 2 should not be triggered unless checkpoint 1 has been triggered and so on

also, my compiler is giving me the following error when the map changes: Flamerace -> onmapchange -> ERROR: '' is not a valid integer value

wtf? there is no '' in the code, and endlap should be set to 20 if readini fails, wth ???
« Last Edit: September 05, 2010, 01:28:42 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Frosty's scripting thread
« Reply #124 on: September 05, 2010, 04:29:17 pm »
I know that it's not really help but let's face the truth: this thread has already 7 pages, almost every second reply is about things that every programmer should know and you send us a code that sometimes doesn't have logical sence at all (however usually is well formated).

I suggest you to just write what you need, maybe someone will script this for you. At least you may have a chance to learn how to script well by watching someone's, better code.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #125 on: September 06, 2010, 02:33:32 am »
can anyone help?

i will do that falcon, in future, ill even have a good hard look at SC, maybe i can learn a heap from there too

how exactly do i make code "make logical sense"? whenever i do, u guys say its "too long" or "unreadable" or "too many crappy logic blocks", i even wrote comments on that code to make it make sense so i must be missing something really important, look, i will take any critique, whatever it is just tell me, but right now i just dont get it

in the meantime, my playerbase is requesting that script to be working, so if theres anything you guys can do to help, id appreciate it :D
« Last Edit: September 06, 2010, 02:42:09 am by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Frosty's scripting thread
« Reply #126 on: September 06, 2010, 04:54:19 am »
how exactly do i make code "make logical sense"? whenever i do, u guys say its "too long" or "unreadable" or "too many crappy logic blocks", i even wrote comments on that code to make it make sense so i must be missing something really important, look, i will take any critique, whatever it is just tell me, but right now i just dont get it

It shouldn't need comments to be readable - then it's clear. Anyway, it's always way harder to read and fix/edit someone's code than to write your own.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Frosty's scripting thread
« Reply #127 on: September 06, 2010, 11:53:50 am »
you miss knowledge like what is break instruction, i'm sure you have no idea about continue too. Not sure if you know exit, but this i hope you do
you don't know probably also what are case and try..except blocks.
defining types seems to be magic for you.
idk if you know a loops like while or repeat..until.
You seems to not know all types of variables.


also you miss some pure logic, that is hard to be learned. sometimes you do things that can be done very easily in very weird way.
That are only things i've noticed so Yes, you miss something....
« Last Edit: September 06, 2010, 11:56:40 am by FalconPL »
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #128 on: September 06, 2010, 01:26:37 pm »
ok, thanks falcon :)

i do know about while, repeat and until but i dont know how to use them in pascal
« Last Edit: September 06, 2010, 01:34:33 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Frosty's scripting thread
« Reply #129 on: September 06, 2010, 03:33:42 pm »
They're used in loops, by exemple:

Code: (pascal) [Select]
procedure MyLoop();
var
i: integer;
begin
result := 0; // You can omit the use of result.
i := result;
//here's the loop
   repeat
   i := i + 1;
   until i > 10
//end of the loop
end;

Or with
Code: [Select]
While
Code: (pascal) [Select]
procedure MyLoop2();
var
i: integer;
begin
 i := i + 1;
 while i < 10 do WriteLn('var i is under 10')
end;

I haven't tested them, nor used them, this is just an exemple on how to use While/Repeat/Until.
« Last Edit: September 06, 2010, 03:35:31 pm by VinceBros »

DarkCrusade

  • Guest
Re: Frosty's scripting thread
« Reply #130 on: September 06, 2010, 03:36:33 pm »
The difference between those two loops is, that while-loops check the condition before iterating the code and the repeat-loop checks after iterating the code.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #131 on: September 06, 2010, 06:43:19 pm »
tx guys

From: September 06, 2010, 08:09:38 pm
question:
why would i need exit for soldat?
« Last Edit: September 06, 2010, 08:09:38 pm by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Frosty's scripting thread
« Reply #132 on: September 07, 2010, 12:43:49 am »
if you want to exit a procedure/function -.-

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #133 on: September 07, 2010, 01:14:42 am »
ahh ok, tx dnmr :)
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #134 on: September 12, 2010, 04:01:12 am »
question

in the ini functions

there is a var called "ini" which is defined once at the top in vars but never actually used, why is that? or have i missed something?

its not even my code thats why im asking, i mean is the variable "ini" even needed as its never actually used?
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: Frosty's scripting thread
« Reply #135 on: September 12, 2010, 04:06:13 am »
Start thinking on your own. The script you uploaded is to be used in an other script. The variable ini is used to store data obviously....

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #136 on: September 12, 2010, 01:27:19 pm »
yeh but where....i dont see it....
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: Frosty's scripting thread
« Reply #137 on: September 12, 2010, 02:26:55 pm »
I feel you need to learn a real programming language before proceeding with your Soldat scripts.

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Frosty's scripting thread
« Reply #138 on: September 13, 2010, 01:19:56 am »
yes but where the hell do i go to learn pascal fully? for example, everywhere ive been for pascal info, tell yous how to use types, and tells you how to use arrays, bot doesnt tell you how to use Both, which is why i have been so confused over types and arrays, but now im starting to figure out types and arrays and now i know how to give a bot an owner
« Last Edit: September 13, 2010, 01:22:24 am by frosty »
check out my server! click here

If at first you don't succeed, Improvise! :D

DarkCrusade

  • Guest
Re: Frosty's scripting thread
« Reply #139 on: September 13, 2010, 03:20:19 am »
Try Java or maybe Python. There are nice Turbo Pascal tutorials out there, just search better.