greetings,
First, I apologize if this has already been posted (I'm sure it has). but I can't find any such postings.
I have a total conversion I am working on, for which I'm not going to divulge what it is until its finished.
I have a very specific concept of spawning enemies on when entering a sector.
example:
I enter sector TID 23 on a hub overworld.
script spawns in the 3 enemies for this sector.
I kill the three enemies and move on to the next sector.
a timer starts for sector 23 and prevents spawns until timer stops
this repeatable with next sectors I enter. (i.e. 24,25,26,27.)
I should be able to see the timer to expire after 30 sec or so.
what i have working
I have a way with only 8-10 lines of code to see the sector tid and spawn enemies in the appropriate sectors the player is in.
I can get "killcount" and tid cominbed in a string but not a reference integer.
freevar = strparam(s:"killcount", d:ranspawn); - will assigning the combines string to int 'freevar'
(ranspawn is the varible of the sector TID the player is in at the moment.)
what i need
I need to combine a string, "killcount", with the variable of the sector tid, 23 or 56 or whatever the tid of the sector is.
AND be able to reference the new variable to implement a timer to the affected sector to prevent further spawns until the timer expires.
I can get the timer to work but not using the variable I need help creating.
the way im thinking is every sector would have created is own variable on the fly and reference it as needed until the timer expires.
confused yet?
perhaps I'm thinking of this working please tell me if I am.
any help is appreciated
integer from string
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
integer from string
Last edited by Cryotube8 on Thu May 02, 2019 2:49 pm, edited 2 times in total.
Re: integer from string
It's hard to tell from your post exactly what you're trying to do. It sounds like you have a ACS script that does exactly what you want for one particular sector, and want to be able to reuse that script for all of your sectors. Is that right?
If you post the script you're using, someone can probably help you parameterize it.
If you post the script you're using, someone can probably help you parameterize it.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: integer from string
The OP edited their post and added more info.