Post new topic    
Page «  1, 2, 3  »
Liquid Metal King Slime
Send private message
 
 PostWed Nov 07, 2012 6:33 am
Send private message Reply with quote
Yes, you're correct.. Unfortunately it's another typo I'm afraid. (I really shouyld have tried compiling this before posting)
The line should read

hud:=load medium enemy sprite (0)

this loads the very first medium enemy sprite in the OHR file you're compiling this script into.
You don't actually need the second variable, palette. Because if you leave it out, the script assumes the default palette which is what you'd be looking for 99% of the time.

Anyways, the next thing you need to do when writing scripts is decide how you want your game to call the script. There are several way to call scripts in the engine, and if you poke around it long enough I'm sure you'll fine one that will suit your needs.
Slime
Send private message
 
 PostWed Nov 07, 2012 6:51 am
Send private message Reply with quote
I assume just make it so that it calls on game start for this one

EDIT:

Okay. Its now saying

unrecognized name replacescript. It has not been defined as script, constant,variable, or anything else.
Metal King Slime
Send private message
 
 PostWed Nov 07, 2012 7:49 am
Send private message Reply with quote
My guess would be somewhere you goofed and put "replacescript" instead of "replacemediumenemysprite"
Slime
Send private message
 
 PostWed Nov 07, 2012 7:52 am
Send private message Reply with quote
I didn't write the code.
Spoonweaver did.
Liquid Metal King Slime
Send private message
 
 PostWed Nov 07, 2012 8:38 am
Send private message Reply with quote
Ungrateful....

But yea...
sigh
Slime
Send private message
 
 PostWed Nov 07, 2012 8:46 am
Send private message Reply with quote
Spoonweaver wrote:
Ungrateful....

But yea...
sigh


Ungrateful?
Im not being ungrateful, Not intentionally anyways. Sorry! :/


Im still trying to work this out, Im assuming that the things in the brackets i have to fill out with how i want it all??
Metal King Slime
Send private message
 
 PostWed Nov 07, 2012 9:02 am
Send private message Reply with quote
Hi.

Well Spoonweaver's script isn't too useful directly; rather it's meant as an example of several of the commands you will need. There are various numbers in the script, but if you just leave them all alone, draw a bunch of medium enemy sprites, and import the script and set it as the 'new game' script then you should see the sprites displayed one after another. Look up commands in the Plotscripting Dictionary to learn what the arguments do.

If you want to learn about slices, I suggest reading the Slices Tutorial. But probably you should start with something simpler, and worry about learning all the features of the slice system later.
Slime
Send private message
 
 PostWed Nov 07, 2012 9:24 am
Send private message Reply with quote
TMC wrote:
Hi.

Well Spoonweaver's script isn't too useful directly; rather it's meant as an example of several of the commands you will need. There are various numbers in the script, but if you just leave them all alone, draw a bunch of medium enemy sprites, and import the script and set it as the 'new game' script then you should see the sprites displayed one after another. Look up commands in the Plotscripting Dictionary to learn what the arguments do.

If you want to learn about slices, I suggest reading the Slices Tutorial. But probably you should start with something simpler, and worry about learning all the features of the slice system later.


Hey TMC.

I tried to do that but this is what i got.

SCRIPT ERROR!

replancemediumenemysprite: Invaild sprite record number 1
call chain (current script last): hudloop
Metal King Slime
Send private message
 
 PostWed Nov 07, 2012 1:06 pm
Send private message Reply with quote
It's complaining medium enemy spriteset number 1 doesn't exist. In order words, you only have a single spriteset (number 0). Create some more to see the animation effect.
Metal Slime
Send private message
 
 PostWed Nov 07, 2012 4:05 pm
Send private message Reply with quote
Just to make sure airxzen, you do understand that this script cannot do anything without you drawing the graphic you want to use for HUD first, right? Otherwise, how does the game know what you want the HUD to look like? As Spoony's written this script, you need to use the engine and draw your HUD in the place of 'medium enemy number 0', and then draw what your HUD should look like when the character is has hunger level of '1' in the place of 'medium enemy number 1'. All of these things are in the 'Edit Graphics' menu of custom. This will mean a LOT of HUD graphics though, because you'd also need the visual HUD graphic for hunger level '2' in place of 'medium enemy number 2', and so forth and so on, for as hungry as the player is able to get (here up to 50).

Also note that, as written, the script will pass through all stages of hunger in the blink of an eye, because there are no wait commands. You should probably add a
Code:
wait(100)

or something similar within the while-loop. This will cause the script to wait about 5 or 6 seconds between each 'step' of hunger. You will still need to have 50 different HUD graphics in the first 50 medium enemy slots for this script NOT to crash the game.
I am Srime
Slime Knight
Send private message
 
 PostWed Nov 07, 2012 4:30 pm
Send private message Reply with quote
Welcome to Slime Salad, air! Also, don't forget to export/ include your HS file so that the graphics that you do draw can be found and detected by your script!
You can't fix stupidity.
Liquid Metal King Slime
Send private message
 
 PostWed Nov 07, 2012 4:36 pm
Send private message Reply with quote
ncw64 wrote:
Welcome to Slime Salad, air! Also, don't forget to export/ include your HS file so that the graphics that you do draw can be found and detected by your script!


You mean the HSI file? That actually isn't needed for this, if you are just using enemy sprites by number. The HSI file is only needed for name constants, for example, enemy names.
Slime
Send private message
 
 PostThu Nov 08, 2012 3:37 am
Send private message Reply with quote
Thanks Bob, Ncw and Msw. Helpful actually, I now feel like a utter idiot for not even thinking of that >.>

Code:
include, plotscr.hsd
include, project1.hsi

plotscript,HudLoop,begin

variable (hud,loopcheck,hunger,time)

time:=300
loopcheck:=0
hunger:=0
hud:=load medium enemy sprite (0)
put sprite (hud, 0,0)


#--loop begin--
 while (loopcheck==0) do,begin

if (time==0) then (increment (hunger),time:=300 )

replace medium enemy sprite(hud,hunger)

decrement(time)

if(hunger==50) then (loopcheck:=1)

 end
#--loop end--

gameover
end


So thats the code i am useing, Thanks to Spoonweaver(Thanks Spoonweaver for the template)

Where about should i add the

Code:
wait(100)


I had put it just before end in the loop check area.
But im not sure if thats a good place to put it

-
EDIT:

Code:
#--loop begin--
 while (loopcheck==0) do,begin

if (time==0) then (increment (hunger),time:=300 )

wait (100)

replace medium enemy sprite(hud,hunger)

decrement(time)

if(hunger==50) then (loopcheck:=1)

 end
#--loop end--


So i ended up putting the wait command there.

It seems to work quite well the image i draw changes over time, slowly but it changes.
Now i need to make it so that i can increase it.
Liquid Metal King Slime
Send private message
 
 PostThu Nov 08, 2012 5:48 am
Send private message Reply with quote
just stick it in the loop somewhere. Right in the middle seems good.
Slime
Send private message
 
 PostThu Nov 08, 2012 5:55 am
Send private message Reply with quote
Spoonweaver wrote:
just stick it in the loop somewhere. Right in the middle seems good.


Yeah, I put it in there somewhere.

As i said in my above post that i just edited as you commented.

It works well and changes over time, slowly but it changes.

I now need to make it so that if i eat some food, it will make the image go back to being full again.

Thanks for all the help so for guys, BEST game making community yet!!
Im always on the IRC channel.
#Slimesalad

Come talk.

WARNING: Noob.
Display posts from previous:
Page «  1, 2, 3  »