Basic Zscript Question
#1
Posted 05 September 2013 - 12:06 PM
So I'm actually used to commands such as (let's say I want to make a counter for cheats upon every 5 deaths):
Lua:
while true do
local int deaths = 0;
local x = game.Player;
if x.HP == 0 then
deaths = deaths + 1
if deaths == 10 then
local cheat;
cheat = cheat + 1
if cheat > 4 then
cheat = 4;
return end
end
end
end
wait(.1)
end
ZScript (a lot more complicated to me):
import "std.zh"
global script death_count
(I don't remember how it goes from here but, it's all mathematical algorithm which I just don't get completely; the entire algorithm (not the math))
Why is this so complicated? And how can I simplify all these algorithms for myself?
#2
Posted 05 September 2013 - 12:19 PM
Ok first, you don't even need to count deaths:
/** * The number of times Link has perished during this quest. */ int NumDeaths;
ZScript already does that
I'd suggest looking at other peoples scripts to see how they are written. Look at scripts from the script database for example.
- linkinsphere likes this
#3
Posted 05 September 2013 - 12:38 PM
I learned to program in another language first, and the tutorials that Saffith wrote were invaluable. Do them, step by step, don't skip around, and you'll get the structure of the language pretty well. http://www.purezc.ne...showtopic=53370
Also, spend time browsing around the ZCWiki
http://www.shardstor...Cwiki/Main_Page
That should give you a great start. Welcome to PureZC!
#4
Posted 05 September 2013 - 12:44 PM
Ok first, you don't even need to count deaths:
/** * The number of times Link has perished during this quest. */ int NumDeaths;ZScript already does that
I'd suggest looking at other peoples scripts to see how they are written. Look at scripts from the script database for example.
Alright, thanks! Btw, I 'liked' your comment
#5
Posted 05 September 2013 - 06:46 PM
I didn't know that you could set cheat modes from within ZScript: That could make for some bizarre items.
Also tagged with one or more of these keywords: basic, zscript, question, script, programming
Zelda Classic →
Scripting Discussion →
Is Tango still relevant ? (2.55 Alpha 115)Started by Pier , 19 Sep 2023 Tango, 2.55, Alpha 115, String and 2 more... |
|
|
||
Zelda Classic →
Scripting Discussion →
Script Requests →
Dark Link Dungeon Boss for ZC 2.53.XStarted by Wolf Link of Twilight , 14 Jul 2022 dungeon boss, dark link and 2 more... |
|
|
||
Zelda Classic →
Scripting Discussion →
Requests [The Crystal Heart]Started by Ica , 01 Feb 2022 request, help, custom items and 2 more... |
|
|
||
Zelda Classic →
Scripting Discussion →
Boomerang Specific Item PickupStarted by DietWater , 22 Mar 2021 Boomerang, Puzzle, FFC, Script |
|
|
||
Zelda Classic →
Scripting Discussion →
Adding or Removing items from links inventoryStarted by SparksTheUnicorn , 09 Jun 2020 question, items, inventory, link |
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users