Author Topic: Question Thread  (Read 31779 times)

0 Members and 1 Guest are viewing this topic.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Question Thread
« Reply #160 on: April 15, 2010, 04:56:39 am »
dc, you're missing a lot of basic knowledge. People are pretty much wasting time explaining to you what the simplest things are, when you could go and read a tutorial peacefully. Then come here when you have troubles with actual scriptcore-specific stuff

DarkCrusade

  • Guest
Re: Question Thread
« Reply #161 on: April 15, 2010, 07:42:34 am »
If you´d had said that the way you did now there would be not much of a problem. You are right when you say that I miss a lot of knowledge, but I´m getting into it I think.


EDIT: Basically my script is ready. I already fixed all bugs (5 without asking, what do you say now :P) and worked on the balance of the classes. Right now there are 5 classes that have really different gameplay. Now I need a host for the script to test it with real players since I cannot host it on my home computer because of my WLAN connection ... any free server hosting services around?
« Last Edit: April 15, 2010, 08:26:43 am by DarkCrusade »

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Question Thread
« Reply #162 on: April 15, 2010, 10:00:16 am »
Wish I could help you, but I am brazilian, and if you guys entered my server, it would be laggy.

Plus, my computer is broken. I am typing now from my mom's notebook.

Congratulations about your Script :)

Gonna test it someday :D
www.soldatx.com.br - The brazilian Soldat community.

DarkCrusade

  • Guest
Re: Question Thread
« Reply #163 on: April 16, 2010, 04:28:06 am »
This is an urgent problem. The server expects an identifier in line 182:1 but the script doesn´t include any errors and should be working. The things I changed were changing the name of Berserker to Crusher, Mage to Alchemist, adding lowered damage for the Crusher and "exploding" knives for the Alchemist.

Code: [Select]
Function OnPlayerDamage(Victim, Shooter: Byte; Damage: Integer): Integer;
var Dam,Chance: Integer;                 <<<<<<<<<<<<<<<<< THIS LINE
begin

// Crusher (additional damage(10-15))

if Klasse[Shooter] = 'Crusher' then begin
Dam := Random(10,15);
             Result := Damage + Dam;
end else Result := Damage;

// Crusher (additional damage(10-15))

if Klasse[Victim] = 'Crusher' then begin
Dam := Random(10,15);
             Result := Damage - Dam;
end else Result := Damage;

// Thief (additional selfdamage)

if Klasse[Victim] = 'Thief' then begin
Dam := Random(5,25);
             Result := Damage + Dam;
end else Result := Damage;

// Alchemist (exploding knives)

if Klasse[Shooter] = 'Alchemist' then begin
Chance := Random(1,2);
if Chance = 1 then begin
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 500, 0, 0, 100, 4, Shooter);
end;
end;
« Last Edit: April 16, 2010, 05:40:50 am by DarkCrusade »

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Question Thread
« Reply #164 on: April 16, 2010, 05:08:29 am »
Can you send the whole script because i dont know where is the line 182:1

DarkCrusade

  • Guest
Re: Question Thread
« Reply #165 on: April 16, 2010, 05:38:32 am »
I marked the line. I won´t upload the whole script until the next version is ready.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Question Thread
« Reply #166 on: April 16, 2010, 05:39:59 am »
Hmmmm which line get an error ?

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Question Thread
« Reply #167 on: April 16, 2010, 06:39:26 am »
Out of my expierence you may forgot a begin/end above OnPlayerDamage; Actually not 100% sure, but look if it is so :p

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Question Thread
« Reply #168 on: April 16, 2010, 08:56:34 am »
Hmmmm which line get an error ?
I marked the line.[...]
Learn to read.

If it says 182 the error is in 181 so you forgot an end.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Question Thread
« Reply #169 on: April 16, 2010, 09:07:16 am »
Code: [Select]
   Chance := Random(1,2);
   if Chance = 1 then begin
This will always true since Random(Min, Max: integer) will never return the actual set Max value.
Use Max + 1 to prevent that.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Question Thread
« Reply #170 on: April 16, 2010, 10:12:52 am »
@Swompie: In addition, for note, I think (not 100% certain) next scripting core, max value is included in the Random function.

DarkCrusade

  • Guest
Re: Question Thread
« Reply #171 on: April 16, 2010, 10:32:30 am »
Thanks for the advice. After that little issue in line 182 I fixed a number of bugs and now the script is working again perfectly :)

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Question Thread
« Reply #172 on: April 16, 2010, 12:21:17 pm »
Damn, Swompie was faster :P

He is correct though. Random(Min, Max) will return all values from Min to Max - 1.

For instance, Random(1,2); would return 1 and 1.

Random(1,3); would return 1 and 2.

See what we mean ?

And, you did miss an end back there.

Try using NotePad++ to prevent this kind of errors. It's awesome.
www.soldatx.com.br - The brazilian Soldat community.

DarkCrusade

  • Guest
Re: Question Thread
« Reply #173 on: April 16, 2010, 12:25:26 pm »
I´m arleady using that stuff and fixed all bugs, thanks :) (and I understand the thing about Random ;) )

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Question Thread
« Reply #174 on: April 16, 2010, 12:45:06 pm »
Good :]

I just posted it there in case you didn't.

I like to cover all possibilities :P

Any more questions/doubts, feel free to ask :D
www.soldatx.com.br - The brazilian Soldat community.

DarkCrusade

  • Guest
Re: Question Thread
« Reply #175 on: April 17, 2010, 11:55:20 am »
So I want to practice more but I´m running out of ideas. I have some other projects going but before I go on with them I must learn some more of Soldat Pascal. Any ideas what I could do?

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Question Thread
« Reply #176 on: April 17, 2010, 12:28:53 pm »
do a barrel roll.

But seriously, if you have completely no ideas, rip something off. Something you like and know well. Like FF or smth. At least it'll keep you entertained and motivated for some time

DarkCrusade

  • Guest
Re: Question Thread
« Reply #177 on: April 17, 2010, 12:49:49 pm »
Had after all some ideas:

- Mountain climbing script (save/load (no buddy system), health restore)
- PunishBot (kicks spammers and bans them for x minutes (nearly finished)

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: Question Thread
« Reply #178 on: April 17, 2010, 02:31:42 pm »
If you need help, I can help you.

Plus, I've made a Buddy Script a few weeks ago.

I'd be glad to help ya :)
www.soldatx.com.br - The brazilian Soldat community.

DarkCrusade

  • Guest
Re: Question Thread
« Reply #179 on: April 17, 2010, 02:37:04 pm »
Thank you, man :)