Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Here we go again… -.- (Solved)


Recommended Posts

OK, back with another puzzling script O.o

```
Sub Set_Stats(Index, Inifile)
'Set variables
Pokemon = GetVar(Inifile & "", "Data", "Name")

'Calculate HP
IV = GetVar(Inifile & "", "IV", "HpIv")
EV = GetVar(Inifile & "", "EV", "HpEv")
Level = GetVar(Inifile & "", "Data", "Level")
Base = GetVar("PokeSystem\Pokemon\" & Pokemon & ".ini", "Base", "HP")
    HP = int((2 * Base + IV + EV) * Level / 100 + Level + 10)
    Call PutVar(Inifile & "", "Stats", "HP", HP)
    Call PlayerMsg(Index, Pokemon & " has " & HP & " in HP stats.", YELLOW)
    Call PlayerMsg(Index, "Values " & IV & " " & EV & " " & Base & " " & Level & ".", YELLOW)
End Sub

```
whenever i execute this sub, it runs until the putvar, after that… nothing XD
when i comment it out, all works.

also please note, the variable Inifile is a path to a inifile, like c:\test.ini
so, anybody has any ideas?

thanks in advance guys.

Damian666
Link to comment
Share on other sites

O.o… damn it

thats what ya get for looking at scripts for 5 hours ^^
ill try and report back

Damian666

damn, no man, although it was a mistake, it still doesnt work, it should display the last messages, as debug sort of speak, but nothing :/

any other ideas?

Damian666
Link to comment
Share on other sites

```
'Stat Calculations
Sub Set_Stats(Index, Inifile)
'Declare variables
Dim Pokemon
Dim IV
Dim EV
Dim Level
Dim Base
Dim HP

'Set Variables
Pokemon = GetVar(Inifile & "", "Data", "Name")
IV = GetVar(Inifile & "", "IV", "HpIv")
EV = GetVar(Inifile & "", "EV", "HpEv")
Level = GetVar(Inifile & "", "Data", "Level")
Base = GetVar("PokeSystem\Pokemon\" & Pokemon & ".ini", "Base", "HP")

'Calculate HP
    HP = int((2 * Base + IV + EV) * Level / 100 + Level + 10)

    Call PutVar(Inifile & "", "Stats", "HP", HP)
    Call PlayerMsg(Index, Pokemon & " has " & HP & " in HP stats.", YELLOW)
    Call PlayerMsg(Index, "Values " & IV & " " & EV & " " & Base & " " & Level & ".", YELLOW)
End Sub

```
now i have this, still nothing :/

any other suggestions?

Damian666
Link to comment
Share on other sites

ok, still stuck.
so i decided to make it somewhat easyer, just to see if t worked.

```
'Set Variables
Player = GetPlayerLogin(Index)
Pokemon = GetVar("Accounts\" & Player & "\Battle\Wild.ini", "Data", "Name")
IV = GetVar("Accounts\" & Player & "\Battle\Wild.ini", "IV", "HpIv")
EV = GetVar("Accounts\" & Player & "\Battle\Wild.ini", "EV", "HpEv")
Level = GetVar("Accounts\" & Player & "\Battle\Wild.ini", "Data", "Level")
BaseStats = GetVar("PokeSystem\Pokemon\" & Pokemon & ".ini", "Base", "HP")

'Calculate HP
HP = int((2 * BaseStats + IV + EV) * Level / 100 + Level + 10)

Call PutVar("Accounts\" & Player & "\Battle\Wild.ini", "Stats", "HP", HP)
Call PlayerMsg(Index, Pokemon & " has " & HP & " in HP stats.", YELLOW)
Call PlayerMsg(Index, "Values " & IV & " " & EV & " " & BaseStats & " " & Level & ".", YELLOW)

```
and guess what… still nothing :/
still stops working if i use PutVar O.o

anybody?

Damian666
Link to comment
Share on other sites

yeah, thast what i thought O.o

so weird, i test the first IF, so i call it with wild being 0
and it all runs, except the putvar, after that, teh messages should show, but they dont …

so, that means it stops at putvar xD

damian666
Link to comment
Share on other sites

WTF xD

lol, that seemed to work man ^^
the messages after the PutVar are now displayed, i cant check if the variable is really written, because server is not where i am, but tomorrow i can check that too.

but, it seems to work man ^^
all who have helped me, thanks a bunch, i was stuck with my battle system, and now i can finally continue :)

thank you eclipse ^^

Damian666
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...