Integers And Variables

  • Thread starter Thread starter XeroGeno
  • Start date Start date
X

XeroGeno

Guest
Hey guys again I thank you all for the help you gave me yesterday.
Theres a problem I am having with the Integers And variables. I am trying to do something similar to the instructions in Ryokos trigger. But I dont know what to do to make it like the one Ryoko has. His trigger does this.
Condition

(Unit-type of (Triggering unit)) Equal to Wisp and Hero_taken[1] Equal to true

I have Unit type through Equal to wisp. But my problem starts with the Hero_taken integer part. Every time I try to put the integer in. It says no variables of this type. Can someone help me with this?
 
You have to make the variable yourself. Hero_taken[1] is Ryoko's custom variable, probably indicating that the player has or hasn't taken a hero. The point is, Ryoko's trigger that you're trying to copy is probably a lot more complicated than you realize.

You'll have to examine exactly what Hero_taken does as a variable, what initializes it and what changes it, and try to emulate all of that in order to get the desired effect.
 
Can someone please reply to this and try to help me? Im so close to finishin this map. And once I figure this thing out it wil be good as done. I know some of you are bright programmers. Someone help the less intelligent!
 
Hmm it might be complicated. But it doesnt look that way. his trigger was the one I showed right there at the first post.
I got the first half. But the and part to the integer. Which I did create. Not copy. I actually made it with a differ name etc. But it should work. But Ryoko only gave basic info. Not on exactly what he did. I will experiment with this problem and find a solution. but if anyone can stil give input on what I should do, I will defnatily appreciate it.
 
Wait....I made the variable a array. Could that be the problem for why its not able to work?
 
It's difficult to help since all you've given of the trigger is the condition. If you post the entire trigger, along with an explanation of the variables involved and what they should be when the trigger activates, I might be able to offer some help. Until then, I don't know enough about what you're trying to do.
 
Well, the "hero_taken", as seen on the tutorial site,
is a variable of type integer, array, of size "number of players".

The same, actually, as "pick_taken".
Only that the picture shouldn't really say "size = 1"...
Should be "size = 'number of players'"... ;)
 
just make a variable of the same as the one ur having problems with... look into his checks it arrays and match it with yours.
 
Ok, Sorry. What im doing is a supposedly simple way to make whisps step into a circle of power to pick a hero. Thats what I was trying to do.
So the trigger ryoko has makes it so when the whisp enters the triggering region. That person gets the hero. And then the integer is supposed to wall off the hero and take it off the map. So you cant pick a double of that hero. The trigger should be this but a little bit different, such as a differ hero. This is ryokos model. :
Choose Hero 1
Events
Unit - A unit enters Hero 1 Region <gen>
Conditions
(Unit-type of (Triggering unit)) Equal to Wisp and Hero_taken[1] equal to true
Actions
Set Hero_Taken[1]=1
Unit-Hide 0011 <gen>
Unit-Create 1 Demonhunter for (owner of (triggering unit)
Camera- Pan Camera for (Owner of (triggering unit) at Center Of playable Map Area
Unit- Remove (triggering unit) from the game
 
I don't mean to step on anyone's toes, but it looks from what you described that Hero_Taken shouldn't be true at first. It should be false, and then when you pick the hero it sets the variable to 1, or true. The way you have it now, if Hero_Taken were false, that trigger wouldn't do anything. Try setting the condition to this:

(Unit-type of (Triggering unit)) Equal to Wisp and Hero_taken[1] equal to false

and see what happens.
 
OK I will do that. but the problem is still with the Variable itself. How do I make the variable a type to where I can make the integer plug into the first part of tha and condition. Because thats what it is. Condition 1 and condition 2 trigger.

In the first you put the whisp triggering unit stuff. In the second is where the integer wil go. But what do I do to make the integer a type to where it will fit into the triggering unit area?. Because thats where im stuck.
 
Oh and Aceheart. I figured that the Pick_taken was the same as Hero_Taken. So when I create the trigger for the integer. The size number should be lets say....nine? because thats the number of users that will be picking heroes on my map.
 
Whats also funky with this is on condition 2. The triggering unit section is where the integer will go. I have made the integer. But when I go to make it in that slot is says no variables of this type defined. So I dont know what to change the variable to.
 
Somehow, I think we're missing something here...

So, just to clear it up a bit:

If you have:

Conditions:
- "condition 1" and "condition 2"

You can also use:

Conditions:
- "condition 1"
- "condition 2"

Two separate conditions, without any "and"...


Either way, since the second condition is supposed to compare some integers,
the condition would have to be started with "integer comparison".


Then again, why don't you simply post your trigger, as you have it currently, here?
 
hmmm. I dont think its comparing integers. Its just a variable containing the integer of the total amount of players, as you specified. I will try to do two seperate conditions. But still. My main problem is I cannot plug in the Specified Variable for the trigger condition. It says no variable type defined. Where it should be at. Instead. The variable is in the second part. Where it does equal to and then the hero_taken variable takes up there. but it shouldnt.
 
Well actually now I think I got it. This is how my trigger is now. But since I have 9 players should I change the equal value to 9? B/C im kinda confused by the variable. Anyways. Heres what I got.
Choose Hero 1
Events
Unit - A unit enters Hero 1 Region <gen>
Conditions
((Unit-type of (Triggering unit)) Equal to Wisp) and (Hero_taken[1] Equal to 1)<--------should I change this to 9?
Actions
 
The entire point of the Hero_Taken variable is to keep people from getting multiple versions of the same hero. So, in Ryoko's example, Player 1 and Player 2 cannot both be Demon Hunters, the first one to get their wisp to the Demon Hunter's Circle gets the hero and then it's fenced off. The Hero_Taken variable acts as a boolean (true/false) flag for whether or not someone already has the hero or not.

Thus, you should NOT set it to nine, since it's meant for only 1 or 0. Also, make sure you want to restrict heroes to one type per game like Ryoko does in the example. If you don't, then you don't even need Hero_Taken in the first place.
 
K I see what you mean. Thanks 1stlancer
I also figured out my other problems and am done with the hero pick triggers! woot! now my map is complete!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Hey Ghan, whatever cron job its part of its not running its been the same for days. If it does not work can we remove it?
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top