dragonlord52
-
Posts
63 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Calendar
Posts posted by dragonlord52
-
-
Yes, like I said, it works with one of them but none of the others.
I also use that sub in pretty much all of the scripts I make. -
Alright so I am working on a quest script but it wasn't working so I did my typical thing to test what is and isn't working and I have come across an issue. Under the Case 0 in scripted NPC I have a Call TakeItem command (yes it is in my main). I have two NPCs with this command but only one of them works. I have 2 other NPCs and two other cases with the same command and neither work. Any ideas?
Here's the main ScriptedNPC
' Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call TakeItem(Index, 1, 1)
Exit Sub
Case 1
Call TakeItem(Index, 1, 1)
Exit Sub
Case 2
Call TakeItem(Index, 1, 1)
Exit Sub
Case Else
Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End Sub -
Or instead of going up a level your level changes to a randomly generated level with randomly made stats xD
J/K that would be so effed up :o
If you really did consider that I'd suggest making it so that the stats aren't so widely randomized when you actually go from line to star or whatever -.- -
Anybody have any idea what is up with the -1/-1 durability thing? It's preventing players from using certain weapons. I have the "staff" set as a two-handed weapon with no power ups (tut thingy) and as indestructible. The weird thing is that the two-handed sword works just fine?
All help is appreciated. -
It doesn't seem like you have a way to make them gain a lvl and what not unless thats what the giveexp sub does but you don't have numbers input into it? Doesn't look too shabby besides that plus everyone else's advice.
-
That little error fixed the problem for not attacking
I'm such a newb sometimes *smacks forhead*
The staff still doesn't work, prolly still because that -1/-1 durability issue -
Alright so I've almost given up on making this thing work. I'm making a weapon proficiency script and I have a MAJOR problem. For some reason when you buy something at a shop the item script doesn't work breaking attacking. Not only that but when you buy one item of the weapon type all the weapon types become broken at the same time! When you don't buy it and you find the first weapon they all become usable but then you can't have shops or else all the non found ones from that point on break. IDK how to even start fixing this problem and everything I'm doing is in SADscript so there wasn't any source edits…ever. The last problem is that the staff weapon type all say that the weapon is about to break! -1/-1 durability...that doesn't make sense since the weapon is indestructible then when you drop it you get an error and the game closes on you.
Please do not tell me to just use someone's script that does work as I cannot learn from mistakes by doing so.
Note that this was all fine BEFORE the script install. So here is the code, all help is GREATLY appreciated.
> '\\\\\\\\\\\\\\\\\\\\ WEAPON SKILL SCRIPT /////////////////////
> Sub WeaponSkill(Index)
> weapon = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
> weapon_type = GetVar("scripts\weapons.ini", "" & weapon & "", "weapon_type")
> weapon_exp = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", weapon_type & "_exp")
> weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
> next_level_exp = GetVar("scripts\weaponxp.ini", "EXPERIENCE", "" & weapon_level & "")
> weapon_exp = Int(weapon_exp) + 1
> If Int(weapon_exp) >= Int(next_level_exp) Then
> weapon_level = Int(weapon_level) + 1
> weapon_exp = Int(weapon_exp) - Int(next_level_exp)
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "", "" & weapon_level & "")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", weapon_type & "_exp", "" & weapon_exp & "")
> Call PlayerMsg(Index, "Your skill in " & weapon_type & " has increased to level " & weapon_level & ".", 14)
> Else
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", weapon_type & "_exp", "" & weapon_exp & "")
> End If
> End Sub
> '///////////////// END WEAPON SKILL SCRIPT \\\\\\\\\\\\\\\\\\\\\
Attack Script
> ' Executes when a player presses the CONTROL key.
> Sub OnAttack(Index, Damage)
> Dim Target
>
> If Int(Damage) > 0 Then
> If Int(GetPlayerTarget(Index)) > 0 Then
> Target = GetPlayerTarget(Index)
> map = GetPlayerMap(Index)
> x = GetNpcX(map, Target)
> y = GetNpcY(map, Target)
> weapon = GetPlayerWeaponSlot(Index)
> If Int(weapon) > 0 Then
> weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
> weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
> weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
> damage2 = Rand(0, Int(weapon_level))
> Call DamagePlayer(Index, Target, Damage + damage2)
> Else
> Call DamagePlayer(Index, Target, Damage)
> End If
> Call SpellAnim(16, map, x, y)
> Else
> Target = GetPlayerTargetNPC(Index)
> map = GetPlayerMap(Index)
> x = GetNpcX(map, Target)
> y = GetNpcY(map, Target)
> level = GetPlayerLevel(Index)
> points = GetPlayerPOINTS(Index)
> 'Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "TEMP", "tmp_level", level)
> 'Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "TEMP", "tmp_points", points)
>
> weapon = GetPlayerWeaponSlot(Index)
> If Int(weapon) > 0 Then
> weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
> weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
> weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
> damage2 = Rand(0, Int(weapon_level))
> Call DamageNPC(Index, Target, Damage + damage2)
> Else
> Call DamageNPC(Index, Target, Damage)
> End If
> Call SpellAnim(16, map, x, y)
> Call WeaponSkill(Index)
> End If
> End If
> End Sub
>
> Sub OnArrowHit(Index, Damage)
> Dim Target
>
> If Int(Damage) > 0 Then
> If Int(GetPlayerTarget(Index)) > 0 Then
> Target = GetPlayerTarget(Index)
> weapon = GetPlayerWeaponSlot(Index)
> If Int(weapon) > 0 Then
> weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
> weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
> weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
> damage2 = Rand(0, Int(weapon_level))
> Call DamagePlayer(Index, Target, Damage + damage2)
> Else
> Call DamagePlayer(Index, Target, Damage)
> End If
> Else
> Target = GetPlayerTargetNPC(Index)
> weapon = GetPlayerWeaponSlot(Index)
> If Int(weapon) > 0 Then
> weapon2 = GetPlayerInvItemNum(Index, GetPlayerWeaponSlot(Index))
> weapon_type = GetVar("scripts\weapons.ini", "" & weapon2 & "", "weapon_type")
> weapon_level = GetVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "" & weapon_type & "")
> damage2 = Rand(0, Int(weapon_level))
> Call DamageNPC(Index, Target, Damage + damage2)
> Else
> Call DamageNPC(Index, Target, Damage)
> End If
> Call WeaponSkill(Index)
> End If
> End If
> End Sub
NewChar script
> ' Executes when a new character is created.
> Sub OnNewChar(Index, CharNum)
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "sword" "1")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "sword_exp" "0")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "2hsword" "1")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "2hsword_exp" "0")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "mace" "1")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "mace_exp" "0")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "staff" "1")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "staff_exp" "0")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "dagger" "1")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "dagger_exp" "0")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "throwing" "1")
> Call PutVar("scripts\charextras\" & GetPlayerName(Index) & ".ini", "WEAPONS", "throwing_exp" "0")
> End Sub
The character file
> [WEAPONS]
> sword=3
> sword_exp=0
> 2hsword=3
> 2hsword_exp=0
> mace=3
> mace_exp=0
> staff=3
> staff_exp=0
> dagger=3
> dagger_exp=0
> throwing=3
> throwing_exp=0
Weapons File
> '[1] = weapon slot (ex. 12: Small Sword means you put [12])
> [1]
> weapon_name=Sword
> weapon_type=sword
> [4]
> weapon_name=God Sword
> weapon_type=sword
> [6]
> weapon_name=Clerics Rod
> weapon_type=mace
> [7]
> weapon_name=Wizards Staff
> weapon_type=staff
> [16]
> weapon_name=Small Sword
> weapon_type=sword
> [27]
> weapon_name=Two Handed Sword
> weapon_type=2hsword
> [32]
> weapon_name=Survival Knife
> weapon_type=dagger
> [37]
> weapon_name=Heavy Two Handed Sword
> weapon_type=2hsword
> [41]
> weapon_name=Knights Sword
> weapon_type=sword
> [43]
> weapon_name=Heavy Blessed Rod
> weapon_type=mace
> [45]
> weapon_name=Jagged Survival Knife
> weapon_type=dagger
> [48]
> weapon_name=Heavy Staff
> weapon_type=staff
> [66]
> weapon_name=New Cleric Weapon
> weapon_type=mace
> [69]
> weapon_name=Ninja Star
> weapon_type=throwing
> [70]
> weapon_name=Wooden Sword
> weapon_type=sword
> [71]
> weapon_name=Hard Wooden Staff
> weapon_type=staff
> [72]
> weapon_name=Flimsy Rod
> weapon_type=staff
> [73]
> weapon_name=Twig
> weapon_type=dagger
> [73]
> weapon_name=Wooden Kunai
> weapon_type=throwing
> [80]
> weapon_name=Shuriken
> weapon_type=thowing
And finally the exp file
> [EXPERIENCE]
> 1=5
> 2=7 -
You shouldn't do what you wouldn't want other to do to you, simple as that.
-
Nice image, those black lines on the side don't fit in though, they stand out like a swore thumb, lol.
-
Everything in there works fine without the decelerations just so you know. Since I don't use any of those variables in the PutVar commands they shouldn't effect it all.
I still don't see the use of dim when you don't always have to have to make things work as every working script I've made (none of them but the skill script are on here) work without it. -
Stat:Speed
in Q & A
I do believe that would be a source edit as I don't recall there being a sadscript command for it. -
@DarkMazer:
> I don't really see why there'd be a problem, unless the folder "characters" does not exist inside the folder "scripts"… If it doesn't, add it and try again.
> If it does, though, try changing:to Same goes for points.
>
> If that doesn't work, just try messing around with it for a while. I've noticed that the variable never seems to be the right type you want it to be when you're working with PutVar...
OMG I'm such a n00b sometimes xD that folder is suppose to be charextras xD
And yes, Call WeaponSkill is a script in progress that I have created.
EDIT: I have edited the script with your suggestions and still nothing happens -
Could anyone tell me why the variables I want put in the .ini file isn't getting put in there? I've made sure the NPC doesn't die when I hit it as that is what I thought the issue was at first but it didn't fix it.
> ' Executes when a player presses the CONTROL key.
> Sub OnAttack(Index, Damage)
> Dim Target
>
> If Int(Damage) > 0 Then
> If Int(GetPlayerTarget(Index)) > 0 Then
> Target = GetPlayerTarget(Index)
> map = GetPlayerMap(Index)
> x = GetNpcX(map, Target)
> y = GetNpcY(map, Target)
> Call DamagePlayer(Index, Target, Damage)
> Call SpellAnim(1, map, x, y)
> Else
> Target = GetPlayerTargetNPC(Index)
> map = GetPlayerMap(Index)
> x = GetNpcX(map, Target)
> y = GetNpcY(map, Target)
> level = GetPlayerLevel(Index)
> points = GetPlayerPOINTS(Index)
> Call DamageNPC(Index, Target, Damage)
> Call SpellAnim(1, map, x, y)
> Call WeaponSkill(Index)
> Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "level", "" & level & "")
> Call PutVar("scripts\characters\" & GetPlayerName(Index) & ".ini", "TEMP", "points", "" & points & "")
> End If
> End If
> End Sub
Thanks, the help is much appreciated! -
When you say GUI do you mean just the pics in it or actually moving stuff around and making stuff so that it all works? I know you wont be back for another couple days but I'm just curious.
-
Is it just me or do those green and white striped pole things remind you of an old Mario game…haha
-
The Danger! one is uber, haha
-
The tile click sub should look something like this
> Sub OnClick(Index, Script)
> Case 0
>Case Else
> Call PlayerMsg(Index, "The script does not exist, please contact and admin", 14)
> End Sub -
if I'm not mistaken the slash should be a backslash, lol
-
Here, this link tells you all the commands. The command is PutVar BTW
[http://www.touchofdeathforums.com/smf/index.php?topic=8502.0](http://www.touchofdeathforums.com/smf/index.php?topic=8502.0) -
how do you do that?
-
nvm, figured it out delete plox
-
-
Okay, I was dled the source files and was screwing with them to see what I can do with it in terms of the GUI without editing source code. For some reason, when I press the play test button it says its loading it then VB6 closes and the game never pops up but when I go into my processes in the task panel it shows its still running.
I figured, I haven't done much to it so lets just re download it and I'll be good. I downloaded it and its a different client and the code is completely different! I was going to adding the press enter to talk code in but when I got this new client the code it looks for doesn't even exist anymore.
What's version is the download now, lol. -
@dg1423:
> change CanTake(Index, 22, 1) to CanTake(Index, 22, 3) o_O
I was just going to suggest that -.-'
Help Plox
in Programming Questions
Posted
I forgot to do the HP at first but quickly added in 1 after I noticed.
I have tried before this post:
1) Double checking EVERYTHING
2) Reloading the scripts