| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Shineyest What I say is what I am
 
 
  
  Joined: 10 Mar 2004 Posts: 21 Location: Here
  | 
		
			
				 Posted: Tue Mar 23, 2004 8:21 am    Post subject: 2 quick questions | 
				     | 
			 
			
				
  | 
			 
			
				Firstly:
 
For my custom battle engine I will be able to use equiptment but what I want to know is with "get hero stat" does it read the stat or the stat+equiptment?
 
 
 
Secondly: 
 
How can I set up a script which will be checking a keypress for all of 5 ticks, should I set it so that it does it every tick? or is there another more smooth way? _________________ I am making a game about thieves
  Last edited by Shineyest on Tue Mar 23, 2004 10:26 pm; edited 1 time in total | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Cube Dimensional Traveller
 
 
  
  Joined: 02 Feb 2003 Posts: 294
 
  | 
		
			
				 Posted: Tue Mar 23, 2004 8:47 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				1) It just gets the total stat, meaning both the hero's maximum stat and the equipment stat put together. If you want to find out the hero's stat alone, you'll have to first store the equipment he has in variables using "check equipment()", unequip them, find out his current stat, then re-equip them again. (Adding and Removing commands)
 
 
2) Not actually sure what you want. Please be more specific. | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Bob the Hamster OHRRPGCE Developer
 
 
  
  Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
  | 
		
			
				 Posted: Wed Mar 24, 2004 10:52 am    Post subject: Re: 2 quick questions | 
				     | 
			 
			
				
  | 
			 
			
				 	  | Shineyest wrote: | 	 		  
 
Secondly: 
 
How can I set up a script which will be checking a keypress for all of 5 ticks, should I set it so that it does it every tick? or is there another more smooth way? | 	  
 
 
I am not sure exactly what context you want to do this in, but here is an example autonumber script that illustrates one way of doing it. This could be made simpler, or much more complex, depending on what you are trying to accomplish
 
 
 	  | Code: | 	 		  define script(autonumber,timed wait for key,2,0,0)
 
 
# This script will wait for a certain key for a certain number of
 
# game ticks, and will return true if it is pressed within that time
 
# (or sooner) and will return false if it is not pressed.
 
script, timed wait for key, key, ticks, begin
 
  variable(loop)
 
  variable(got key)
 
  got key:=false
 
  for(loop,1,ticks), do, begin
 
    if(key is pressed(key))
 
      then(got key:=true)
 
    if(got key == false)
 
      then(wait(1))
 
  end
 
  return(got key)
 
end | 	 
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		junahu Custom Title: 45 character limit
 
 
  
  Joined: 13 Jan 2004 Posts: 369 Location: Hull, England
  | 
		
			
				 Posted: Thu Mar 25, 2004 6:02 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				you could use tags. Make two tags (eg. tag:pressspacenow and tag:spacepressed). Put the code for pressing the key in the keypress script of the map. When the key is pressed check the first tag (which through another script elsewhere will only be set to on for a short preiod). If the first tag is on then set the second tag to on. The second tag is checked at the end of the same code that flicked the first tag on for a short period. Then you can just reset these tags ready for next time. _________________
   | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		 |